| 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_RENDER_PROCESS_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 void mark_is_extension_process() { is_extension_process_ = true; } | 97 void mark_is_extension_process() { is_extension_process_ = true; } |
| 98 | 98 |
| 99 // Used for refcounting, each holder of this object must Attach and Release | 99 // Used for refcounting, each holder of this object must Attach and Release |
| 100 // just like it would for a COM object. This object should be allocated on | 100 // just like it would for a COM object. This object should be allocated on |
| 101 // the heap; when no listeners own it any more, it will delete itself. | 101 // the heap; when no listeners own it any more, it will delete itself. |
| 102 void Attach(IPC::Channel::Listener* listener, int routing_id); | 102 void Attach(IPC::Channel::Listener* listener, int routing_id); |
| 103 | 103 |
| 104 // See Attach() | 104 // See Attach() |
| 105 void Release(int listener_id); | 105 void Release(int listener_id); |
| 106 | 106 |
| 107 // Schedules the host for deletion and removes it from the all_hosts list. |
| 108 void Cleanup(); |
| 109 |
| 107 // Listeners should call this when they've sent a "Close" message and | 110 // Listeners should call this when they've sent a "Close" message and |
| 108 // they're waiting for a "Close_ACK", so that if the renderer process | 111 // they're waiting for a "Close_ACK", so that if the renderer process |
| 109 // goes away we'll know that it was intentional rather than a crash. | 112 // goes away we'll know that it was intentional rather than a crash. |
| 110 void ReportExpectingClose(int32 listener_id); | 113 void ReportExpectingClose(int32 listener_id); |
| 111 | 114 |
| 112 // Track the count of pending views that are being swapped back in. Called | 115 // Track the count of pending views that are being swapped back in. Called |
| 113 // by listeners to register and unregister pending views to prevent the | 116 // by listeners to register and unregister pending views to prevent the |
| 114 // process from exiting. | 117 // process from exiting. |
| 115 void AddPendingView(); | 118 void AddPendingView(); |
| 116 void RemovePendingView(); | 119 void RemovePendingView(); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 virtual void WidgetRestored() = 0; | 209 virtual void WidgetRestored() = 0; |
| 207 virtual void WidgetHidden() = 0; | 210 virtual void WidgetHidden() = 0; |
| 208 virtual int VisibleWidgetCount() const = 0; | 211 virtual int VisibleWidgetCount() const = 0; |
| 209 | 212 |
| 210 // Try to shutdown the associated renderer process as fast as possible. | 213 // Try to shutdown the associated renderer process as fast as possible. |
| 211 // If this renderer has any RenderViews with unload handlers, then this | 214 // If this renderer has any RenderViews with unload handlers, then this |
| 212 // function does nothing. The current implementation uses TerminateProcess. | 215 // function does nothing. The current implementation uses TerminateProcess. |
| 213 // Returns True if it was able to do fast shutdown. | 216 // Returns True if it was able to do fast shutdown. |
| 214 virtual bool FastShutdownIfPossible() = 0; | 217 virtual bool FastShutdownIfPossible() = 0; |
| 215 | 218 |
| 219 // Dump the child process' handle table before shutting down. |
| 220 virtual void DumpHandles() = 0; |
| 221 |
| 216 // Returns the process object associated with the child process. In certain | 222 // Returns the process object associated with the child process. In certain |
| 217 // tests or single-process mode, this will actually represent the current | 223 // tests or single-process mode, this will actually represent the current |
| 218 // process. | 224 // process. |
| 219 // | 225 // |
| 220 // NOTE: this is not necessarily valid immediately after calling Init, as | 226 // NOTE: this is not necessarily valid immediately after calling Init, as |
| 221 // Init starts the process asynchronously. It's guaranteed to be valid after | 227 // Init starts the process asynchronously. It's guaranteed to be valid after |
| 222 // the first IPC arrives. | 228 // the first IPC arrives. |
| 223 virtual base::ProcessHandle GetHandle() = 0; | 229 virtual base::ProcessHandle GetHandle() = 0; |
| 224 | 230 |
| 225 // Transport DIB functions --------------------------------------------------- | 231 // Transport DIB functions --------------------------------------------------- |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 // Factory object for RenderProcessHosts. Using this factory allows tests to | 345 // Factory object for RenderProcessHosts. Using this factory allows tests to |
| 340 // swap out a different one to use a TestRenderProcessHost. | 346 // swap out a different one to use a TestRenderProcessHost. |
| 341 class RenderProcessHostFactory { | 347 class RenderProcessHostFactory { |
| 342 public: | 348 public: |
| 343 virtual ~RenderProcessHostFactory() {} | 349 virtual ~RenderProcessHostFactory() {} |
| 344 virtual RenderProcessHost* CreateRenderProcessHost( | 350 virtual RenderProcessHost* CreateRenderProcessHost( |
| 345 content::BrowserContext* browser_context) const = 0; | 351 content::BrowserContext* browser_context) const = 0; |
| 346 }; | 352 }; |
| 347 | 353 |
| 348 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_H_ | 354 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_H_ |
| OLD | NEW |