| 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" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 69 |
| 70 // Returns the one child thread. | 70 // Returns the one child thread. |
| 71 static ChildThread* current(); | 71 static ChildThread* current(); |
| 72 | 72 |
| 73 protected: | 73 protected: |
| 74 friend class ChildProcess; | 74 friend class ChildProcess; |
| 75 | 75 |
| 76 // Called when the process refcount is 0. | 76 // Called when the process refcount is 0. |
| 77 void OnProcessFinalRelease(); | 77 void OnProcessFinalRelease(); |
| 78 | 78 |
| 79 // Called if the process refcount comes back from 0 before exiting. |
| 80 void AbortProcessShutdown(); |
| 81 |
| 79 virtual bool OnControlMessageReceived(const IPC::Message& msg); | 82 virtual bool OnControlMessageReceived(const IPC::Message& msg); |
| 80 virtual void OnAskBeforeShutdown(); | 83 virtual void OnAskBeforeShutdown(); |
| 81 virtual void OnShutdown(); | 84 virtual void OnShutdown(); |
| 82 | 85 |
| 83 #ifdef IPC_MESSAGE_LOG_ENABLED | 86 #ifdef IPC_MESSAGE_LOG_ENABLED |
| 84 virtual void OnSetIPCLoggingEnabled(bool enable); | 87 virtual void OnSetIPCLoggingEnabled(bool enable); |
| 85 #endif | 88 #endif |
| 86 | 89 |
| 87 IPC::SyncChannel* channel() { return channel_.get(); } | 90 IPC::SyncChannel* channel() { return channel_.get(); } |
| 88 | 91 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 110 scoped_ptr<ResourceDispatcher> resource_dispatcher_; | 113 scoped_ptr<ResourceDispatcher> resource_dispatcher_; |
| 111 | 114 |
| 112 // Handles SocketStream for this process. | 115 // Handles SocketStream for this process. |
| 113 scoped_ptr<SocketStreamDispatcher> socket_stream_dispatcher_; | 116 scoped_ptr<SocketStreamDispatcher> socket_stream_dispatcher_; |
| 114 | 117 |
| 115 // If true, checks with the browser process before shutdown. This avoids race | 118 // If true, checks with the browser process before shutdown. This avoids race |
| 116 // conditions if the process refcount is 0 but there's an IPC message inflight | 119 // conditions if the process refcount is 0 but there's an IPC message inflight |
| 117 // that would addref it. | 120 // that would addref it. |
| 118 bool check_with_browser_before_shutdown_; | 121 bool check_with_browser_before_shutdown_; |
| 119 | 122 |
| 123 // If we need to check with the browser before shutdown, this keeps track of |
| 124 // whether we still intend to shutdown by the time we hear the response. |
| 125 bool is_waiting_to_shutdown_; |
| 126 |
| 120 // The OnChannelError() callback was invoked - the channel is dead, don't | 127 // The OnChannelError() callback was invoked - the channel is dead, don't |
| 121 // attempt to communicate. | 128 // attempt to communicate. |
| 122 bool on_channel_error_called_; | 129 bool on_channel_error_called_; |
| 123 | 130 |
| 124 MessageLoop* message_loop_; | 131 MessageLoop* message_loop_; |
| 125 | 132 |
| 126 scoped_ptr<NotificationService> notification_service_; | 133 scoped_ptr<NotificationService> notification_service_; |
| 127 | 134 |
| 128 scoped_ptr<FileSystemDispatcher> file_system_dispatcher_; | 135 scoped_ptr<FileSystemDispatcher> file_system_dispatcher_; |
| 129 | 136 |
| 130 scoped_ptr<QuotaDispatcher> quota_dispatcher_; | 137 scoped_ptr<QuotaDispatcher> quota_dispatcher_; |
| 131 | 138 |
| 132 DISALLOW_COPY_AND_ASSIGN(ChildThread); | 139 DISALLOW_COPY_AND_ASSIGN(ChildThread); |
| 133 }; | 140 }; |
| 134 | 141 |
| 135 #endif // CONTENT_COMMON_CHILD_THREAD_H_ | 142 #endif // CONTENT_COMMON_CHILD_THREAD_H_ |
| OLD | NEW |