| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 | 10 |
| 11 #include <map> | 11 #include <map> |
| 12 #include <queue> | 12 #include <queue> |
| 13 #include <string> | 13 #include <string> |
| 14 | 14 |
| 15 #include "app/surface/transport_dib.h" | 15 #include "app/surface/transport_dib.h" |
| 16 #include "base/platform_file.h" | 16 #include "base/platform_file.h" |
| 17 #include "base/process.h" | 17 #include "base/process.h" |
| 18 #include "base/scoped_callback_factory.h" | 18 #include "base/scoped_callback_factory.h" |
| 19 #include "base/scoped_ptr.h" | 19 #include "base/scoped_ptr.h" |
| 20 #include "base/timer.h" | 20 #include "base/timer.h" |
| 21 #include "chrome/browser/child_process_launcher.h" | 21 #include "chrome/browser/child_process_launcher.h" |
| 22 #include "chrome/browser/renderer_host/render_process_host.h" | 22 #include "chrome/browser/renderer_host/render_process_host.h" |
| 23 #include "chrome/common/notification_observer.h" | 23 #include "chrome/common/notification_observer.h" |
| 24 #include "chrome/common/notification_registrar.h" | 24 #include "chrome/common/notification_registrar.h" |
| 25 #include "third_party/WebKit/WebKit/chromium/public/WebCache.h" | 25 #include "third_party/WebKit/WebKit/chromium/public/WebCache.h" |
| 26 | 26 |
| 27 class CommandLine; | 27 class CommandLine; |
| 28 class Extension; |
| 28 class GURL; | 29 class GURL; |
| 29 class RendererMainThread; | 30 class RendererMainThread; |
| 30 class RenderWidgetHelper; | 31 class RenderWidgetHelper; |
| 31 class TabContents; | 32 class TabContents; |
| 32 class VisitedLinkUpdater; | 33 class VisitedLinkUpdater; |
| 33 class URLRequestContextGetter; | 34 class URLRequestContextGetter; |
| 34 | 35 |
| 35 namespace base { | 36 namespace base { |
| 36 class SharedMemory; | 37 class SharedMemory; |
| 37 } | 38 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 55 // are correlated with IDs. This way, the Views and the corresponding ViewHosts | 56 // are correlated with IDs. This way, the Views and the corresponding ViewHosts |
| 56 // communicate through the two process objects. | 57 // communicate through the two process objects. |
| 57 class BrowserRenderProcessHost : public RenderProcessHost, | 58 class BrowserRenderProcessHost : public RenderProcessHost, |
| 58 public NotificationObserver, | 59 public NotificationObserver, |
| 59 public ChildProcessLauncher::Client { | 60 public ChildProcessLauncher::Client { |
| 60 public: | 61 public: |
| 61 explicit BrowserRenderProcessHost(Profile* profile); | 62 explicit BrowserRenderProcessHost(Profile* profile); |
| 62 ~BrowserRenderProcessHost(); | 63 ~BrowserRenderProcessHost(); |
| 63 | 64 |
| 64 // RenderProcessHost implementation (public portion). | 65 // RenderProcessHost implementation (public portion). |
| 65 virtual bool Init(bool is_accessibility_enabled, bool is_extensions_process); | 66 virtual bool Init(bool is_accessibility_enabled, bool is_extensions_process, |
| 67 const Extension* installed_app); |
| 66 virtual int GetNextRoutingID(); | 68 virtual int GetNextRoutingID(); |
| 67 virtual void CancelResourceRequests(int render_widget_id); | 69 virtual void CancelResourceRequests(int render_widget_id); |
| 68 virtual void CrossSiteClosePageACK(const ViewMsg_ClosePage_Params& params); | 70 virtual void CrossSiteClosePageACK(const ViewMsg_ClosePage_Params& params); |
| 69 virtual bool WaitForUpdateMsg(int render_widget_id, | 71 virtual bool WaitForUpdateMsg(int render_widget_id, |
| 70 const base::TimeDelta& max_delay, | 72 const base::TimeDelta& max_delay, |
| 71 IPC::Message* msg); | 73 IPC::Message* msg); |
| 72 virtual void ReceivedBadMessage(); | 74 virtual void ReceivedBadMessage(); |
| 73 virtual void WidgetRestored(); | 75 virtual void WidgetRestored(); |
| 74 virtual void WidgetHidden(); | 76 virtual void WidgetHidden(); |
| 75 virtual void ViewCreated(); | 77 virtual void ViewCreated(); |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 // Buffer visited links and send them to to renderer. | 207 // Buffer visited links and send them to to renderer. |
| 206 scoped_ptr<VisitedLinkUpdater> visited_link_updater_; | 208 scoped_ptr<VisitedLinkUpdater> visited_link_updater_; |
| 207 | 209 |
| 208 // True if this prcoess should have accessibility enabled; | 210 // True if this prcoess should have accessibility enabled; |
| 209 bool accessibility_enabled_; | 211 bool accessibility_enabled_; |
| 210 | 212 |
| 211 // True iff this process is being used as an extension process. Not valid | 213 // True iff this process is being used as an extension process. Not valid |
| 212 // when running in single-process mode. | 214 // when running in single-process mode. |
| 213 bool extension_process_; | 215 bool extension_process_; |
| 214 | 216 |
| 215 // Usedt to launch and terminate the process without blocking the UI thread. | 217 // The Extension for the hosted or packaged app if any, NULL otherwise. |
| 218 scoped_refptr<const Extension> installed_app_; |
| 219 |
| 220 // Used to launch and terminate the process without blocking the UI thread. |
| 216 scoped_ptr<ChildProcessLauncher> child_process_; | 221 scoped_ptr<ChildProcessLauncher> child_process_; |
| 217 | 222 |
| 218 // Messages we queue while waiting for the process handle. We queue them here | 223 // Messages we queue while waiting for the process handle. We queue them here |
| 219 // instead of in the channel so that we ensure they're sent after init related | 224 // instead of in the channel so that we ensure they're sent after init related |
| 220 // messages that are sent once the process handle is available. This is | 225 // messages that are sent once the process handle is available. This is |
| 221 // because the queued messages may have dependencies on the init messages. | 226 // because the queued messages may have dependencies on the init messages. |
| 222 std::queue<IPC::Message*> queued_messages_; | 227 std::queue<IPC::Message*> queued_messages_; |
| 223 | 228 |
| 224 base::ScopedCallbackFactory<BrowserRenderProcessHost> callback_factory_; | 229 base::ScopedCallbackFactory<BrowserRenderProcessHost> callback_factory_; |
| 225 | 230 |
| 226 DISALLOW_COPY_AND_ASSIGN(BrowserRenderProcessHost); | 231 DISALLOW_COPY_AND_ASSIGN(BrowserRenderProcessHost); |
| 227 }; | 232 }; |
| 228 | 233 |
| 229 #endif // CHROME_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ | 234 #endif // CHROME_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ |
| OLD | NEW |