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 CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ | 6 #define CONTENT_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> |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // keeps a list of RenderView (renderer) and TabContents (browser) which | 46 // keeps a list of RenderView (renderer) and TabContents (browser) which |
47 // 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 |
48 // communicate through the two process objects. | 48 // communicate through the two process objects. |
49 class BrowserRenderProcessHost : public RenderProcessHost, | 49 class BrowserRenderProcessHost : public RenderProcessHost, |
50 public NotificationObserver, | 50 public NotificationObserver, |
51 public ChildProcessLauncher::Client { | 51 public ChildProcessLauncher::Client { |
52 public: | 52 public: |
53 explicit BrowserRenderProcessHost(Profile* profile); | 53 explicit BrowserRenderProcessHost(Profile* profile); |
54 ~BrowserRenderProcessHost(); | 54 ~BrowserRenderProcessHost(); |
55 | 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 | |
62 // RenderProcessHost implementation (public portion). | 56 // RenderProcessHost implementation (public portion). |
63 virtual bool Init(bool is_accessibility_enabled, bool is_extensions_process); | 57 virtual bool Init(bool is_accessibility_enabled, bool is_extensions_process); |
64 virtual int GetNextRoutingID(); | 58 virtual int GetNextRoutingID(); |
65 virtual void CancelResourceRequests(int render_widget_id); | 59 virtual void CancelResourceRequests(int render_widget_id); |
66 virtual void CrossSiteClosePageACK(const ViewMsg_ClosePage_Params& params); | 60 virtual void CrossSiteClosePageACK(const ViewMsg_ClosePage_Params& params); |
67 virtual bool WaitForUpdateMsg(int render_widget_id, | 61 virtual bool WaitForUpdateMsg(int render_widget_id, |
68 const base::TimeDelta& max_delay, | 62 const base::TimeDelta& max_delay, |
69 IPC::Message* msg); | 63 IPC::Message* msg); |
70 virtual void ReceivedBadMessage(); | 64 virtual void ReceivedBadMessage(); |
71 virtual void WidgetRestored(); | 65 virtual void WidgetRestored(); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 // Buffer visited links and send them to to renderer. | 193 // Buffer visited links and send them to to renderer. |
200 scoped_ptr<VisitedLinkUpdater> visited_link_updater_; | 194 scoped_ptr<VisitedLinkUpdater> visited_link_updater_; |
201 | 195 |
202 // True if this prcoess should have accessibility enabled; | 196 // True if this prcoess should have accessibility enabled; |
203 bool accessibility_enabled_; | 197 bool accessibility_enabled_; |
204 | 198 |
205 // True iff this process is being used as an extension process. Not valid | 199 // True iff this process is being used as an extension process. Not valid |
206 // when running in single-process mode. | 200 // when running in single-process mode. |
207 bool extension_process_; | 201 bool extension_process_; |
208 | 202 |
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 // Used to launch and terminate the process without blocking the UI thread. |
213 scoped_ptr<ChildProcessLauncher> child_process_; | 204 scoped_ptr<ChildProcessLauncher> child_process_; |
214 | 205 |
215 // Messages we queue while waiting for the process handle. We queue them here | 206 // 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 | 207 // 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 | 208 // messages that are sent once the process handle is available. This is |
218 // because the queued messages may have dependencies on the init messages. | 209 // because the queued messages may have dependencies on the init messages. |
219 std::queue<IPC::Message*> queued_messages_; | 210 std::queue<IPC::Message*> queued_messages_; |
220 | 211 |
221 base::ScopedCallbackFactory<BrowserRenderProcessHost> callback_factory_; | 212 base::ScopedCallbackFactory<BrowserRenderProcessHost> callback_factory_; |
222 | 213 |
223 DISALLOW_COPY_AND_ASSIGN(BrowserRenderProcessHost); | 214 DISALLOW_COPY_AND_ASSIGN(BrowserRenderProcessHost); |
224 }; | 215 }; |
225 | 216 |
226 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ | 217 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ |
OLD | NEW |