Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: content/common/child_process.h

Issue 6628019: Ensure that PP_Instance values are unique within a plugin process in addition... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/pepper_plugin_delegate_impl.cc ('k') | ppapi/c/private/ppb_proxy_private.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_PROCESS_H_ 5 #ifndef CONTENT_COMMON_CHILD_PROCESS_H_
6 #define CONTENT_COMMON_CHILD_PROCESS_H_ 6 #define CONTENT_COMMON_CHILD_PROCESS_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/scoped_ptr.h" 10 #include "base/scoped_ptr.h"
11 #include "base/threading/thread.h" 11 #include "base/threading/thread.h"
12 #include "base/synchronization/waitable_event.h" 12 #include "base/synchronization/waitable_event.h"
13 13
14 class ChildThread; 14 class ChildThread;
15 15
16 // Base class for child processes of the browser process (i.e. renderer and 16 // Base class for child processes of the browser process (i.e. renderer and
17 // plugin host). This is a singleton object for each child process. 17 // plugin host). This is a singleton object for each child process.
18 class ChildProcess { 18 class ChildProcess {
19 public: 19 public:
20 // Child processes should have an object that derives from this class. 20 // Child processes should have an object that derives from this class.
21 // Normally you would immediately call set_main_thread after construction.
21 ChildProcess(); 22 ChildProcess();
22 virtual ~ChildProcess(); 23 virtual ~ChildProcess();
23 24
24 // Getter for the child process' main thread. 25 // May be NULL if the main thread hasn't been set explicitly.
25 ChildThread* main_thread(); 26 ChildThread* main_thread();
27
28 // Sets the object associated with the main thread of this process.
29 // Takes ownership of the pointer.
26 void set_main_thread(ChildThread* thread); 30 void set_main_thread(ChildThread* thread);
27 31
28 MessageLoop* io_message_loop() { return io_thread_.message_loop(); } 32 MessageLoop* io_message_loop() { return io_thread_.message_loop(); }
29 33
30 // A global event object that is signalled when the main thread's message 34 // A global event object that is signalled when the main thread's message
31 // loop exits. This gives background threads a way to observe the main 35 // loop exits. This gives background threads a way to observe the main
32 // thread shutting down. This can be useful when a background thread is 36 // thread shutting down. This can be useful when a background thread is
33 // waiting for some information from the browser process. If the browser 37 // waiting for some information from the browser process. If the browser
34 // process goes away prematurely, the background thread can at least notice 38 // process goes away prematurely, the background thread can at least notice
35 // the child processes's main thread exiting to determine that it should give 39 // the child processes's main thread exiting to determine that it should give
(...skipping 27 matching lines...) Expand all
63 // io_thread_. 67 // io_thread_.
64 scoped_ptr<ChildThread> main_thread_; 68 scoped_ptr<ChildThread> main_thread_;
65 69
66 // The singleton instance for this process. 70 // The singleton instance for this process.
67 static ChildProcess* child_process_; 71 static ChildProcess* child_process_;
68 72
69 DISALLOW_COPY_AND_ASSIGN(ChildProcess); 73 DISALLOW_COPY_AND_ASSIGN(ChildProcess);
70 }; 74 };
71 75
72 #endif // CONTENT_COMMON_CHILD_PROCESS_H_ 76 #endif // CONTENT_COMMON_CHILD_PROCESS_H_
OLDNEW
« no previous file with comments | « chrome/renderer/pepper_plugin_delegate_impl.cc ('k') | ppapi/c/private/ppb_proxy_private.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698