OLD | NEW |
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 #ifndef CONTENT_CHILD_CHILD_THREAD_IMPL_H_ | 5 #ifndef CONTENT_CHILD_CHILD_THREAD_IMPL_H_ |
6 #define CONTENT_CHILD_CHILD_THREAD_IMPL_H_ | 6 #define CONTENT_CHILD_CHILD_THREAD_IMPL_H_ |
7 | 7 |
| 8 #include <stddef.h> |
| 9 #include <stdint.h> |
| 10 |
8 #include <string> | 11 #include <string> |
9 | 12 |
10 #include "base/basictypes.h" | 13 #include "base/macros.h" |
11 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
12 #include "base/memory/shared_memory.h" | 15 #include "base/memory/shared_memory.h" |
13 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
14 #include "base/power_monitor/power_monitor.h" | 17 #include "base/power_monitor/power_monitor.h" |
15 #include "base/sequenced_task_runner.h" | 18 #include "base/sequenced_task_runner.h" |
16 #include "base/tracked_objects.h" | 19 #include "base/tracked_objects.h" |
| 20 #include "build/build_config.h" |
17 #include "content/child/mojo/mojo_application.h" | 21 #include "content/child/mojo/mojo_application.h" |
18 #include "content/common/content_export.h" | 22 #include "content/common/content_export.h" |
19 #include "content/common/message_router.h" | 23 #include "content/common/message_router.h" |
20 #include "content/common/mojo/channel_init.h" | 24 #include "content/common/mojo/channel_init.h" |
21 #include "content/public/child/child_thread.h" | 25 #include "content/public/child/child_thread.h" |
22 #include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED. | 26 #include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED. |
23 #include "ipc/ipc_platform_file.h" | 27 #include "ipc/ipc_platform_file.h" |
24 | 28 |
25 namespace base { | 29 namespace base { |
26 class MessageLoop; | 30 class MessageLoop; |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 friend class ChildProcess; | 189 friend class ChildProcess; |
186 | 190 |
187 // Called when the process refcount is 0. | 191 // Called when the process refcount is 0. |
188 void OnProcessFinalRelease(); | 192 void OnProcessFinalRelease(); |
189 | 193 |
190 virtual bool OnControlMessageReceived(const IPC::Message& msg); | 194 virtual bool OnControlMessageReceived(const IPC::Message& msg); |
191 virtual void OnProcessBackgrounded(bool backgrounded); | 195 virtual void OnProcessBackgrounded(bool backgrounded); |
192 | 196 |
193 // IPC::Listener implementation: | 197 // IPC::Listener implementation: |
194 bool OnMessageReceived(const IPC::Message& msg) override; | 198 bool OnMessageReceived(const IPC::Message& msg) override; |
195 void OnChannelConnected(int32 peer_pid) override; | 199 void OnChannelConnected(int32_t peer_pid) override; |
196 void OnChannelError() override; | 200 void OnChannelError() override; |
197 | 201 |
198 bool IsInBrowserProcess() const; | 202 bool IsInBrowserProcess() const; |
199 scoped_refptr<base::SequencedTaskRunner> GetIOTaskRunner(); | 203 scoped_refptr<base::SequencedTaskRunner> GetIOTaskRunner(); |
200 | 204 |
201 private: | 205 private: |
202 class ChildThreadMessageRouter : public MessageRouter { | 206 class ChildThreadMessageRouter : public MessageRouter { |
203 public: | 207 public: |
204 // |sender| must outlive this object. | 208 // |sender| must outlive this object. |
205 explicit ChildThreadMessageRouter(IPC::Sender* sender); | 209 explicit ChildThreadMessageRouter(IPC::Sender* sender); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 | 325 |
322 private: | 326 private: |
323 struct Options options_; | 327 struct Options options_; |
324 | 328 |
325 DISALLOW_COPY_AND_ASSIGN(Builder); | 329 DISALLOW_COPY_AND_ASSIGN(Builder); |
326 }; | 330 }; |
327 | 331 |
328 } // namespace content | 332 } // namespace content |
329 | 333 |
330 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ | 334 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ |
OLD | NEW |