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_BROWSER_RENDER_PROCESS_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <queue> | 10 #include <queue> |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 class BrowserRenderProcessHost : public RenderProcessHost, | 43 class BrowserRenderProcessHost : public RenderProcessHost, |
44 public ChildProcessLauncher::Client { | 44 public ChildProcessLauncher::Client { |
45 public: | 45 public: |
46 explicit BrowserRenderProcessHost(Profile* profile); | 46 explicit BrowserRenderProcessHost(Profile* profile); |
47 ~BrowserRenderProcessHost(); | 47 ~BrowserRenderProcessHost(); |
48 | 48 |
49 // RenderProcessHost implementation (public portion). | 49 // RenderProcessHost implementation (public portion). |
50 virtual bool Init(bool is_accessibility_enabled, bool is_extensions_process); | 50 virtual bool Init(bool is_accessibility_enabled, bool is_extensions_process); |
51 virtual int GetNextRoutingID(); | 51 virtual int GetNextRoutingID(); |
52 virtual void CancelResourceRequests(int render_widget_id); | 52 virtual void CancelResourceRequests(int render_widget_id); |
53 virtual void CrossSiteClosePageACK(const ViewMsg_ClosePage_Params& params); | 53 virtual void CrossSiteSwapOutACK(const ViewMsg_SwapOut_Params& params); |
54 virtual bool WaitForUpdateMsg(int render_widget_id, | 54 virtual bool WaitForUpdateMsg(int render_widget_id, |
55 const base::TimeDelta& max_delay, | 55 const base::TimeDelta& max_delay, |
56 IPC::Message* msg); | 56 IPC::Message* msg); |
57 virtual void ReceivedBadMessage(); | 57 virtual void ReceivedBadMessage(); |
58 virtual void WidgetRestored(); | 58 virtual void WidgetRestored(); |
59 virtual void WidgetHidden(); | 59 virtual void WidgetHidden(); |
60 virtual int VisibleWidgetCount() const; | 60 virtual int VisibleWidgetCount() const; |
61 virtual bool FastShutdownIfPossible(); | 61 virtual bool FastShutdownIfPossible(); |
62 virtual bool SendWithTimeout(IPC::Message* msg, int timeout_ms); | 62 virtual bool SendWithTimeout(IPC::Message* msg, int timeout_ms); |
63 virtual base::ProcessHandle GetHandle(); | 63 virtual base::ProcessHandle GetHandle(); |
(...skipping 10 matching lines...) Expand all Loading... |
74 // ChildProcessLauncher::Client implementation. | 74 // ChildProcessLauncher::Client implementation. |
75 virtual void OnProcessLaunched(); | 75 virtual void OnProcessLaunched(); |
76 | 76 |
77 private: | 77 private: |
78 friend class VisitRelayingRenderProcessHost; | 78 friend class VisitRelayingRenderProcessHost; |
79 | 79 |
80 // Creates and adds the IO thread message filters. | 80 // Creates and adds the IO thread message filters. |
81 void CreateMessageFilters(); | 81 void CreateMessageFilters(); |
82 | 82 |
83 // Control message handlers. | 83 // Control message handlers. |
| 84 void OnShutdownRequest(); |
84 void OnUpdatedCacheStats(const WebKit::WebCache::UsageStats& stats); | 85 void OnUpdatedCacheStats(const WebKit::WebCache::UsageStats& stats); |
85 void SuddenTerminationChanged(bool enabled); | 86 void SuddenTerminationChanged(bool enabled); |
86 void OnUserMetricsRecordAction(const std::string& action); | 87 void OnUserMetricsRecordAction(const std::string& action); |
87 | 88 |
88 // Generates a command line to be used to spawn a renderer and appends the | 89 // Generates a command line to be used to spawn a renderer and appends the |
89 // results to |*command_line|. | 90 // results to |*command_line|. |
90 void AppendRendererCommandLine(CommandLine* command_line) const; | 91 void AppendRendererCommandLine(CommandLine* command_line) const; |
91 | 92 |
92 // Copies applicable command line switches from the given |browser_cmd| line | 93 // Copies applicable command line switches from the given |browser_cmd| line |
93 // flags to the output |renderer_cmd| line flags. Not all switches will be | 94 // flags to the output |renderer_cmd| line flags. Not all switches will be |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 // Messages we queue while waiting for the process handle. We queue them here | 141 // Messages we queue while waiting for the process handle. We queue them here |
141 // instead of in the channel so that we ensure they're sent after init related | 142 // instead of in the channel so that we ensure they're sent after init related |
142 // messages that are sent once the process handle is available. This is | 143 // messages that are sent once the process handle is available. This is |
143 // because the queued messages may have dependencies on the init messages. | 144 // because the queued messages may have dependencies on the init messages. |
144 std::queue<IPC::Message*> queued_messages_; | 145 std::queue<IPC::Message*> queued_messages_; |
145 | 146 |
146 DISALLOW_COPY_AND_ASSIGN(BrowserRenderProcessHost); | 147 DISALLOW_COPY_AND_ASSIGN(BrowserRenderProcessHost); |
147 }; | 148 }; |
148 | 149 |
149 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ | 150 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ |
OLD | NEW |