| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 // because all the IPCs from the RenderViews (renderer) will only ever be able | 80 // because all the IPCs from the RenderViews (renderer) will only ever be able |
| 81 // to access the partition they are assigned to. | 81 // to access the partition they are assigned to. |
| 82 class CONTENT_EXPORT RenderProcessHostImpl | 82 class CONTENT_EXPORT RenderProcessHostImpl |
| 83 : public RenderProcessHost, | 83 : public RenderProcessHost, |
| 84 public ChildProcessLauncher::Client, | 84 public ChildProcessLauncher::Client, |
| 85 public GpuDataManagerObserver { | 85 public GpuDataManagerObserver { |
| 86 public: | 86 public: |
| 87 RenderProcessHostImpl(BrowserContext* browser_context, | 87 RenderProcessHostImpl(BrowserContext* browser_context, |
| 88 StoragePartitionImpl* storage_partition_impl, | 88 StoragePartitionImpl* storage_partition_impl, |
| 89 bool is_isolated_guest); | 89 bool is_isolated_guest); |
| 90 virtual ~RenderProcessHostImpl(); | 90 ~RenderProcessHostImpl() override; |
| 91 | 91 |
| 92 // RenderProcessHost implementation (public portion). | 92 // RenderProcessHost implementation (public portion). |
| 93 virtual void EnableSendQueue() override; | 93 void EnableSendQueue() override; |
| 94 virtual bool Init() override; | 94 bool Init() override; |
| 95 virtual int GetNextRoutingID() override; | 95 int GetNextRoutingID() override; |
| 96 virtual void AddRoute(int32 routing_id, IPC::Listener* listener) override; | 96 void AddRoute(int32 routing_id, IPC::Listener* listener) override; |
| 97 virtual void RemoveRoute(int32 routing_id) override; | 97 void RemoveRoute(int32 routing_id) override; |
| 98 virtual void AddObserver(RenderProcessHostObserver* observer) override; | 98 void AddObserver(RenderProcessHostObserver* observer) override; |
| 99 virtual void RemoveObserver(RenderProcessHostObserver* observer) override; | 99 void RemoveObserver(RenderProcessHostObserver* observer) override; |
| 100 virtual void ReceivedBadMessage() override; | 100 void ReceivedBadMessage() override; |
| 101 virtual void WidgetRestored() override; | 101 void WidgetRestored() override; |
| 102 virtual void WidgetHidden() override; | 102 void WidgetHidden() override; |
| 103 virtual int VisibleWidgetCount() const override; | 103 int VisibleWidgetCount() const override; |
| 104 virtual bool IsIsolatedGuest() const override; | 104 bool IsIsolatedGuest() const override; |
| 105 virtual StoragePartition* GetStoragePartition() const override; | 105 StoragePartition* GetStoragePartition() const override; |
| 106 virtual bool FastShutdownIfPossible() override; | 106 bool FastShutdownIfPossible() override; |
| 107 virtual void DumpHandles() override; | 107 void DumpHandles() override; |
| 108 virtual base::ProcessHandle GetHandle() const override; | 108 base::ProcessHandle GetHandle() const override; |
| 109 virtual BrowserContext* GetBrowserContext() const override; | 109 BrowserContext* GetBrowserContext() const override; |
| 110 virtual bool InSameStoragePartition( | 110 bool InSameStoragePartition(StoragePartition* partition) const override; |
| 111 StoragePartition* partition) const override; | 111 int GetID() const override; |
| 112 virtual int GetID() const override; | 112 bool HasConnection() const override; |
| 113 virtual bool HasConnection() const override; | 113 void SetIgnoreInputEvents(bool ignore_input_events) override; |
| 114 virtual void SetIgnoreInputEvents(bool ignore_input_events) override; | 114 bool IgnoreInputEvents() const override; |
| 115 virtual bool IgnoreInputEvents() const override; | 115 void Cleanup() override; |
| 116 virtual void Cleanup() override; | 116 void AddPendingView() override; |
| 117 virtual void AddPendingView() override; | 117 void RemovePendingView() override; |
| 118 virtual void RemovePendingView() override; | 118 void SetSuddenTerminationAllowed(bool enabled) override; |
| 119 virtual void SetSuddenTerminationAllowed(bool enabled) override; | 119 bool SuddenTerminationAllowed() const override; |
| 120 virtual bool SuddenTerminationAllowed() const override; | 120 IPC::ChannelProxy* GetChannel() override; |
| 121 virtual IPC::ChannelProxy* GetChannel() override; | 121 void AddFilter(BrowserMessageFilter* filter) override; |
| 122 virtual void AddFilter(BrowserMessageFilter* filter) override; | 122 bool FastShutdownForPageCount(size_t count) override; |
| 123 virtual bool FastShutdownForPageCount(size_t count) override; | 123 bool FastShutdownStarted() const override; |
| 124 virtual bool FastShutdownStarted() const override; | 124 base::TimeDelta GetChildProcessIdleTime() const override; |
| 125 virtual base::TimeDelta GetChildProcessIdleTime() const override; | 125 void ResumeRequestsForView(int route_id) override; |
| 126 virtual void ResumeRequestsForView(int route_id) override; | 126 void FilterURL(bool empty_allowed, GURL* url) override; |
| 127 virtual void FilterURL(bool empty_allowed, GURL* url) override; | |
| 128 #if defined(ENABLE_WEBRTC) | 127 #if defined(ENABLE_WEBRTC) |
| 129 virtual void EnableAecDump(const base::FilePath& file) override; | 128 void EnableAecDump(const base::FilePath& file) override; |
| 130 virtual void DisableAecDump() override; | 129 void DisableAecDump() override; |
| 131 virtual void SetWebRtcLogMessageCallback( | 130 void SetWebRtcLogMessageCallback( |
| 132 base::Callback<void(const std::string&)> callback) override; | 131 base::Callback<void(const std::string&)> callback) override; |
| 133 virtual WebRtcStopRtpDumpCallback StartRtpDump( | 132 WebRtcStopRtpDumpCallback StartRtpDump( |
| 134 bool incoming, | 133 bool incoming, |
| 135 bool outgoing, | 134 bool outgoing, |
| 136 const WebRtcRtpPacketCallback& packet_callback) override; | 135 const WebRtcRtpPacketCallback& packet_callback) override; |
| 137 #endif | 136 #endif |
| 138 virtual void ResumeDeferredNavigation(const GlobalRequestID& request_id) | 137 void ResumeDeferredNavigation(const GlobalRequestID& request_id) override; |
| 139 override; | 138 void NotifyTimezoneChange() override; |
| 140 virtual void NotifyTimezoneChange() override; | 139 ServiceRegistry* GetServiceRegistry() override; |
| 141 virtual ServiceRegistry* GetServiceRegistry() override; | |
| 142 | 140 |
| 143 // IPC::Sender via RenderProcessHost. | 141 // IPC::Sender via RenderProcessHost. |
| 144 virtual bool Send(IPC::Message* msg) override; | 142 bool Send(IPC::Message* msg) override; |
| 145 | 143 |
| 146 // IPC::Listener via RenderProcessHost. | 144 // IPC::Listener via RenderProcessHost. |
| 147 virtual bool OnMessageReceived(const IPC::Message& msg) override; | 145 bool OnMessageReceived(const IPC::Message& msg) override; |
| 148 virtual void OnChannelConnected(int32 peer_pid) override; | 146 void OnChannelConnected(int32 peer_pid) override; |
| 149 virtual void OnChannelError() override; | 147 void OnChannelError() override; |
| 150 virtual void OnBadMessageReceived(const IPC::Message& message) override; | 148 void OnBadMessageReceived(const IPC::Message& message) override; |
| 151 | 149 |
| 152 // ChildProcessLauncher::Client implementation. | 150 // ChildProcessLauncher::Client implementation. |
| 153 virtual void OnProcessLaunched() override; | 151 void OnProcessLaunched() override; |
| 154 | 152 |
| 155 scoped_refptr<AudioRendererHost> audio_renderer_host() const; | 153 scoped_refptr<AudioRendererHost> audio_renderer_host() const; |
| 156 | 154 |
| 157 // Call this function when it is evident that the child process is actively | 155 // Call this function when it is evident that the child process is actively |
| 158 // performing some operation, for example if we just received an IPC message. | 156 // performing some operation, for example if we just received an IPC message. |
| 159 void mark_child_process_activity_time() { | 157 void mark_child_process_activity_time() { |
| 160 child_process_activity_time_ = base::TimeTicks::Now(); | 158 child_process_activity_time_ = base::TimeTicks::Now(); |
| 161 } | 159 } |
| 162 | 160 |
| 163 // Returns the current number of active views in this process. Excludes | 161 // Returns the current number of active views in this process. Excludes |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 void PropagateBrowserCommandLineToRenderer( | 314 void PropagateBrowserCommandLineToRenderer( |
| 317 const base::CommandLine& browser_cmd, | 315 const base::CommandLine& browser_cmd, |
| 318 base::CommandLine* renderer_cmd) const; | 316 base::CommandLine* renderer_cmd) const; |
| 319 | 317 |
| 320 // Callers can reduce the RenderProcess' priority. | 318 // Callers can reduce the RenderProcess' priority. |
| 321 void SetBackgrounded(bool backgrounded); | 319 void SetBackgrounded(bool backgrounded); |
| 322 | 320 |
| 323 // Handle termination of our process. | 321 // Handle termination of our process. |
| 324 void ProcessDied(bool already_dead); | 322 void ProcessDied(bool already_dead); |
| 325 | 323 |
| 326 virtual void OnGpuSwitching() override; | 324 void OnGpuSwitching() override; |
| 327 | 325 |
| 328 #if defined(ENABLE_WEBRTC) | 326 #if defined(ENABLE_WEBRTC) |
| 329 void OnRegisterAecDumpConsumer(int id); | 327 void OnRegisterAecDumpConsumer(int id); |
| 330 void OnUnregisterAecDumpConsumer(int id); | 328 void OnUnregisterAecDumpConsumer(int id); |
| 331 void RegisterAecDumpConsumerOnUIThread(int id); | 329 void RegisterAecDumpConsumerOnUIThread(int id); |
| 332 void UnregisterAecDumpConsumerOnUIThread(int id); | 330 void UnregisterAecDumpConsumerOnUIThread(int id); |
| 333 void EnableAecDumpForId(const base::FilePath& file, int id); | 331 void EnableAecDumpForId(const base::FilePath& file, int id); |
| 334 // Sends |file_for_transit| to the render process. | 332 // Sends |file_for_transit| to the render process. |
| 335 void SendAecDumpFileToRenderer(int id, | 333 void SendAecDumpFileToRenderer(int id, |
| 336 IPC::PlatformFileForTransit file_for_transit); | 334 IPC::PlatformFileForTransit file_for_transit); |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 base::TimeTicks survive_for_worker_start_time_; | 460 base::TimeTicks survive_for_worker_start_time_; |
| 463 | 461 |
| 464 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; | 462 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; |
| 465 | 463 |
| 466 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); | 464 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); |
| 467 }; | 465 }; |
| 468 | 466 |
| 469 } // namespace content | 467 } // namespace content |
| 470 | 468 |
| 471 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ | 469 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ |
| OLD | NEW |