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

Unified Diff: content/child/indexed_db/indexed_db_callbacks_impl.cc

Issue 2601983002: [IndexedDB] Adding transaction and value support to observers (Closed)
Patch Set: Moved transaction creation to SendObservations Created 3 years, 11 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: content/child/indexed_db/indexed_db_callbacks_impl.cc
diff --git a/content/child/indexed_db/indexed_db_callbacks_impl.cc b/content/child/indexed_db/indexed_db_callbacks_impl.cc
index 845dc54930a10dc3ee6e899abcbc1c71039d6abf..c55b3db4ff52c46b7d5f24965a4431a5bc032065 100644
--- a/content/child/indexed_db/indexed_db_callbacks_impl.cc
+++ b/content/child/indexed_db/indexed_db_callbacks_impl.cc
@@ -65,8 +65,18 @@ void ConvertDatabaseMetadata(const content::IndexedDBDatabaseMetadata& metadata,
ConvertObjectStoreMetadata(iter.second, &output->objectStores[i++]);
}
-void ConvertValue(const indexed_db::mojom::ValuePtr& value,
- WebIDBValue* web_value) {
+void ConvertReturnValue(const indexed_db::mojom::ReturnValuePtr& value,
+ WebIDBValue* web_value) {
+ IndexedDBCallbacksImpl::ConvertValue(value->value, web_value);
+ web_value->primaryKey = WebIDBKeyBuilder::Build(value->primary_key);
+ web_value->keyPath = WebIDBKeyPathBuilder::Build(value->key_path);
+}
+
+} // namespace
+
+/* static */ void IndexedDBCallbacksImpl::ConvertValue(
jsbell 2017/01/13 00:14:12 Nit: // static ....
dmurph 2017/01/13 01:50:43 Done.
+ const indexed_db::mojom::ValuePtr& value,
+ WebIDBValue* web_value) {
if (value->bits.empty())
return;
@@ -92,14 +102,6 @@ void ConvertValue(const indexed_db::mojom::ValuePtr& value,
web_value->webBlobInfo.swap(local_blob_info);
}
-void ConvertReturnValue(const indexed_db::mojom::ReturnValuePtr& value,
- WebIDBValue* web_value) {
- ConvertValue(value->value, web_value);
- web_value->primaryKey = WebIDBKeyBuilder::Build(value->primary_key);
- web_value->keyPath = WebIDBKeyPathBuilder::Build(value->key_path);
-}
-
-} // namespace
IndexedDBCallbacksImpl::IndexedDBCallbacksImpl(
std::unique_ptr<WebIDBCallbacks> callbacks,
@@ -301,7 +303,7 @@ void IndexedDBCallbacksImpl::InternalState::SuccessCursor(
indexed_db::mojom::ValuePtr value) {
WebIDBValue web_value;
if (value)
- ConvertValue(value, &web_value);
+ IndexedDBCallbacksImpl::ConvertValue(value, &web_value);
WebIDBCursorImpl* cursor =
new WebIDBCursorImpl(std::move(cursor_info), transaction_id_, io_runner_);

Powered by Google App Engine
This is Rietveld 408576698