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

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

Issue 2601163002: Remove indexed_db_messages.h. (Closed)
Patch Set: Addressed cmumford's feedback. 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/browser/indexed_db/indexed_db_dispatcher_host.cc
diff --git a/content/browser/indexed_db/indexed_db_dispatcher_host.cc b/content/browser/indexed_db/indexed_db_dispatcher_host.cc
index 8e5b19842a0f7438e95645076c116dbc4f44fc7f..06d2f767680ee594e866876bea4efdeb8a5a4f2c 100644
--- a/content/browser/indexed_db/indexed_db_dispatcher_host.cc
+++ b/content/browser/indexed_db/indexed_db_dispatcher_host.cc
@@ -4,35 +4,22 @@
#include "content/browser/indexed_db/indexed_db_dispatcher_host.h"
-#include <stddef.h>
-
#include "base/bind.h"
-#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/guid.h"
#include "base/memory/ptr_util.h"
#include "base/process/process.h"
#include "base/stl_util.h"
#include "base/strings/utf_string_conversions.h"
-#include "content/browser/bad_message.h"
#include "content/browser/indexed_db/indexed_db_callbacks.h"
#include "content/browser/indexed_db/indexed_db_connection.h"
#include "content/browser/indexed_db/indexed_db_context_impl.h"
#include "content/browser/indexed_db/indexed_db_database_callbacks.h"
#include "content/browser/indexed_db/indexed_db_pending_connection.h"
-#include "content/browser/indexed_db/indexed_db_value.h"
-#include "content/browser/renderer_host/render_message_filter.h"
-#include "content/common/indexed_db/indexed_db_messages.h"
-#include "content/common/indexed_db/indexed_db_metadata.h"
#include "content/public/browser/browser_thread.h"
-#include "content/public/browser/user_metrics.h"
-#include "content/public/common/content_switches.h"
-#include "content/public/common/result_codes.h"
#include "storage/browser/blob/blob_data_builder.h"
#include "storage/browser/blob/blob_storage_context.h"
#include "storage/browser/database/database_util.h"
-#include "storage/common/database/database_identifier.h"
-#include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBDatabaseException.h"
#include "url/origin.h"
namespace content {
@@ -52,52 +39,18 @@ IndexedDBDispatcherHost::IndexedDBDispatcherHost(
net::URLRequestContextGetter* request_context_getter,
IndexedDBContextImpl* indexed_db_context,
ChromeBlobStorageContext* blob_storage_context)
- : BrowserMessageFilter(IndexedDBMsgStart),
- BrowserAssociatedInterface(this, this),
- request_context_getter_(request_context_getter),
+ : request_context_getter_(request_context_getter),
indexed_db_context_(indexed_db_context),
blob_storage_context_(blob_storage_context),
ipc_process_id_(ipc_process_id) {
DCHECK(indexed_db_context_.get());
}
-IndexedDBDispatcherHost::~IndexedDBDispatcherHost() {
- // TODO(alecflett): uncomment these when we find the source of these leaks.
- // DCHECK(transaction_size_map_.empty());
- // DCHECK(transaction_origin_map_.empty());
-}
-
-void IndexedDBDispatcherHost::OnChannelClosing() {
- bool success = indexed_db_context_->TaskRunner()->PostTask(
- FROM_HERE,
- base::Bind(&IndexedDBDispatcherHost::ResetDispatcherHosts, this));
-
- if (!success)
- ResetDispatcherHosts();
-}
+IndexedDBDispatcherHost::~IndexedDBDispatcherHost() {}
-void IndexedDBDispatcherHost::OnDestruct() const {
- // The last reference to the dispatcher may be a posted task, which would
- // be destructed on the IndexedDB thread. Without this override, that would
- // take the dispatcher with it. Since the dispatcher may be keeping the
- // IndexedDBContext alive, it might be destructed to on its own thread,
- // which is not supported. Ensure destruction runs on the IO thread instead.
- BrowserThread::DeleteOnIOThread::Destruct(this);
-}
-
-void IndexedDBDispatcherHost::ResetDispatcherHosts() {
- // It is important that the various *_dispatcher_host_ members are reset
- // on the IndexedDB thread, since there might be incoming messages on that
- // thread, and we must not reset the dispatcher hosts until after those
- // messages are processed.
- DCHECK(indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread());
-
- // Prevent any pending connections from being processed.
- is_open_ = false;
-}
-
-bool IndexedDBDispatcherHost::OnMessageReceived(const IPC::Message& message) {
- return false;
+void IndexedDBDispatcherHost::AddBinding(
+ ::indexed_db::mojom::FactoryAssociatedRequest request) {
+ bindings_.AddBinding(this, std::move(request));
}
std::string IndexedDBDispatcherHost::HoldBlobData(
@@ -142,11 +95,6 @@ void IndexedDBDispatcherHost::DropBlobData(const std::string& uuid) {
--iter->second.second;
}
-bool IndexedDBDispatcherHost::IsOpen() const {
- DCHECK(indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread());
- return is_open_;
-}
-
void IndexedDBDispatcherHost::GetDatabaseNames(
::indexed_db::mojom::CallbacksAssociatedPtrInfo callbacks_info,
const url::Origin& origin) {
« no previous file with comments | « content/browser/indexed_db/indexed_db_dispatcher_host.h ('k') | content/browser/indexed_db/indexed_db_transaction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698