| 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_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 bool Init() override; | 106 bool Init() override; |
| 107 int GetNextRoutingID() override; | 107 int GetNextRoutingID() override; |
| 108 void AddRoute(int32 routing_id, IPC::Listener* listener) override; | 108 void AddRoute(int32 routing_id, IPC::Listener* listener) override; |
| 109 void RemoveRoute(int32 routing_id) override; | 109 void RemoveRoute(int32 routing_id) override; |
| 110 void AddObserver(RenderProcessHostObserver* observer) override; | 110 void AddObserver(RenderProcessHostObserver* observer) override; |
| 111 void RemoveObserver(RenderProcessHostObserver* observer) override; | 111 void RemoveObserver(RenderProcessHostObserver* observer) override; |
| 112 void ShutdownForBadMessage() override; | 112 void ShutdownForBadMessage() override; |
| 113 void WidgetRestored() override; | 113 void WidgetRestored() override; |
| 114 void WidgetHidden() override; | 114 void WidgetHidden() override; |
| 115 int VisibleWidgetCount() const override; | 115 int VisibleWidgetCount() const override; |
| 116 void AudioStateChanged() override; | |
| 117 bool IsForGuestsOnly() const override; | 116 bool IsForGuestsOnly() const override; |
| 118 StoragePartition* GetStoragePartition() const override; | 117 StoragePartition* GetStoragePartition() const override; |
| 119 bool Shutdown(int exit_code, bool wait) override; | 118 bool Shutdown(int exit_code, bool wait) override; |
| 120 bool FastShutdownIfPossible() override; | 119 bool FastShutdownIfPossible() override; |
| 121 base::ProcessHandle GetHandle() const override; | 120 base::ProcessHandle GetHandle() const override; |
| 122 bool IsReady() const override; | 121 bool IsReady() const override; |
| 123 BrowserContext* GetBrowserContext() const override; | 122 BrowserContext* GetBrowserContext() const override; |
| 124 bool InSameStoragePartition(StoragePartition* partition) const override; | 123 bool InSameStoragePartition(StoragePartition* partition) const override; |
| 125 int GetID() const override; | 124 int GetID() const override; |
| 126 bool HasConnection() const override; | 125 bool HasConnection() const override; |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 // results to |*command_line|. | 310 // results to |*command_line|. |
| 312 void AppendRendererCommandLine(base::CommandLine* command_line) const; | 311 void AppendRendererCommandLine(base::CommandLine* command_line) const; |
| 313 | 312 |
| 314 // Copies applicable command line switches from the given |browser_cmd| line | 313 // Copies applicable command line switches from the given |browser_cmd| line |
| 315 // flags to the output |renderer_cmd| line flags. Not all switches will be | 314 // flags to the output |renderer_cmd| line flags. Not all switches will be |
| 316 // copied over. | 315 // copied over. |
| 317 void PropagateBrowserCommandLineToRenderer( | 316 void PropagateBrowserCommandLineToRenderer( |
| 318 const base::CommandLine& browser_cmd, | 317 const base::CommandLine& browser_cmd, |
| 319 base::CommandLine* renderer_cmd) const; | 318 base::CommandLine* renderer_cmd) const; |
| 320 | 319 |
| 321 // Inspects the current object state and sets/removes background priority if | 320 // Callers can reduce the RenderProcess' priority. |
| 322 // appropriate. Should be called after any of the involved data members | 321 void SetBackgrounded(bool backgrounded); |
| 323 // change. | |
| 324 void UpdateProcessPriority(); | |
| 325 | 322 |
| 326 // Handle termination of our process. | 323 // Handle termination of our process. |
| 327 void ProcessDied(bool already_dead, RendererClosedDetails* known_details); | 324 void ProcessDied(bool already_dead, RendererClosedDetails* known_details); |
| 328 | 325 |
| 329 // GpuSwitchingObserver implementation. | 326 // GpuSwitchingObserver implementation. |
| 330 void OnGpuSwitched() override; | 327 void OnGpuSwitched() override; |
| 331 | 328 |
| 332 #if defined(ENABLE_WEBRTC) | 329 #if defined(ENABLE_WEBRTC) |
| 333 void OnRegisterAecDumpConsumer(int id); | 330 void OnRegisterAecDumpConsumer(int id); |
| 334 void OnUnregisterAecDumpConsumer(int id); | 331 void OnUnregisterAecDumpConsumer(int id); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 346 | 343 |
| 347 // The registered IPC listener objects. When this list is empty, we should | 344 // The registered IPC listener objects. When this list is empty, we should |
| 348 // delete ourselves. | 345 // delete ourselves. |
| 349 IDMap<IPC::Listener> listeners_; | 346 IDMap<IPC::Listener> listeners_; |
| 350 | 347 |
| 351 // The count of currently visible widgets. Since the host can be a container | 348 // The count of currently visible widgets. Since the host can be a container |
| 352 // for multiple widgets, it uses this count to determine when it should be | 349 // for multiple widgets, it uses this count to determine when it should be |
| 353 // backgrounded. | 350 // backgrounded. |
| 354 int32 visible_widgets_; | 351 int32 visible_widgets_; |
| 355 | 352 |
| 356 // Whether this process currently has backgrounded priority. Tracked so that | 353 // Does this process have backgrounded priority. |
| 357 // UpdateProcessPriority() can avoid redundantly setting the priority. | 354 bool backgrounded_; |
| 358 bool is_process_backgrounded_; | |
| 359 | 355 |
| 360 // Used to allow a RenderWidgetHost to intercept various messages on the | 356 // Used to allow a RenderWidgetHost to intercept various messages on the |
| 361 // IO thread. | 357 // IO thread. |
| 362 scoped_refptr<RenderWidgetHelper> widget_helper_; | 358 scoped_refptr<RenderWidgetHelper> widget_helper_; |
| 363 | 359 |
| 364 // The filter for GPU-related messages coming from the renderer. | 360 // The filter for GPU-related messages coming from the renderer. |
| 365 // Thread safety note: this field is to be accessed from the UI thread. | 361 // Thread safety note: this field is to be accessed from the UI thread. |
| 366 // We don't keep a reference to it, to avoid it being destroyed on the UI | 362 // We don't keep a reference to it, to avoid it being destroyed on the UI |
| 367 // thread, but we clear this field when we clear channel_. When channel_ goes | 363 // thread, but we clear this field when we clear channel_. When channel_ goes |
| 368 // away, it posts a task to the IO thread to destroy it there, so we know that | 364 // away, it posts a task to the IO thread to destroy it there, so we know that |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 bool sent_render_process_ready_; | 498 bool sent_render_process_ready_; |
| 503 | 499 |
| 504 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; | 500 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; |
| 505 | 501 |
| 506 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); | 502 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); |
| 507 }; | 503 }; |
| 508 | 504 |
| 509 } // namespace content | 505 } // namespace content |
| 510 | 506 |
| 511 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ | 507 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ |
| OLD | NEW |