| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 | 7 |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #if defined(OS_WIN) | 10 #include <string> |
| 11 #include <windows.h> | |
| 12 #endif | |
| 13 | 11 |
| 14 #include <limits> | |
| 15 #include <set> | |
| 16 #include <vector> | |
| 17 | |
| 18 #include "base/id_map.h" | |
| 19 #include "base/process.h" | 12 #include "base/process.h" |
| 20 #include "base/rand_util.h" | |
| 21 #include "base/ref_counted.h" | 13 #include "base/ref_counted.h" |
| 22 #include "base/scoped_ptr.h" | 14 #include "base/scoped_ptr.h" |
| 23 #include "base/shared_memory.h" | 15 #include "base/shared_memory.h" |
| 24 #include "chrome/browser/renderer_host/render_process_host.h" | 16 #include "chrome/browser/renderer_host/render_process_host.h" |
| 25 #include "chrome/common/notification_observer.h" | 17 #include "chrome/common/notification_observer.h" |
| 26 #include "webkit/glue/cache_manager.h" | 18 #include "webkit/glue/cache_manager.h" |
| 27 | 19 |
| 28 class CommandLine; | 20 class CommandLine; |
| 29 class GURL; | 21 class GURL; |
| 30 class PrefService; | 22 class PrefService; |
| 31 class RenderWidgetHelper; | 23 class RenderWidgetHelper; |
| 32 class WebContents; | 24 class WebContents; |
| 33 | 25 |
| 34 namespace base { | |
| 35 class Thread; | |
| 36 } | |
| 37 | |
| 38 namespace gfx { | 26 namespace gfx { |
| 39 class Size; | 27 class Size; |
| 40 } | 28 } |
| 41 | 29 |
| 42 // Implements a concrete RenderProcessHost for the browser process for talking | 30 // Implements a concrete RenderProcessHost for the browser process for talking |
| 43 // to actual renderer processes (as opposed to mocks). | 31 // to actual renderer processes (as opposed to mocks). |
| 44 // | 32 // |
| 45 // Represents the browser side of the browser <--> renderer communication | 33 // Represents the browser side of the browser <--> renderer communication |
| 46 // channel. There will be one RenderProcessHost per renderer process. | 34 // channel. There will be one RenderProcessHost per renderer process. |
| 47 // | 35 // |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 // Initialize support for visited links. Send the renderer process its initial | 103 // Initialize support for visited links. Send the renderer process its initial |
| 116 // set of visited links. | 104 // set of visited links. |
| 117 void InitVisitedLinks(); | 105 void InitVisitedLinks(); |
| 118 | 106 |
| 119 // Initialize support for user scripts. Send the renderer process its initial | 107 // Initialize support for user scripts. Send the renderer process its initial |
| 120 // set of scripts and listen for updates to scripts. | 108 // set of scripts and listen for updates to scripts. |
| 121 void InitUserScripts(); | 109 void InitUserScripts(); |
| 122 | 110 |
| 123 // Handles actually spawning the renderer process with the appropriate options | 111 // Handles actually spawning the renderer process with the appropriate options |
| 124 // for each platform. | 112 // for each platform. |
| 125 bool SpawnChild(const CommandLine& command_line, | 113 bool SpawnChild(const CommandLine& command_line, |
| 126 IPC::SyncChannel* channel, base::ProcessHandle* process_handle); | 114 IPC::SyncChannel* channel, base::ProcessHandle* process_handle); |
| 127 | 115 |
| 128 // Sends the renderer process a new set of user scripts. | 116 // Sends the renderer process a new set of user scripts. |
| 129 void SendUserScriptsUpdate(base::SharedMemory* shared_memory); | 117 void SendUserScriptsUpdate(base::SharedMemory* shared_memory); |
| 130 | 118 |
| 131 // Gets a handle to the renderer process, normalizing the case where we were | 119 // Gets a handle to the renderer process, normalizing the case where we were |
| 132 // started with --single-process. | 120 // started with --single-process. |
| 133 base::ProcessHandle GetRendererProcessHandle(); | 121 base::ProcessHandle GetRendererProcessHandle(); |
| 134 | 122 |
| 135 // Callers can reduce the RenderProcess' priority. | 123 // Callers can reduce the RenderProcess' priority. |
| 136 // Returns true if the priority is backgrounded; false otherwise. | 124 // Returns true if the priority is backgrounded; false otherwise. |
| 137 void SetBackgrounded(bool boost); | 125 void SetBackgrounded(bool boost); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 149 scoped_refptr<RenderWidgetHelper> widget_helper_; | 137 scoped_refptr<RenderWidgetHelper> widget_helper_; |
| 150 | 138 |
| 151 DISALLOW_COPY_AND_ASSIGN(BrowserRenderProcessHost); | 139 DISALLOW_COPY_AND_ASSIGN(BrowserRenderProcessHost); |
| 152 }; | 140 }; |
| 153 | 141 |
| 154 // Generates a unique channel name for a child renderer/plugin process. | 142 // Generates a unique channel name for a child renderer/plugin process. |
| 155 // The "instance" pointer value is baked into the channel id. | 143 // The "instance" pointer value is baked into the channel id. |
| 156 std::wstring GenerateRandomChannelID(void* instance); | 144 std::wstring GenerateRandomChannelID(void* instance); |
| 157 | 145 |
| 158 #endif // CHROME_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ | 146 #endif // CHROME_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ |
| 159 | |
| OLD | NEW |