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 "app/surface/transport_dib.h" | 13 #include "app/surface/transport_dib.h" |
14 #include "base/platform_file.h" | 14 #include "base/platform_file.h" |
15 #include "base/process.h" | 15 #include "base/process.h" |
16 #include "base/scoped_callback_factory.h" | 16 #include "base/scoped_callback_factory.h" |
17 #include "base/scoped_ptr.h" | 17 #include "base/scoped_ptr.h" |
18 #include "base/timer.h" | 18 #include "base/timer.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 | 25 |
25 class CommandLine; | 26 class CommandLine; |
26 class RendererMainThread; | 27 class RendererMainThread; |
27 class RenderWidgetHelper; | 28 class RenderWidgetHelper; |
28 class VisitedLinkUpdater; | 29 class VisitedLinkUpdater; |
(...skipping 16 matching lines...) Expand all Loading... |
45 // keeps a list of RenderView (renderer) and TabContents (browser) which | 46 // keeps a list of RenderView (renderer) and TabContents (browser) which |
46 // are correlated with IDs. This way, the Views and the corresponding ViewHosts | 47 // are correlated with IDs. This way, the Views and the corresponding ViewHosts |
47 // communicate through the two process objects. | 48 // communicate through the two process objects. |
48 class BrowserRenderProcessHost : public RenderProcessHost, | 49 class BrowserRenderProcessHost : public RenderProcessHost, |
49 public NotificationObserver, | 50 public NotificationObserver, |
50 public ChildProcessLauncher::Client { | 51 public ChildProcessLauncher::Client { |
51 public: | 52 public: |
52 explicit BrowserRenderProcessHost(Profile* profile); | 53 explicit BrowserRenderProcessHost(Profile* profile); |
53 ~BrowserRenderProcessHost(); | 54 ~BrowserRenderProcessHost(); |
54 | 55 |
| 56 // Whether this process is associated with an installed app. |
| 57 const Extension* installed_app() const { return installed_app_; } |
| 58 void set_installed_app(const Extension* installed_app) { |
| 59 installed_app_ = installed_app; |
| 60 } |
| 61 |
55 // RenderProcessHost implementation (public portion). | 62 // RenderProcessHost implementation (public portion). |
56 virtual bool Init(bool is_accessibility_enabled, bool is_extensions_process); | 63 virtual bool Init(bool is_accessibility_enabled, bool is_extensions_process); |
57 virtual int GetNextRoutingID(); | 64 virtual int GetNextRoutingID(); |
58 virtual void CancelResourceRequests(int render_widget_id); | 65 virtual void CancelResourceRequests(int render_widget_id); |
59 virtual void CrossSiteClosePageACK(const ViewMsg_ClosePage_Params& params); | 66 virtual void CrossSiteClosePageACK(const ViewMsg_ClosePage_Params& params); |
60 virtual bool WaitForUpdateMsg(int render_widget_id, | 67 virtual bool WaitForUpdateMsg(int render_widget_id, |
61 const base::TimeDelta& max_delay, | 68 const base::TimeDelta& max_delay, |
62 IPC::Message* msg); | 69 IPC::Message* msg); |
63 virtual void ReceivedBadMessage(); | 70 virtual void ReceivedBadMessage(); |
64 virtual void WidgetRestored(); | 71 virtual void WidgetRestored(); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 // Buffer visited links and send them to to renderer. | 199 // Buffer visited links and send them to to renderer. |
193 scoped_ptr<VisitedLinkUpdater> visited_link_updater_; | 200 scoped_ptr<VisitedLinkUpdater> visited_link_updater_; |
194 | 201 |
195 // True if this prcoess should have accessibility enabled; | 202 // True if this prcoess should have accessibility enabled; |
196 bool accessibility_enabled_; | 203 bool accessibility_enabled_; |
197 | 204 |
198 // True iff this process is being used as an extension process. Not valid | 205 // True iff this process is being used as an extension process. Not valid |
199 // when running in single-process mode. | 206 // when running in single-process mode. |
200 bool extension_process_; | 207 bool extension_process_; |
201 | 208 |
202 // Usedt to launch and terminate the process without blocking the UI thread. | 209 // The Extension for the hosted or packaged app if any, NULL otherwise. |
| 210 scoped_refptr<const Extension> installed_app_; |
| 211 |
| 212 // Used to launch and terminate the process without blocking the UI thread. |
203 scoped_ptr<ChildProcessLauncher> child_process_; | 213 scoped_ptr<ChildProcessLauncher> child_process_; |
204 | 214 |
205 // Messages we queue while waiting for the process handle. We queue them here | 215 // Messages we queue while waiting for the process handle. We queue them here |
206 // instead of in the channel so that we ensure they're sent after init related | 216 // instead of in the channel so that we ensure they're sent after init related |
207 // messages that are sent once the process handle is available. This is | 217 // messages that are sent once the process handle is available. This is |
208 // because the queued messages may have dependencies on the init messages. | 218 // because the queued messages may have dependencies on the init messages. |
209 std::queue<IPC::Message*> queued_messages_; | 219 std::queue<IPC::Message*> queued_messages_; |
210 | 220 |
211 base::ScopedCallbackFactory<BrowserRenderProcessHost> callback_factory_; | 221 base::ScopedCallbackFactory<BrowserRenderProcessHost> callback_factory_; |
212 | 222 |
213 DISALLOW_COPY_AND_ASSIGN(BrowserRenderProcessHost); | 223 DISALLOW_COPY_AND_ASSIGN(BrowserRenderProcessHost); |
214 }; | 224 }; |
215 | 225 |
216 #endif // CHROME_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ | 226 #endif // CHROME_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ |
OLD | NEW |