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

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

Issue 2601983002: [IndexedDB] Adding transaction and value support to observers (Closed)
Patch Set: added comments and bug link 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..35c0dc1761c0ecda0f18ed49fd4acc6c8c188b0c 100644
--- a/content/child/indexed_db/indexed_db_callbacks_impl.cc
+++ b/content/child/indexed_db/indexed_db_callbacks_impl.cc
@@ -65,8 +65,19 @@ 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(
+ const indexed_db::mojom::ValuePtr& value,
+ WebIDBValue* web_value) {
if (value->bits.empty())
return;
@@ -92,14 +103,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 +304,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_);
« no previous file with comments | « content/child/indexed_db/indexed_db_callbacks_impl.h ('k') | content/child/indexed_db/indexed_db_database_callbacks_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698