| 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
|
|
|