| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_COMMON_CHILD_THREAD_H_ | 5 #ifndef CHROME_COMMON_CHILD_THREAD_H_ |
| 6 #define CHROME_COMMON_CHILD_THREAD_H_ | 6 #define CHROME_COMMON_CHILD_THREAD_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
| 10 #include "chrome/common/message_router.h" | 10 #include "chrome/common/message_router.h" |
| 11 #include "chrome/common/resource_dispatcher.h" | 11 #include "chrome/common/resource_dispatcher.h" |
| 12 #include "ipc/ipc_sync_channel.h" | 12 #include "ipc/ipc_sync_channel.h" |
| 13 #include "ipc/ipc_message.h" | 13 #include "ipc/ipc_message.h" |
| 14 | 14 |
| 15 class NotificationService; | 15 class NotificationService; |
| 16 | 16 |
| 17 // The main thread of a child process derives from this class. | 17 // The main thread of a child process derives from this class. |
| 18 class ChildThread : public IPC::Channel::Listener, | 18 class ChildThread : public IPC::Channel::Listener, |
| 19 public IPC::Message::Sender { | 19 public IPC::Message::Sender { |
| 20 public: | 20 public: |
| 21 // Creates the thread. | 21 // Creates the thread. |
| 22 ChildThread(); | 22 ChildThread(); |
| 23 // Used for single-process mode. | 23 // Used for single-process mode. |
| 24 ChildThread(const std::string& channel_name); | 24 explicit ChildThread(const std::string& channel_name); |
| 25 virtual ~ChildThread(); | 25 virtual ~ChildThread(); |
| 26 | 26 |
| 27 // IPC::Message::Sender implementation: | 27 // IPC::Message::Sender implementation: |
| 28 virtual bool Send(IPC::Message* msg); | 28 virtual bool Send(IPC::Message* msg); |
| 29 | 29 |
| 30 // See documentation on MessageRouter for AddRoute and RemoveRoute | 30 // See documentation on MessageRouter for AddRoute and RemoveRoute |
| 31 void AddRoute(int32 routing_id, IPC::Channel::Listener* listener); | 31 void AddRoute(int32 routing_id, IPC::Channel::Listener* listener); |
| 32 void RemoveRoute(int32 routing_id); | 32 void RemoveRoute(int32 routing_id); |
| 33 | 33 |
| 34 ResourceDispatcher* resource_dispatcher() { | 34 ResourceDispatcher* resource_dispatcher() { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 bool check_with_browser_before_shutdown_; | 78 bool check_with_browser_before_shutdown_; |
| 79 | 79 |
| 80 MessageLoop* message_loop_; | 80 MessageLoop* message_loop_; |
| 81 | 81 |
| 82 scoped_ptr<NotificationService> notification_service_; | 82 scoped_ptr<NotificationService> notification_service_; |
| 83 | 83 |
| 84 DISALLOW_COPY_AND_ASSIGN(ChildThread); | 84 DISALLOW_COPY_AND_ASSIGN(ChildThread); |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 #endif // CHROME_COMMON_CHILD_THREAD_H_ | 87 #endif // CHROME_COMMON_CHILD_THREAD_H_ |
| OLD | NEW |