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

Side by Side Diff: content/common/child_thread.cc

Issue 8747002: Dispatch IndexedDB IPC messages to worker threads (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/common/child_thread.h" 5 #include "content/common/child_thread.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "content/common/child_process.h" 10 #include "content/common/child_process.h"
11 #include "content/common/child_process_messages.h" 11 #include "content/common/child_process_messages.h"
12 #include "content/common/child_trace_message_filter.h" 12 #include "content/common/child_trace_message_filter.h"
13 #include "content/common/file_system/file_system_dispatcher.h" 13 #include "content/common/file_system/file_system_dispatcher.h"
14 #include "content/common/quota_dispatcher.h" 14 #include "content/common/quota_dispatcher.h"
15 #include "content/common/resource_dispatcher.h" 15 #include "content/common/resource_dispatcher.h"
16 #include "content/common/socket_stream_dispatcher.h" 16 #include "content/common/socket_stream_dispatcher.h"
17 #include "content/public/common/content_switches.h" 17 #include "content/public/common/content_switches.h"
18 #include "content/renderer/indexed_db_message_filter.h"
18 #include "ipc/ipc_logging.h" 19 #include "ipc/ipc_logging.h"
19 #include "ipc/ipc_sync_channel.h" 20 #include "ipc/ipc_sync_channel.h"
20 #include "ipc/ipc_sync_message_filter.h" 21 #include "ipc/ipc_sync_message_filter.h"
21 #include "ipc/ipc_switches.h" 22 #include "ipc/ipc_switches.h"
22 #include "webkit/glue/webkit_glue.h" 23 #include "webkit/glue/webkit_glue.h"
23 24
24 #if defined(OS_WIN) 25 #if defined(OS_WIN)
25 #include "content/common/handle_enumerator_win.h" 26 #include "content/common/handle_enumerator_win.h"
26 #endif 27 #endif
27 28
(...skipping 22 matching lines...) Expand all
50 51
51 resource_dispatcher_.reset(new ResourceDispatcher(this)); 52 resource_dispatcher_.reset(new ResourceDispatcher(this));
52 socket_stream_dispatcher_.reset(new SocketStreamDispatcher()); 53 socket_stream_dispatcher_.reset(new SocketStreamDispatcher());
53 file_system_dispatcher_.reset(new FileSystemDispatcher()); 54 file_system_dispatcher_.reset(new FileSystemDispatcher());
54 quota_dispatcher_.reset(new QuotaDispatcher()); 55 quota_dispatcher_.reset(new QuotaDispatcher());
55 56
56 sync_message_filter_ = 57 sync_message_filter_ =
57 new IPC::SyncMessageFilter(ChildProcess::current()->GetShutDownEvent()); 58 new IPC::SyncMessageFilter(ChildProcess::current()->GetShutDownEvent());
58 channel_->AddFilter(sync_message_filter_.get()); 59 channel_->AddFilter(sync_message_filter_.get());
59 channel_->AddFilter(new ChildTraceMessageFilter()); 60 channel_->AddFilter(new ChildTraceMessageFilter());
61 idb_message_filter_ = new IndexedDBMessageFilter();
62 channel_->AddFilter(idb_message_filter_.get());
60 } 63 }
61 64
62 ChildThread::~ChildThread() { 65 ChildThread::~ChildThread() {
63 #ifdef IPC_MESSAGE_LOG_ENABLED 66 #ifdef IPC_MESSAGE_LOG_ENABLED
64 IPC::Logging::GetInstance()->SetIPCSender(NULL); 67 IPC::Logging::GetInstance()->SetIPCSender(NULL);
65 #endif 68 #endif
66 69
67 channel_->RemoveFilter(sync_message_filter_.get()); 70 channel_->RemoveFilter(sync_message_filter_.get());
68 71
69 // Close this channel before resetting the message loop attached to it so 72 // Close this channel before resetting the message loop attached to it so
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 MessageLoop::current()->Quit(); 243 MessageLoop::current()->Quit();
241 return; 244 return;
242 } 245 }
243 246
244 // The child process shutdown sequence is a request response based mechanism, 247 // The child process shutdown sequence is a request response based mechanism,
245 // where we send out an initial feeler request to the child process host 248 // where we send out an initial feeler request to the child process host
246 // instance in the browser to verify if it's ok to shutdown the child process. 249 // instance in the browser to verify if it's ok to shutdown the child process.
247 // The browser then sends back a response if it's ok to shutdown. 250 // The browser then sends back a response if it's ok to shutdown.
248 Send(new ChildProcessHostMsg_ShutdownRequest); 251 Send(new ChildProcessHostMsg_ShutdownRequest);
249 } 252 }
253
254 IndexedDBDispatcher* ChildThread::indexed_db_dispatcher() const {
255 return idb_message_filter_->thread_specific_idb_dispatcher();
256 }
257
258 WebCoreWorkerTracker* ChildThread::webcore_worker_tracker() const {
259 return idb_message_filter_;
260 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698