Chromium Code Reviews| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 CrossSiteClosePageACK(const ViewMsg_ClosePage_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 void AddPendingView(); | |
| 62 virtual void RemovePendingView(); | |
| 63 virtual int PendingViewCount() const; | |
|
jam
2011/05/06 17:45:11
I don't see this being used anywhere?
Charlie Reis
2011/05/10 00:57:03
Done.
| |
| 61 virtual bool FastShutdownIfPossible(); | 64 virtual bool FastShutdownIfPossible(); |
| 62 virtual bool SendWithTimeout(IPC::Message* msg, int timeout_ms); | 65 virtual bool SendWithTimeout(IPC::Message* msg, int timeout_ms); |
| 63 virtual base::ProcessHandle GetHandle(); | 66 virtual base::ProcessHandle GetHandle(); |
| 64 virtual TransportDIB* GetTransportDIB(TransportDIB::Id dib_id); | 67 virtual TransportDIB* GetTransportDIB(TransportDIB::Id dib_id); |
| 65 | 68 |
| 66 // IPC::Channel::Sender via RenderProcessHost. | 69 // IPC::Channel::Sender via RenderProcessHost. |
| 67 virtual bool Send(IPC::Message* msg); | 70 virtual bool Send(IPC::Message* msg); |
| 68 | 71 |
| 69 // IPC::Channel::Listener via RenderProcessHost. | 72 // IPC::Channel::Listener via RenderProcessHost. |
| 70 virtual bool OnMessageReceived(const IPC::Message& msg); | 73 virtual bool OnMessageReceived(const IPC::Message& msg); |
| 71 virtual void OnChannelConnected(int32 peer_pid); | 74 virtual void OnChannelConnected(int32 peer_pid); |
| 72 virtual void OnChannelError(); | 75 virtual void OnChannelError(); |
| 73 | 76 |
| 74 // ChildProcessLauncher::Client implementation. | 77 // ChildProcessLauncher::Client implementation. |
| 75 virtual void OnProcessLaunched(); | 78 virtual void OnProcessLaunched(); |
| 76 | 79 |
| 77 private: | 80 private: |
| 78 friend class VisitRelayingRenderProcessHost; | 81 friend class VisitRelayingRenderProcessHost; |
| 79 | 82 |
| 80 // Creates and adds the IO thread message filters. | 83 // Creates and adds the IO thread message filters. |
| 81 void CreateMessageFilters(); | 84 void CreateMessageFilters(); |
| 82 | 85 |
| 83 // Control message handlers. | 86 // Control message handlers. |
| 87 void OnShutdownRequest(); | |
| 84 void OnUpdatedCacheStats(const WebKit::WebCache::UsageStats& stats); | 88 void OnUpdatedCacheStats(const WebKit::WebCache::UsageStats& stats); |
| 85 void SuddenTerminationChanged(bool enabled); | 89 void SuddenTerminationChanged(bool enabled); |
| 86 void OnUserMetricsRecordAction(const std::string& action); | 90 void OnUserMetricsRecordAction(const std::string& action); |
| 87 | 91 |
| 88 // Generates a command line to be used to spawn a renderer and appends the | 92 // Generates a command line to be used to spawn a renderer and appends the |
| 89 // results to |*command_line|. | 93 // results to |*command_line|. |
| 90 void AppendRendererCommandLine(CommandLine* command_line) const; | 94 void AppendRendererCommandLine(CommandLine* command_line) const; |
| 91 | 95 |
| 92 // Copies applicable command line switches from the given |browser_cmd| line | 96 // 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 | 97 // flags to the output |renderer_cmd| line flags. Not all switches will be |
| 94 // copied over. | 98 // copied over. |
| 95 void PropagateBrowserCommandLineToRenderer(const CommandLine& browser_cmd, | 99 void PropagateBrowserCommandLineToRenderer(const CommandLine& browser_cmd, |
| 96 CommandLine* renderer_cmd) const; | 100 CommandLine* renderer_cmd) const; |
| 97 | 101 |
| 98 // Callers can reduce the RenderProcess' priority. | 102 // Callers can reduce the RenderProcess' priority. |
| 99 void SetBackgrounded(bool backgrounded); | 103 void SetBackgrounded(bool backgrounded); |
| 100 | 104 |
| 101 // The count of currently visible widgets. Since the host can be a container | 105 // The count of currently visible widgets. Since the host can be a container |
| 102 // for multiple widgets, it uses this count to determine when it should be | 106 // for multiple widgets, it uses this count to determine when it should be |
| 103 // backgrounded. | 107 // backgrounded. |
| 104 int32 visible_widgets_; | 108 int32 visible_widgets_; |
| 105 | 109 |
| 110 // The count of currently swapped out but pending RenderViews. We have | |
| 111 // started to swap these back in, so the renderer process should not exit if | |
| 112 // this count is non-zero. | |
| 113 int32 pending_views_; | |
| 114 | |
| 106 // Does this process have backgrounded priority. | 115 // Does this process have backgrounded priority. |
| 107 bool backgrounded_; | 116 bool backgrounded_; |
| 108 | 117 |
| 109 // Used to allow a RenderWidgetHost to intercept various messages on the | 118 // Used to allow a RenderWidgetHost to intercept various messages on the |
| 110 // IO thread. | 119 // IO thread. |
| 111 scoped_refptr<RenderWidgetHelper> widget_helper_; | 120 scoped_refptr<RenderWidgetHelper> widget_helper_; |
| 112 | 121 |
| 113 // A map of transport DIB ids to cached TransportDIBs | 122 // A map of transport DIB ids to cached TransportDIBs |
| 114 std::map<TransportDIB::Id, TransportDIB*> cached_dibs_; | 123 std::map<TransportDIB::Id, TransportDIB*> cached_dibs_; |
| 115 enum { | 124 enum { |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 140 // Messages we queue while waiting for the process handle. We queue them here | 149 // 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 | 150 // 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 | 151 // messages that are sent once the process handle is available. This is |
| 143 // because the queued messages may have dependencies on the init messages. | 152 // because the queued messages may have dependencies on the init messages. |
| 144 std::queue<IPC::Message*> queued_messages_; | 153 std::queue<IPC::Message*> queued_messages_; |
| 145 | 154 |
| 146 DISALLOW_COPY_AND_ASSIGN(BrowserRenderProcessHost); | 155 DISALLOW_COPY_AND_ASSIGN(BrowserRenderProcessHost); |
| 147 }; | 156 }; |
| 148 | 157 |
| 149 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ | 158 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ |
| OLD | NEW |