Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / html / canvas / Canvas2DContextAttributes.cpp
index 66429f5..e576958 100644 (file)
 
 #include "Canvas2DContextAttributes.h"
 
+#include "wtf/text/WTFString.h"
+
 namespace WebCore {
 
 Canvas2DContextAttributes::Canvas2DContextAttributes()
     : m_alpha(true)
+    , m_storage(PersistentStorage)
 {
     ScriptWrappable::init(this);
 }
@@ -55,4 +58,22 @@ void Canvas2DContextAttributes::setAlpha(bool alpha)
     m_alpha = alpha;
 }
 
+String Canvas2DContextAttributes::storage() const
+{
+    return m_storage == PersistentStorage ? "persistent" : "discardable";
+}
+
+void Canvas2DContextAttributes::setStorage(const String& storage)
+{
+    if (storage == "persistent")
+        m_storage = PersistentStorage;
+    else if (storage == "discardable")
+        m_storage = DiscardableStorage;
+}
+
+Canvas2DContextStorage Canvas2DContextAttributes::parsedStorage() const
+{
+    return m_storage;
+}
+
 } // namespace WebCore