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

Side by Side Diff: content/browser/indexed_db/indexed_db_dispatcher_host.cc

Issue 2386683003: IndexedDB: Ignore open/delete requests from terminated renderers. (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/indexed_db/indexed_db_dispatcher_host.h" 5 #include "content/browser/indexed_db/indexed_db_dispatcher_host.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 BrowserThread::DeleteOnIOThread::Destruct(this); 88 BrowserThread::DeleteOnIOThread::Destruct(this);
89 } 89 }
90 90
91 void IndexedDBDispatcherHost::ResetDispatcherHosts() { 91 void IndexedDBDispatcherHost::ResetDispatcherHosts() {
92 // It is important that the various *_dispatcher_host_ members are reset 92 // It is important that the various *_dispatcher_host_ members are reset
93 // on the IndexedDB thread, since there might be incoming messages on that 93 // on the IndexedDB thread, since there might be incoming messages on that
94 // thread, and we must not reset the dispatcher hosts until after those 94 // thread, and we must not reset the dispatcher hosts until after those
95 // messages are processed. 95 // messages are processed.
96 DCHECK(indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); 96 DCHECK(indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread());
97 97
98 is_open_ = false;
cmumford 2016/10/03 18:39:26 Do you need |is_open|, or can you just use databas
jsbell 2016/10/03 19:28:37 It proceeds the CloseAll() which can trigger side-
99
98 // Note that we explicitly separate CloseAll() from destruction of the 100 // Note that we explicitly separate CloseAll() from destruction of the
99 // DatabaseDispatcherHost, since CloseAll() can invoke callbacks which need to 101 // DatabaseDispatcherHost, since CloseAll() can invoke callbacks which need to
100 // be dispatched through database_dispatcher_host_. 102 // be dispatched through database_dispatcher_host_.
101 database_dispatcher_host_->CloseAll(); 103 database_dispatcher_host_->CloseAll();
102 database_dispatcher_host_.reset(); 104 database_dispatcher_host_.reset();
103 cursor_dispatcher_host_.reset(); 105 cursor_dispatcher_host_.reset();
104 } 106 }
105 107
106 base::TaskRunner* IndexedDBDispatcherHost::OverrideTaskRunnerForMessage( 108 base::TaskRunner* IndexedDBDispatcherHost::OverrideTaskRunnerForMessage(
107 const IPC::Message& message) { 109 const IPC::Message& message) {
(...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after
1092 DLOG(ERROR) << "Unable to reset prefetch"; 1094 DLOG(ERROR) << "Unable to reset prefetch";
1093 } 1095 }
1094 1096
1095 void IndexedDBDispatcherHost::CursorDispatcherHost::OnDestroyed( 1097 void IndexedDBDispatcherHost::CursorDispatcherHost::OnDestroyed(
1096 int32_t ipc_object_id) { 1098 int32_t ipc_object_id) {
1097 DCHECK(parent_->context()->TaskRunner()->RunsTasksOnCurrentThread()); 1099 DCHECK(parent_->context()->TaskRunner()->RunsTasksOnCurrentThread());
1098 parent_->DestroyObject(&map_, ipc_object_id); 1100 parent_->DestroyObject(&map_, ipc_object_id);
1099 } 1101 }
1100 1102
1101 } // namespace content 1103 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698