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

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

Issue 8747002: Dispatch IndexedDB IPC messages to worker threads (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: repurpose obsolete indexed-db switch to control idb on workers 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 #ifndef CONTENT_COMMON_CHILD_THREAD_H_ 5 #ifndef CONTENT_COMMON_CHILD_THREAD_H_
6 #define CONTENT_COMMON_CHILD_THREAD_H_ 6 #define CONTENT_COMMON_CHILD_THREAD_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/shared_memory.h" 11 #include "base/shared_memory.h"
12 #include "content/common/content_export.h" 12 #include "content/common/content_export.h"
13 #include "content/common/message_router.h" 13 #include "content/common/message_router.h"
14 #include "webkit/glue/resource_loader_bridge.h" 14 #include "webkit/glue/resource_loader_bridge.h"
15 15
16 class FileSystemDispatcher; 16 class FileSystemDispatcher;
17 class IndexedDBDispatcher;
18 class IndexedDBMessageFilter;
17 class MessageLoop; 19 class MessageLoop;
18 class QuotaDispatcher; 20 class QuotaDispatcher;
19 class ResourceDispatcher; 21 class ResourceDispatcher;
20 class SocketStreamDispatcher; 22 class SocketStreamDispatcher;
23 class WorkerTaskRunner;
21 24
22 namespace IPC { 25 namespace IPC {
23 class SyncChannel; 26 class SyncChannel;
24 class SyncMessageFilter; 27 class SyncMessageFilter;
25 } 28 }
26 29
27 // The main thread of a child process derives from this class. 30 // The main thread of a child process derives from this class.
28 class CONTENT_EXPORT ChildThread : public IPC::Channel::Listener, 31 class CONTENT_EXPORT ChildThread : public IPC::Channel::Listener,
29 public IPC::Message::Sender { 32 public IPC::Message::Sender {
30 public: 33 public:
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 75
73 // Safe to call on any thread, as long as it's guaranteed that the thread's 76 // Safe to call on any thread, as long as it's guaranteed that the thread's
74 // lifetime is less than the main thread. 77 // lifetime is less than the main thread.
75 IPC::SyncMessageFilter* sync_message_filter(); 78 IPC::SyncMessageFilter* sync_message_filter();
76 79
77 MessageLoop* message_loop(); 80 MessageLoop* message_loop();
78 81
79 // Returns the one child thread. 82 // Returns the one child thread.
80 static ChildThread* current(); 83 static ChildThread* current();
81 84
85 WorkerTaskRunner* worker_task_runner() const;
86 IndexedDBDispatcher* indexed_db_dispatcher() const;
87
82 protected: 88 protected:
83 friend class ChildProcess; 89 friend class ChildProcess;
84 90
85 // Called when the process refcount is 0. 91 // Called when the process refcount is 0.
86 void OnProcessFinalRelease(); 92 void OnProcessFinalRelease();
87 93
88 virtual bool OnControlMessageReceived(const IPC::Message& msg); 94 virtual bool OnControlMessageReceived(const IPC::Message& msg);
89 virtual void OnAskBeforeShutdown(); 95 virtual void OnAskBeforeShutdown();
90 virtual void OnShutdown(); 96 virtual void OnShutdown();
91 97
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 // The OnChannelError() callback was invoked - the channel is dead, don't 139 // The OnChannelError() callback was invoked - the channel is dead, don't
134 // attempt to communicate. 140 // attempt to communicate.
135 bool on_channel_error_called_; 141 bool on_channel_error_called_;
136 142
137 MessageLoop* message_loop_; 143 MessageLoop* message_loop_;
138 144
139 scoped_ptr<FileSystemDispatcher> file_system_dispatcher_; 145 scoped_ptr<FileSystemDispatcher> file_system_dispatcher_;
140 146
141 scoped_ptr<QuotaDispatcher> quota_dispatcher_; 147 scoped_ptr<QuotaDispatcher> quota_dispatcher_;
142 148
149 scoped_refptr<IndexedDBMessageFilter> idb_message_filter_;
150
151 scoped_refptr<WorkerTaskRunner> worker_task_runner_;
152
143 DISALLOW_COPY_AND_ASSIGN(ChildThread); 153 DISALLOW_COPY_AND_ASSIGN(ChildThread);
144 }; 154 };
145 155
146 #endif // CONTENT_COMMON_CHILD_THREAD_H_ 156 #endif // CONTENT_COMMON_CHILD_THREAD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698