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

Unified Diff: content/browser/indexed_db/indexed_db_callbacks.cc

Issue 1963293002: Replacing Indexed DB Chromium IPC with Mojo Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Some (incomplete) work on struct traits. 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: content/browser/indexed_db/indexed_db_callbacks.cc
diff --git a/content/browser/indexed_db/indexed_db_callbacks.cc b/content/browser/indexed_db/indexed_db_callbacks.cc
index 6c541b7d5d88d0ba2a54d5441037ef561c101f3e..1d6101baee5341d6ffcb84aab74224697e89fdf0 100644
--- a/content/browser/indexed_db/indexed_db_callbacks.cc
+++ b/content/browser/indexed_db/indexed_db_callbacks.cc
@@ -24,7 +24,6 @@
#include "content/browser/indexed_db/indexed_db_tracing.h"
#include "content/browser/indexed_db/indexed_db_value.h"
#include "content/common/indexed_db/indexed_db_constants.h"
-#include "content/common/indexed_db/indexed_db_messages.h"
#include "storage/browser/blob/blob_storage_context.h"
#include "storage/browser/blob/shareable_file_reference.h"
#include "storage/browser/quota/quota_manager.h"
@@ -33,10 +32,12 @@ using storage::ShareableFileReference;
namespace content {
+#if 0
namespace {
const int32_t kNoCursor = -1;
const int32_t kNoDatabaseCallbacks = -1;
const int64_t kNoTransaction = -1;
+
}
IndexedDBCallbacks::IndexedDBCallbacks(IndexedDBDispatcherHost* dispatcher_host,
@@ -82,10 +83,12 @@ IndexedDBCallbacks::IndexedDBCallbacks(IndexedDBDispatcherHost* dispatcher_host,
ipc_database_callbacks_id_(ipc_database_callbacks_id),
data_loss_(blink::WebIDBDataLossNone),
sent_blocked_(false) {}
+#endif
IndexedDBCallbacks::~IndexedDBCallbacks() {}
void IndexedDBCallbacks::OnError(const IndexedDBDatabaseError& error) {
+#if 0
DCHECK(dispatcher_host_.get());
dispatcher_host_->Send(new IndexedDBMsg_CallbacksError(
@@ -98,9 +101,11 @@ void IndexedDBCallbacks::OnError(const IndexedDBDatabaseError& error) {
base::TimeTicks::Now() - connection_open_start_time_);
connection_open_start_time_ = base::TimeTicks();
}
+#endif
}
void IndexedDBCallbacks::OnSuccess(const std::vector<base::string16>& value) {
+#if 0
DCHECK(dispatcher_host_.get());
DCHECK_EQ(kNoCursor, ipc_cursor_id_);
@@ -116,9 +121,11 @@ void IndexedDBCallbacks::OnSuccess(const std::vector<base::string16>& value) {
dispatcher_host_->Send(new IndexedDBMsg_CallbacksSuccessStringList(
ipc_thread_id_, ipc_callbacks_id_, list));
dispatcher_host_ = NULL;
+#endif
}
void IndexedDBCallbacks::OnBlocked(int64_t existing_version) {
+#if 0
DCHECK(dispatcher_host_.get());
DCHECK_EQ(kNoCursor, ipc_cursor_id_);
@@ -140,19 +147,23 @@ void IndexedDBCallbacks::OnBlocked(int64_t existing_version) {
base::TimeTicks::Now() - connection_open_start_time_);
connection_open_start_time_ = base::TimeTicks();
}
+#endif
}
void IndexedDBCallbacks::OnDataLoss(blink::WebIDBDataLoss data_loss,
std::string data_loss_message) {
+#if 0
DCHECK_NE(blink::WebIDBDataLossNone, data_loss);
data_loss_ = data_loss;
data_loss_message_ = data_loss_message;
+#endif
}
void IndexedDBCallbacks::OnUpgradeNeeded(
int64_t old_version,
std::unique_ptr<IndexedDBConnection> connection,
const IndexedDBDatabaseMetadata& metadata) {
+#if 0
DCHECK(dispatcher_host_.get());
DCHECK_EQ(kNoCursor, ipc_cursor_id_);
@@ -183,11 +194,13 @@ void IndexedDBCallbacks::OnUpgradeNeeded(
base::TimeTicks::Now() - connection_open_start_time_);
connection_open_start_time_ = base::TimeTicks();
}
+#endif
}
void IndexedDBCallbacks::OnSuccess(
std::unique_ptr<IndexedDBConnection> connection,
const IndexedDBDatabaseMetadata& metadata) {
+#if 0
DCHECK(dispatcher_host_.get());
DCHECK_EQ(kNoCursor, ipc_cursor_id_);
@@ -218,12 +231,14 @@ void IndexedDBCallbacks::OnSuccess(
base::TimeTicks::Now() - connection_open_start_time_);
connection_open_start_time_ = base::TimeTicks();
}
+#endif
}
static std::string CreateBlobData(
const IndexedDBBlobInfo& blob_info,
- scoped_refptr<IndexedDBDispatcherHost> dispatcher_host,
+ /*scoped_refptr<IndexedDBDispatcherHost> dispatcher_host,*/
base::TaskRunner* task_runner) {
+#if 0
if (!blob_info.uuid().empty()) {
// We're sending back a live blob, not a reference into our backing store.
return dispatcher_host->HoldBlobData(blob_info);
@@ -239,8 +254,12 @@ static std::string CreateBlobData(
shareable_file->AddFinalReleaseCallback(blob_info.release_callback());
}
return dispatcher_host->HoldBlobData(blob_info);
+#else
+ return std::string();
+#endif
}
+#if 0
static bool CreateAllBlobs(
const std::vector<IndexedDBBlobInfo>& blob_info,
std::vector<IndexedDBMsg_BlobOrFileInfo>* blob_or_file_info,
@@ -323,6 +342,7 @@ static void FillInBlobData(
}
}
}
+#endif
void IndexedDBCallbacks::RegisterBlobsAndSend(
const std::vector<IndexedDBBlobInfo>& blob_info,
@@ -339,6 +359,7 @@ void IndexedDBCallbacks::OnSuccess(scoped_refptr<IndexedDBCursor> cursor,
const IndexedDBKey& key,
const IndexedDBKey& primary_key,
IndexedDBValue* value) {
+#if 0
DCHECK(dispatcher_host_.get());
DCHECK_EQ(kNoCursor, ipc_cursor_id_);
@@ -373,11 +394,13 @@ void IndexedDBCallbacks::OnSuccess(scoped_refptr<IndexedDBCursor> cursor,
base::Unretained(&p->value.blob_or_file_info)));
}
dispatcher_host_ = NULL;
+#endif
}
void IndexedDBCallbacks::OnSuccess(const IndexedDBKey& key,
const IndexedDBKey& primary_key,
IndexedDBValue* value) {
+#if 0
DCHECK(dispatcher_host_.get());
DCHECK_NE(kNoCursor, ipc_cursor_id_);
@@ -420,12 +443,14 @@ void IndexedDBCallbacks::OnSuccess(const IndexedDBKey& key,
base::Unretained(&p->value.blob_or_file_info)));
}
dispatcher_host_ = NULL;
+#endif
}
void IndexedDBCallbacks::OnSuccessWithPrefetch(
const std::vector<IndexedDBKey>& keys,
const std::vector<IndexedDBKey>& primary_keys,
std::vector<IndexedDBValue>* values) {
+#if 0
DCHECK_EQ(keys.size(), primary_keys.size());
DCHECK_EQ(keys.size(), values->size());
@@ -480,9 +505,11 @@ void IndexedDBCallbacks::OnSuccessWithPrefetch(
new IndexedDBMsg_CallbacksSuccessCursorPrefetch(*params.get()));
}
dispatcher_host_ = NULL;
+#endif
}
void IndexedDBCallbacks::OnSuccess(IndexedDBReturnValue* value) {
+#if 0
DCHECK(dispatcher_host_.get());
if (value && value->primary_key.IsValid()) {
@@ -519,11 +546,13 @@ void IndexedDBCallbacks::OnSuccess(IndexedDBReturnValue* value) {
base::Unretained(&p->value.blob_or_file_info)));
}
dispatcher_host_ = NULL;
+#endif
}
void IndexedDBCallbacks::OnSuccessArray(
std::vector<IndexedDBReturnValue>* values,
const IndexedDBKeyPath& key_path) {
+#if 0
DCHECK(dispatcher_host_.get());
DCHECK_EQ(kNoTransaction, host_transaction_id_);
@@ -564,9 +593,11 @@ void IndexedDBCallbacks::OnSuccessArray(
new IndexedDBMsg_CallbacksSuccessArray(*params.get()));
}
dispatcher_host_ = NULL;
+#endif
}
void IndexedDBCallbacks::OnSuccess(const IndexedDBKey& value) {
+#if 0
DCHECK(dispatcher_host_.get());
DCHECK_EQ(kNoCursor, ipc_cursor_id_);
@@ -578,9 +609,11 @@ void IndexedDBCallbacks::OnSuccess(const IndexedDBKey& value) {
dispatcher_host_->Send(new IndexedDBMsg_CallbacksSuccessIndexedDBKey(
ipc_thread_id_, ipc_callbacks_id_, value));
dispatcher_host_ = NULL;
+#endif
}
void IndexedDBCallbacks::OnSuccess(int64_t value) {
+#if 0
DCHECK(dispatcher_host_.get());
DCHECK_EQ(kNoCursor, ipc_cursor_id_);
@@ -592,9 +625,11 @@ void IndexedDBCallbacks::OnSuccess(int64_t value) {
dispatcher_host_->Send(new IndexedDBMsg_CallbacksSuccessInteger(
ipc_thread_id_, ipc_callbacks_id_, value));
dispatcher_host_ = NULL;
+#endif
}
void IndexedDBCallbacks::OnSuccess() {
+#if 0
DCHECK(dispatcher_host_.get());
DCHECK_EQ(kNoCursor, ipc_cursor_id_);
@@ -606,6 +641,7 @@ void IndexedDBCallbacks::OnSuccess() {
dispatcher_host_->Send(new IndexedDBMsg_CallbacksSuccessUndefined(
ipc_thread_id_, ipc_callbacks_id_));
dispatcher_host_ = NULL;
+#endif
}
void IndexedDBCallbacks::SetConnectionOpenStartTime(

Powered by Google App Engine
This is Rietveld 408576698