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

Unified Diff: third_party/WebKit/Source/modules/indexeddb/IDBObservation.cpp

Issue 2125213002: [IndexedDB] Propogating changes to observers : Renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lifetime
Patch Set: Minor fix Created 4 years, 5 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: third_party/WebKit/Source/modules/indexeddb/IDBObservation.cpp
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBObservation.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBObservation.cpp
index fa1907d80f5b7d7b8d59e13988b99b00fc159551..e8f3634b4b7384df332290a2c0ceab44b870f53b 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBObservation.cpp
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBObservation.cpp
@@ -11,8 +11,9 @@
#include "bindings/modules/v8/V8BindingForModules.h"
#include "modules/IndexedDBNames.h"
#include "modules/indexeddb/IDBAny.h"
-#include "modules/indexeddb/IDBKey.h"
+#include "modules/indexeddb/IDBKeyRange.h"
#include "modules/indexeddb/IDBValue.h"
+#include "public/platform/modules/indexeddb/WebIDBObservation.h"
namespace blink {
@@ -20,19 +21,18 @@ IDBObservation::~IDBObservation() {}
ScriptValue IDBObservation::key(ScriptState* scriptState)
{
- return ScriptValue::from(scriptState, m_key);
+ if (!m_keyRange)
+ return ScriptValue::from(scriptState, v8::Undefined(scriptState->isolate()));
haraken 2016/07/20 16:22:12 Haven't you made this change in https://codereview
palakj1 2016/07/20 18:22:11 No, I had later modified IDBObservation in 2160163
+
+ return ScriptValue::from(scriptState, m_keyRange);
}
ScriptValue IDBObservation::value(ScriptState* scriptState)
{
- IDBAny* value;
- if (!m_value) {
- value = IDBAny::createUndefined();
- } else {
- value = IDBAny::create(m_value);
- }
- ScriptValue scriptValue = ScriptValue::from(scriptState, value);
- return scriptValue;
+ if (!m_value)
+ return ScriptValue::from(scriptState, v8::Undefined(scriptState->isolate()));
+
+ return ScriptValue::from(scriptState, IDBAny::create(m_value));
}
WebIDBOperationType IDBObservation::stringToOperationType(const String& type)
@@ -71,21 +71,21 @@ const String& IDBObservation::type() const
}
}
-IDBObservation* IDBObservation::create(IDBKey* key, PassRefPtr<IDBValue> value, WebIDBOperationType type)
+IDBObservation* IDBObservation::create(const WebIDBObservation& observation)
{
- return new IDBObservation(key, value, type);
+ return new IDBObservation(observation);
}
-IDBObservation::IDBObservation(IDBKey* key, PassRefPtr<IDBValue> value, WebIDBOperationType type)
- : m_key(key)
- , m_value(value)
- , m_operationType(type)
+IDBObservation::IDBObservation(const WebIDBObservation& observation)
+ : m_keyRange(observation.keyRange)
+ , m_value(IDBValue::create(observation.value))
+ , m_operationType(observation.type)
{
}
DEFINE_TRACE(IDBObservation)
{
- visitor->trace(m_key);
+ visitor->trace(m_keyRange);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698