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_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ |
6 #define CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/process/process.h" | 12 #include "base/process/process.h" |
13 #include "base/synchronization/waitable_event_watcher.h" | 13 #include "base/synchronization/waitable_event_watcher.h" |
14 #include "content/browser/child_process_launcher.h" | 14 #include "content/browser/child_process_launcher.h" |
15 #include "content/browser/power_monitor_message_broadcaster.h" | 15 #include "content/browser/power_monitor_message_broadcaster.h" |
16 #include "content/public/browser/browser_child_process_host.h" | 16 #include "content/public/browser/browser_child_process_host.h" |
17 #include "content/public/browser/child_process_data.h" | 17 #include "content/public/browser/child_process_data.h" |
18 #include "content/public/common/child_process_host_delegate.h" | 18 #include "content/public/common/child_process_host_delegate.h" |
| 19 #include "content/public/common/resource_usage_reporter.mojom.h" |
19 | 20 |
20 #if defined(OS_WIN) | 21 #if defined(OS_WIN) |
21 #include "base/win/object_watcher.h" | 22 #include "base/win/object_watcher.h" |
22 #endif | 23 #endif |
23 | 24 |
24 namespace base { | 25 namespace base { |
25 class CommandLine; | 26 class CommandLine; |
26 } | 27 } |
27 | 28 |
28 namespace content { | 29 namespace content { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 74 |
74 // Removes this host from the host list. Calls ChildProcessHost::ForceShutdown | 75 // Removes this host from the host list. Calls ChildProcessHost::ForceShutdown |
75 void ForceShutdown(); | 76 void ForceShutdown(); |
76 | 77 |
77 // Callers can reduce the BrowserChildProcess' priority. | 78 // Callers can reduce the BrowserChildProcess' priority. |
78 void SetBackgrounded(bool backgrounded); | 79 void SetBackgrounded(bool backgrounded); |
79 | 80 |
80 // Adds an IPC message filter. | 81 // Adds an IPC message filter. |
81 void AddFilter(BrowserMessageFilter* filter); | 82 void AddFilter(BrowserMessageFilter* filter); |
82 | 83 |
| 84 // Sets the Mojo service used to get resource usage data (i.e. JS memory) |
| 85 // from the process. |
| 86 void SetResourceUsageReporter(ResourceUsageReporterPtr service); |
| 87 |
83 // Called when an instance of a particular child is created in a page. | 88 // Called when an instance of a particular child is created in a page. |
84 static void NotifyProcessInstanceCreated(const ChildProcessData& data); | 89 static void NotifyProcessInstanceCreated(const ChildProcessData& data); |
85 | 90 |
86 static void HistogramBadMessageTerminated(int process_type); | 91 static void HistogramBadMessageTerminated(int process_type); |
87 | 92 |
88 BrowserChildProcessHostDelegate* delegate() const { return delegate_; } | 93 BrowserChildProcessHostDelegate* delegate() const { return delegate_; } |
89 | 94 |
90 typedef std::list<BrowserChildProcessHostImpl*> BrowserChildProcessList; | 95 typedef std::list<BrowserChildProcessHostImpl*> BrowserChildProcessList; |
91 private: | 96 private: |
92 friend class BrowserChildProcessHostIterator; | 97 friend class BrowserChildProcessHostIterator; |
(...skipping 25 matching lines...) Expand all Loading... |
118 // Watches to see if the child process exits before the IPC channel has | 123 // Watches to see if the child process exits before the IPC channel has |
119 // been connected. Thereafter, its exit is determined by an error on the | 124 // been connected. Thereafter, its exit is determined by an error on the |
120 // IPC channel. | 125 // IPC channel. |
121 base::win::ObjectWatcher early_exit_watcher_; | 126 base::win::ObjectWatcher early_exit_watcher_; |
122 #endif | 127 #endif |
123 }; | 128 }; |
124 | 129 |
125 } // namespace content | 130 } // namespace content |
126 | 131 |
127 #endif // CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ | 132 #endif // CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ |
OLD | NEW |