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

Unified Diff: Source/modules/indexeddb/IDBVersionChangeEvent.cpp

Issue 17060008: Add dataLoss property to IDB's upgradeneeded event (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add blink API stub for compatibility with and without chromium changes Created 7 years, 6 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/modules/indexeddb/IDBVersionChangeEvent.cpp
diff --git a/Source/modules/indexeddb/IDBVersionChangeEvent.cpp b/Source/modules/indexeddb/IDBVersionChangeEvent.cpp
index 76528aa5d6f6f03216e97302aa872a14eacda4af..85e1a7058e28798d0fbfa4146a5aa24e44b412af 100644
--- a/Source/modules/indexeddb/IDBVersionChangeEvent.cpp
+++ b/Source/modules/indexeddb/IDBVersionChangeEvent.cpp
@@ -31,15 +31,16 @@
namespace WebCore {
-PassRefPtr<IDBVersionChangeEvent> IDBVersionChangeEvent::create(PassRefPtr<IDBAny> oldVersion, PassRefPtr<IDBAny> newVersion, const AtomicString& eventType)
+PassRefPtr<IDBVersionChangeEvent> IDBVersionChangeEvent::create(PassRefPtr<IDBAny> oldVersion, PassRefPtr<IDBAny> newVersion, const AtomicString& eventType, WebKit::WebIDBCallbacks::DataLoss dataLoss)
{
- return adoptRef(new IDBVersionChangeEvent(oldVersion, newVersion, eventType));
+ return adoptRef(new IDBVersionChangeEvent(oldVersion, newVersion, eventType, dataLoss));
}
-IDBVersionChangeEvent::IDBVersionChangeEvent(PassRefPtr<IDBAny> oldVersion, PassRefPtr<IDBAny> newVersion, const AtomicString& eventType)
+IDBVersionChangeEvent::IDBVersionChangeEvent(PassRefPtr<IDBAny> oldVersion, PassRefPtr<IDBAny> newVersion, const AtomicString& eventType, WebKit::WebIDBCallbacks::DataLoss dataLoss)
: Event(eventType, false /*canBubble*/, false /*cancelable*/)
, m_oldVersion(oldVersion)
, m_newVersion(newVersion)
+ , m_dataLoss(dataLoss)
{
ScriptWrappable::init(this);
}
@@ -48,6 +49,15 @@ IDBVersionChangeEvent::~IDBVersionChangeEvent()
{
}
+const AtomicString& IDBVersionChangeEvent::dataLoss()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, total, ("total", AtomicString::ConstructFromLiteral));
+ if (m_dataLoss == WebKit::WebIDBCallbacks::DataLossTotal)
+ return total;
+ DEFINE_STATIC_LOCAL(AtomicString, none, ("none", AtomicString::ConstructFromLiteral));
+ return none;
+}
+
const AtomicString& IDBVersionChangeEvent::interfaceName() const
{
return eventNames().interfaceForIDBVersionChangeEvent;
« no previous file with comments | « Source/modules/indexeddb/IDBVersionChangeEvent.h ('k') | Source/modules/indexeddb/IDBVersionChangeEvent.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698