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

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: remove debug 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..96fb2d04e132e66dade0bd4d6392b5c45d765984 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, bool 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, bool dataLoss)
: Event(eventType, false /*canBubble*/, false /*cancelable*/)
, m_oldVersion(oldVersion)
, m_newVersion(newVersion)
+ , m_dataLoss(dataLoss)
{
ScriptWrappable::init(this);
}
@@ -48,6 +49,13 @@ IDBVersionChangeEvent::~IDBVersionChangeEvent()
{
}
+String IDBVersionChangeEvent::dataLoss()
+{
+ if (m_dataLoss)
+ return "total";
jsbell 2013/06/14 20:44:04 Should these be atomic strings, like the IDBCursor
dgrogan 2013/06/14 22:41:14 Probably, but I'm just cargo culting. Changed.
+ return "none";
+}
+
const AtomicString& IDBVersionChangeEvent::interfaceName() const
{
return eventNames().interfaceForIDBVersionChangeEvent;

Powered by Google App Engine
This is Rietveld 408576698