| OLD | NEW |
| 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 MessageLoop; | 17 class MessageLoop; |
| 18 class QuotaDispatcher; | 18 class QuotaDispatcher; |
| 19 class ResourceDispatcher; | 19 class ResourceDispatcher; |
| 20 class SocketStreamDispatcher; | 20 class SocketStreamDispatcher; |
| 21 | 21 |
| 22 namespace IPC { | 22 namespace IPC { |
| 23 class SyncChannel; | 23 class SyncChannel; |
| 24 class SyncMessageFilter; | 24 class SyncMessageFilter; |
| 25 } | 25 } |
| 26 | 26 |
| 27 namespace WebKit { |
| 28 class WebFrame; |
| 29 } |
| 30 |
| 27 // The main thread of a child process derives from this class. | 31 // The main thread of a child process derives from this class. |
| 28 class CONTENT_EXPORT ChildThread : public IPC::Channel::Listener, | 32 class CONTENT_EXPORT ChildThread : public IPC::Channel::Listener, |
| 29 public IPC::Message::Sender { | 33 public IPC::Message::Sender { |
| 30 public: | 34 public: |
| 31 // Creates the thread. | 35 // Creates the thread. |
| 32 ChildThread(); | 36 ChildThread(); |
| 33 // Used for single-process mode. | 37 // Used for single-process mode. |
| 34 explicit ChildThread(const std::string& channel_name); | 38 explicit ChildThread(const std::string& channel_name); |
| 35 virtual ~ChildThread(); | 39 virtual ~ChildThread(); |
| 36 | 40 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 76 |
| 73 // Safe to call on any thread, as long as it's guaranteed that the thread's | 77 // Safe to call on any thread, as long as it's guaranteed that the thread's |
| 74 // lifetime is less than the main thread. | 78 // lifetime is less than the main thread. |
| 75 IPC::SyncMessageFilter* sync_message_filter(); | 79 IPC::SyncMessageFilter* sync_message_filter(); |
| 76 | 80 |
| 77 MessageLoop* message_loop(); | 81 MessageLoop* message_loop(); |
| 78 | 82 |
| 79 // Returns the one child thread. | 83 // Returns the one child thread. |
| 80 static ChildThread* current(); | 84 static ChildThread* current(); |
| 81 | 85 |
| 86 virtual bool IsWebFrameValid(WebKit::WebFrame* frame); |
| 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 OnShutdown(); | 95 virtual void OnShutdown(); |
| 90 | 96 |
| 91 #ifdef IPC_MESSAGE_LOG_ENABLED | 97 #ifdef IPC_MESSAGE_LOG_ENABLED |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 MessageLoop* message_loop_; | 137 MessageLoop* message_loop_; |
| 132 | 138 |
| 133 scoped_ptr<FileSystemDispatcher> file_system_dispatcher_; | 139 scoped_ptr<FileSystemDispatcher> file_system_dispatcher_; |
| 134 | 140 |
| 135 scoped_ptr<QuotaDispatcher> quota_dispatcher_; | 141 scoped_ptr<QuotaDispatcher> quota_dispatcher_; |
| 136 | 142 |
| 137 DISALLOW_COPY_AND_ASSIGN(ChildThread); | 143 DISALLOW_COPY_AND_ASSIGN(ChildThread); |
| 138 }; | 144 }; |
| 139 | 145 |
| 140 #endif // CONTENT_COMMON_CHILD_THREAD_H_ | 146 #endif // CONTENT_COMMON_CHILD_THREAD_H_ |
| OLD | NEW |