| 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 |
| 11 #include "base/id_map.h" | 11 #include "base/id_map.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/process.h" | 13 #include "base/process.h" |
| 14 #include "base/process_util.h" | 14 #include "base/process_util.h" |
| 15 #include "base/time.h" | 15 #include "base/time.h" |
| 16 #include "chrome/browser/profiles/profile.h" |
| 16 #include "ipc/ipc_channel_proxy.h" | 17 #include "ipc/ipc_channel_proxy.h" |
| 17 #include "ui/gfx/native_widget_types.h" | 18 #include "ui/gfx/native_widget_types.h" |
| 18 #include "ui/gfx/surface/transport_dib.h" | 19 #include "ui/gfx/surface/transport_dib.h" |
| 19 | 20 |
| 20 struct ViewMsg_SwapOut_Params; | 21 struct ViewMsg_SwapOut_Params; |
| 21 | 22 |
| 22 namespace base { | 23 namespace base { |
| 23 class SharedMemory; | 24 class SharedMemory; |
| 24 } | 25 } |
| 25 | 26 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 int exit_code; | 67 int exit_code; |
| 67 bool was_extension_renderer; | 68 bool was_extension_renderer; |
| 68 }; | 69 }; |
| 69 | 70 |
| 70 explicit RenderProcessHost(content::BrowserContext* browser_context); | 71 explicit RenderProcessHost(content::BrowserContext* browser_context); |
| 71 virtual ~RenderProcessHost(); | 72 virtual ~RenderProcessHost(); |
| 72 | 73 |
| 73 // Returns the user browser context associated with this renderer process. | 74 // Returns the user browser context associated with this renderer process. |
| 74 content::BrowserContext* browser_context() const { return browser_context_; } | 75 content::BrowserContext* browser_context() const { return browser_context_; } |
| 75 | 76 |
| 77 // Returns the profile. |
| 78 // TEMPORARY; http://crbug.com/76788 |
| 79 Profile* profile() const { |
| 80 return Profile::FromBrowserContext(browser_context()); |
| 81 } |
| 82 |
| 76 // Returns the unique ID for this child process. This can be used later in | 83 // Returns the unique ID for this child process. This can be used later in |
| 77 // a call to FromID() to get back to this object (this is used to avoid | 84 // a call to FromID() to get back to this object (this is used to avoid |
| 78 // sending non-threadsafe pointers to other threads). | 85 // sending non-threadsafe pointers to other threads). |
| 79 // | 86 // |
| 80 // This ID will be unique for all child processes, including workers, plugins, | 87 // This ID will be unique for all child processes, including workers, plugins, |
| 81 // etc. It is generated by ChildProcessInfo. | 88 // etc. It is generated by ChildProcessInfo. |
| 82 int id() const { return id_; } | 89 int id() const { return id_; } |
| 83 | 90 |
| 84 // Returns true iff channel_ has been set to non-NULL. Use this for checking | 91 // Returns true iff channel_ has been set to non-NULL. Use this for checking |
| 85 // if there is connection or not. | 92 // if there is connection or not. |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 // Factory object for RenderProcessHosts. Using this factory allows tests to | 345 // Factory object for RenderProcessHosts. Using this factory allows tests to |
| 339 // swap out a different one to use a TestRenderProcessHost. | 346 // swap out a different one to use a TestRenderProcessHost. |
| 340 class RenderProcessHostFactory { | 347 class RenderProcessHostFactory { |
| 341 public: | 348 public: |
| 342 virtual ~RenderProcessHostFactory() {} | 349 virtual ~RenderProcessHostFactory() {} |
| 343 virtual RenderProcessHost* CreateRenderProcessHost( | 350 virtual RenderProcessHost* CreateRenderProcessHost( |
| 344 content::BrowserContext* browser_context) const = 0; | 351 content::BrowserContext* browser_context) const = 0; |
| 345 }; | 352 }; |
| 346 | 353 |
| 347 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_H_ | 354 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_H_ |
| OLD | NEW |