Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(909)

Unified Diff: Source/core/html/canvas/Canvas2DContextAttributes.cpp

Issue 211503006: Implementation of 2D canvas context lost/restored events (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: adding missing file Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/html/canvas/Canvas2DContextAttributes.cpp
diff --git a/Source/core/html/canvas/Canvas2DContextAttributes.cpp b/Source/core/html/canvas/Canvas2DContextAttributes.cpp
index 66429f5af14e2f11b45ebc63322a58e9dc62859d..e5769581145cb3bd910de514da93cf073dc75f09 100644
--- a/Source/core/html/canvas/Canvas2DContextAttributes.cpp
+++ b/Source/core/html/canvas/Canvas2DContextAttributes.cpp
@@ -28,10 +28,13 @@
#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

Powered by Google App Engine
This is Rietveld 408576698