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 CHROME_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ |
6 #define CHROME_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <queue> | 10 #include <queue> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/memory/scoped_callback_factory.h" | 13 #include "base/memory/scoped_callback_factory.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/platform_file.h" | 15 #include "base/platform_file.h" |
16 #include "base/process.h" | 16 #include "base/process.h" |
17 #include "base/timer.h" | 17 #include "base/timer.h" |
18 #include "chrome/browser/prefs/pref_change_registrar.h" | |
18 #include "chrome/common/extensions/extension.h" | 19 #include "chrome/common/extensions/extension.h" |
19 #include "content/browser/child_process_launcher.h" | 20 #include "content/browser/child_process_launcher.h" |
20 #include "content/browser/renderer_host/render_process_host.h" | 21 #include "content/browser/renderer_host/render_process_host.h" |
21 #include "content/common/notification_observer.h" | 22 #include "content/common/notification_observer.h" |
22 #include "content/common/notification_registrar.h" | 23 #include "content/common/notification_registrar.h" |
23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" | 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" |
24 #include "ui/gfx/surface/transport_dib.h" | 25 #include "ui/gfx/surface/transport_dib.h" |
25 | 26 |
26 class CommandLine; | 27 class CommandLine; |
27 class RendererMainThread; | 28 class RendererMainThread; |
28 class RenderWidgetHelper; | 29 class RenderWidgetHelper; |
30 class ResourceMessageFilter; | |
29 class VisitedLinkUpdater; | 31 class VisitedLinkUpdater; |
30 | 32 |
31 namespace base { | 33 namespace base { |
32 class SharedMemory; | 34 class SharedMemory; |
33 } | 35 } |
34 | 36 |
35 // Implements a concrete RenderProcessHost for the browser process for talking | 37 // Implements a concrete RenderProcessHost for the browser process for talking |
36 // to actual renderer processes (as opposed to mocks). | 38 // to actual renderer processes (as opposed to mocks). |
37 // | 39 // |
38 // Represents the browser side of the browser <--> renderer communication | 40 // Represents the browser side of the browser <--> renderer communication |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
158 | 160 |
159 // Initializes client-side phishing detection. Starts reading the phishing | 161 // Initializes client-side phishing detection. Starts reading the phishing |
160 // model from the client-side detection service class. Once the model is read | 162 // model from the client-side detection service class. Once the model is read |
161 // OpenPhishingModelDone() is invoked. | 163 // OpenPhishingModelDone() is invoked. |
162 void InitClientSidePhishingDetection(); | 164 void InitClientSidePhishingDetection(); |
163 | 165 |
164 // Called once the client-side detection service class is done with opening | 166 // Called once the client-side detection service class is done with opening |
165 // the model file. | 167 // the model file. |
166 void OpenPhishingModelDone(base::PlatformFile model_file); | 168 void OpenPhishingModelDone(base::PlatformFile model_file); |
167 | 169 |
170 // Tells the ResourceMessageFilter whether to enable referrers. | |
171 void UpdateReferrersEnabled(); | |
172 | |
168 NotificationRegistrar registrar_; | 173 NotificationRegistrar registrar_; |
169 | 174 |
170 // The count of currently visible widgets. Since the host can be a container | 175 // The count of currently visible widgets. Since the host can be a container |
171 // for multiple widgets, it uses this count to determine when it should be | 176 // for multiple widgets, it uses this count to determine when it should be |
172 // backgrounded. | 177 // backgrounded. |
173 int32 visible_widgets_; | 178 int32 visible_widgets_; |
174 | 179 |
175 // Does this process have backgrounded priority. | 180 // Does this process have backgrounded priority. |
176 bool backgrounded_; | 181 bool backgrounded_; |
177 | 182 |
(...skipping 21 matching lines...) Expand all Loading... | |
199 // Buffer visited links and send them to to renderer. | 204 // Buffer visited links and send them to to renderer. |
200 scoped_ptr<VisitedLinkUpdater> visited_link_updater_; | 205 scoped_ptr<VisitedLinkUpdater> visited_link_updater_; |
201 | 206 |
202 // True if this prcoess should have accessibility enabled; | 207 // True if this prcoess should have accessibility enabled; |
203 bool accessibility_enabled_; | 208 bool accessibility_enabled_; |
204 | 209 |
205 // True iff this process is being used as an extension process. Not valid | 210 // True iff this process is being used as an extension process. Not valid |
206 // when running in single-process mode. | 211 // when running in single-process mode. |
207 bool extension_process_; | 212 bool extension_process_; |
208 | 213 |
214 // Observes the |kEnableReferrers| preference. | |
215 PrefChangeRegistrar pref_change_registrar_; | |
216 | |
217 // Weak, owned by |channel_|. | |
jam
2011/03/29 18:17:16
what happens if OnChannelError() is called? chann
Bernhard Bauer
2011/03/29 19:26:58
I guess I should set the pointer to NULL in OnChan
| |
218 ResourceMessageFilter* resource_message_filter_; | |
219 | |
209 // The Extension for the hosted or packaged app if any, NULL otherwise. | 220 // The Extension for the hosted or packaged app if any, NULL otherwise. |
210 scoped_refptr<const Extension> installed_app_; | 221 scoped_refptr<const Extension> installed_app_; |
211 | 222 |
212 // Used to launch and terminate the process without blocking the UI thread. | 223 // Used to launch and terminate the process without blocking the UI thread. |
213 scoped_ptr<ChildProcessLauncher> child_process_; | 224 scoped_ptr<ChildProcessLauncher> child_process_; |
214 | 225 |
215 // Messages we queue while waiting for the process handle. We queue them here | 226 // Messages we queue while waiting for the process handle. We queue them here |
216 // instead of in the channel so that we ensure they're sent after init related | 227 // instead of in the channel so that we ensure they're sent after init related |
217 // messages that are sent once the process handle is available. This is | 228 // messages that are sent once the process handle is available. This is |
218 // because the queued messages may have dependencies on the init messages. | 229 // because the queued messages may have dependencies on the init messages. |
219 std::queue<IPC::Message*> queued_messages_; | 230 std::queue<IPC::Message*> queued_messages_; |
220 | 231 |
221 base::ScopedCallbackFactory<BrowserRenderProcessHost> callback_factory_; | 232 base::ScopedCallbackFactory<BrowserRenderProcessHost> callback_factory_; |
222 | 233 |
223 DISALLOW_COPY_AND_ASSIGN(BrowserRenderProcessHost); | 234 DISALLOW_COPY_AND_ASSIGN(BrowserRenderProcessHost); |
224 }; | 235 }; |
225 | 236 |
226 #endif // CHROME_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ | 237 #endif // CHROME_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ |
OLD | NEW |