Chromium Code Reviews| 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_RENDER_PROCESS_HOST_H_ | 5 #ifndef CHROME_BROWSER_RENDER_PROCESS_HOST_H_ |
| 6 #define CHROME_BROWSER_RENDER_PROCESS_HOST_H_ | 6 #define CHROME_BROWSER_RENDER_PROCESS_HOST_H_ |
| 7 | 7 |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 77 void ReceivedBadMessage(uint16 msg_type) { | 77 void ReceivedBadMessage(uint16 msg_type) { |
| 78 BadMessageTerminateProcess(msg_type, process_.handle()); | 78 BadMessageTerminateProcess(msg_type, process_.handle()); |
| 79 } | 79 } |
| 80 | 80 |
| 81 // Initialize the new renderer process, returning true on success. This must | 81 // Initialize the new renderer process, returning true on success. This must |
| 82 // be called once before the object can be used, but can be called after | 82 // be called once before the object can be used, but can be called after |
| 83 // that with no effect. Therefore, if the caller isn't sure about whether | 83 // that with no effect. Therefore, if the caller isn't sure about whether |
| 84 // the process has been created, it should just call Init(). | 84 // the process has been created, it should just call Init(). |
| 85 bool Init(); | 85 bool Init(); |
| 86 | 86 |
| 87 // Send the child process its initial visited link database. | |
| 88 void InitVisitedLinks(HANDLE target_process); | |
| 89 | |
| 90 // Send the child process its initial greasemonkey scripts. | |
| 91 void InitGreasemonkeyScripts(HANDLE target_process); | |
| 92 | |
| 93 // Used for refcounting, each holder of this object must Attach and Release | 87 // Used for refcounting, each holder of this object must Attach and Release |
| 94 // just like it would for a COM object. This object should be allocated on | 88 // just like it would for a COM object. This object should be allocated on |
| 95 // the heap; when no listeners own it any more, it will delete itself. | 89 // the heap; when no listeners own it any more, it will delete itself. |
| 96 void Attach(IPC::Channel::Listener* listener, int routing_id); | 90 void Attach(IPC::Channel::Listener* listener, int routing_id); |
| 97 | 91 |
| 98 // See Attach() | 92 // See Attach() |
| 99 void Release(int listener_id); | 93 void Release(int listener_id); |
| 100 | 94 |
| 101 // Listeners should call this when they've sent a "Close" message and | 95 // Listeners should call this when they've sent a "Close" message and |
| 102 // they're waiting for a "Close_ACK", so that if the renderer process | 96 // they're waiting for a "Close_ACK", so that if the renderer process |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 204 // Clipboard messages | 198 // Clipboard messages |
| 205 void OnClipboardWriteHTML(const std::wstring& markup, const GURL& src_url); | 199 void OnClipboardWriteHTML(const std::wstring& markup, const GURL& src_url); |
| 206 void OnClipboardWriteBookmark(const std::wstring& title, const GURL& url); | 200 void OnClipboardWriteBookmark(const std::wstring& title, const GURL& url); |
| 207 void OnClipboardWriteBitmap(SharedMemoryHandle bitmap, gfx::Size size); | 201 void OnClipboardWriteBitmap(SharedMemoryHandle bitmap, gfx::Size size); |
| 208 void OnClipboardIsFormatAvailable(unsigned int format, bool* result); | 202 void OnClipboardIsFormatAvailable(unsigned int format, bool* result); |
| 209 void OnClipboardReadText(std::wstring* result); | 203 void OnClipboardReadText(std::wstring* result); |
| 210 void OnClipboardReadAsciiText(std::string* result); | 204 void OnClipboardReadAsciiText(std::string* result); |
| 211 void OnClipboardReadHTML(std::wstring* markup, GURL* src_url); | 205 void OnClipboardReadHTML(std::wstring* markup, GURL* src_url); |
| 212 void OnUpdatedCacheStats(const CacheManager::UsageStats& stats); | 206 void OnUpdatedCacheStats(const CacheManager::UsageStats& stats); |
| 213 | 207 |
| 208 // Initialize support for visited links. Send the renderer process its initial | |
| 209 // set of visited links. | |
| 210 void InitVisitedLinks(); | |
| 211 | |
| 212 // Initialize support for Greasemonkey scripts. Send the renderer process its | |
| 213 // initial set of scripts and listen for updates to scripts. | |
| 214 void InitGreasemonkeyScripts(); | |
| 215 | |
| 216 // Sends the renderer process a new set of Greasemonkey scripts. | |
| 217 void SendGreasemonkeyScriptsUpdate(SharedMemory *shared_memory); | |
|
Evan Martin
2008/10/30 17:29:51
star on left
| |
| 218 | |
| 219 // Gets a handle to the renderer process, normalizing the case where we were | |
| 220 // started with --single-process. | |
| 221 HANDLE GetRendererProcessHandle(); | |
| 222 | |
| 214 // Callers can reduce the RenderProcess' priority. | 223 // Callers can reduce the RenderProcess' priority. |
| 215 // Returns true if the priority is backgrounded; false otherwise. | 224 // Returns true if the priority is backgrounded; false otherwise. |
| 216 void SetBackgrounded(bool boost); | 225 void SetBackgrounded(bool boost); |
| 217 | 226 |
| 218 // Unregister this object from all globals that reference it. | 227 // Unregister this object from all globals that reference it. |
| 219 // This would naturally be part of the destructor, but we destruct | 228 // This would naturally be part of the destructor, but we destruct |
| 220 // asynchronously. | 229 // asynchronously. |
| 221 void Unregister(); | 230 void Unregister(); |
| 222 | 231 |
| 223 // the registered listeners. When this list is empty or all NULL, we should | 232 // the registered listeners. When this list is empty or all NULL, we should |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 277 // process can't cause denial of service by causing future named pipe creation | 286 // process can't cause denial of service by causing future named pipe creation |
| 278 // to fail. | 287 // to fail. |
| 279 return StringPrintf(L"%d.%x.%d", | 288 return StringPrintf(L"%d.%x.%d", |
| 280 GetCurrentProcessId(), instance, | 289 GetCurrentProcessId(), instance, |
| 281 base::RandInt(0, std::numeric_limits<int>::max())); | 290 base::RandInt(0, std::numeric_limits<int>::max())); |
| 282 } | 291 } |
| 283 | 292 |
| 284 | 293 |
| 285 #endif // CHROME_BROWSER_RENDER_PROCESS_HOST_H_ | 294 #endif // CHROME_BROWSER_RENDER_PROCESS_HOST_H_ |
| 286 | 295 |
| OLD | NEW |