| 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_PROCESS_H_ | 5 #ifndef CONTENT_CHILD_CHILD_PROCESS_H_ |
| 6 #define CONTENT_CHILD_CHILD_PROCESS_H_ | 6 #define CONTENT_CHILD_CHILD_PROCESS_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/synchronization/waitable_event.h" | 10 #include "base/synchronization/waitable_event.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 return io_thread_.message_loop_proxy().get(); | 47 return io_thread_.message_loop_proxy().get(); |
| 48 } | 48 } |
| 49 | 49 |
| 50 // A global event object that is signalled when the main thread's message | 50 // A global event object that is signalled when the main thread's message |
| 51 // loop exits. This gives background threads a way to observe the main | 51 // loop exits. This gives background threads a way to observe the main |
| 52 // thread shutting down. This can be useful when a background thread is | 52 // thread shutting down. This can be useful when a background thread is |
| 53 // waiting for some information from the browser process. If the browser | 53 // waiting for some information from the browser process. If the browser |
| 54 // process goes away prematurely, the background thread can at least notice | 54 // process goes away prematurely, the background thread can at least notice |
| 55 // the child processes's main thread exiting to determine that it should give | 55 // the child processes's main thread exiting to determine that it should give |
| 56 // up waiting. | 56 // up waiting. |
| 57 // For example, see the renderer code used to implement | 57 // For example, see the renderer code used to implement GetCookies(). |
| 58 // webkit_glue::GetCookies. | |
| 59 base::WaitableEvent* GetShutDownEvent(); | 58 base::WaitableEvent* GetShutDownEvent(); |
| 60 | 59 |
| 61 // These are used for ref-counting the child process. The process shuts | 60 // These are used for ref-counting the child process. The process shuts |
| 62 // itself down when the ref count reaches 0. | 61 // itself down when the ref count reaches 0. |
| 63 // For example, in the renderer process, generally each tab managed by this | 62 // For example, in the renderer process, generally each tab managed by this |
| 64 // process will hold a reference to the process, and release when closed. | 63 // process will hold a reference to the process, and release when closed. |
| 65 void AddRefProcess(); | 64 void AddRefProcess(); |
| 66 void ReleaseProcess(); | 65 void ReleaseProcess(); |
| 67 | 66 |
| 68 // Getter for the one ChildProcess object for this process. Can only be called | 67 // Getter for the one ChildProcess object for this process. Can only be called |
| (...skipping 14 matching lines...) Expand all Loading... |
| 83 // it depends on it (indirectly through IPC::SyncChannel). Same for | 82 // it depends on it (indirectly through IPC::SyncChannel). Same for |
| 84 // io_thread_. | 83 // io_thread_. |
| 85 scoped_ptr<ChildThread> main_thread_; | 84 scoped_ptr<ChildThread> main_thread_; |
| 86 | 85 |
| 87 DISALLOW_COPY_AND_ASSIGN(ChildProcess); | 86 DISALLOW_COPY_AND_ASSIGN(ChildProcess); |
| 88 }; | 87 }; |
| 89 | 88 |
| 90 } // namespace content | 89 } // namespace content |
| 91 | 90 |
| 92 #endif // CONTENT_CHILD_CHILD_PROCESS_H_ | 91 #endif // CONTENT_CHILD_CHILD_PROCESS_H_ |
| OLD | NEW |