Chromium Code Reviews| 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_RENDER_WIDGET_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 189 | 189 |
| 190 // Signal whether this RenderWidgetHost is owned by a RenderFrameHost, in | 190 // Signal whether this RenderWidgetHost is owned by a RenderFrameHost, in |
| 191 // which case it does not do self-deletion. | 191 // which case it does not do self-deletion. |
| 192 void set_owned_by_render_frame_host(bool owned_by_rfh) { | 192 void set_owned_by_render_frame_host(bool owned_by_rfh) { |
| 193 owned_by_render_frame_host_ = owned_by_rfh; | 193 owned_by_render_frame_host_ = owned_by_rfh; |
| 194 } | 194 } |
| 195 bool owned_by_render_frame_host() const { | 195 bool owned_by_render_frame_host() const { |
| 196 return owned_by_render_frame_host_; | 196 return owned_by_render_frame_host_; |
| 197 } | 197 } |
| 198 | 198 |
| 199 // Tells the renderer to die and then calls Destroy(). | 199 // Tells the renderer to die and optionally delete it. |
|
ncarter (slow)
2015/12/11 22:13:29
s/it/|this|/
or something. Otherwise it reads lik
Avi (use Gerrit)
2015/12/14 02:03:49
Done.
| |
| 200 virtual void Shutdown(); | 200 void ShutdownAndDestroyWidget(bool also_delete); |
| 201 | 201 |
| 202 // IPC::Listener | 202 // IPC::Listener |
| 203 bool OnMessageReceived(const IPC::Message& msg) override; | 203 bool OnMessageReceived(const IPC::Message& msg) override; |
| 204 | 204 |
| 205 // Sends a message to the corresponding object in the renderer. | 205 // Sends a message to the corresponding object in the renderer. |
| 206 bool Send(IPC::Message* msg) override; | 206 bool Send(IPC::Message* msg) override; |
| 207 | 207 |
| 208 // Indicates if the page has finished loading. | 208 // Indicates if the page has finished loading. |
| 209 void SetIsLoading(bool is_loading); | 209 void SetIsLoading(bool is_loading); |
| 210 | 210 |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 516 | 516 |
| 517 // --------------------------------------------------------------------------- | 517 // --------------------------------------------------------------------------- |
| 518 | 518 |
| 519 bool IsMouseLocked() const; | 519 bool IsMouseLocked() const; |
| 520 | 520 |
| 521 // The View associated with the RenderViewHost. The lifetime of this object | 521 // The View associated with the RenderViewHost. The lifetime of this object |
| 522 // is associated with the lifetime of the Render process. If the Renderer | 522 // is associated with the lifetime of the Render process. If the Renderer |
| 523 // crashes, its View is destroyed and this pointer becomes NULL, even though | 523 // crashes, its View is destroyed and this pointer becomes NULL, even though |
| 524 // render_view_host_ lives on to load another URL (creating a new View while | 524 // render_view_host_ lives on to load another URL (creating a new View while |
| 525 // doing so). | 525 // doing so). |
| 526 RenderWidgetHostViewBase* view_; | 526 base::WeakPtr<RenderWidgetHostViewBase> view_; |
| 527 | |
| 528 // A weak pointer to the view. The above pointer should be weak, but changing | |
| 529 // that to be weak causes crashes on Android. | |
| 530 // TODO(ccameron): Fix this. | |
| 531 // http://crbug.com/404828 | |
| 532 base::WeakPtr<RenderWidgetHostViewBase> view_weak_; | |
| 533 | 527 |
| 534 private: | 528 private: |
| 535 friend class MockRenderWidgetHost; | 529 friend class MockRenderWidgetHost; |
| 536 | 530 |
| 537 // Tell this object to destroy itself. | 531 // Tell this object to destroy itself. If |also_delete| is specified, the |
| 538 void Destroy(); | 532 // destructor is called as well. |
| 533 void Destroy(bool also_delete); | |
| 539 | 534 |
| 540 // Called by |hang_monitor_timeout_| on delayed response from the renderer. | 535 // Called by |hang_monitor_timeout_| on delayed response from the renderer. |
| 541 void RendererIsUnresponsive(); | 536 void RendererIsUnresponsive(); |
| 542 | 537 |
| 543 // Called by |new_content_rendering_timeout_| if a renderer has loaded new | 538 // Called by |new_content_rendering_timeout_| if a renderer has loaded new |
| 544 // content but failed to produce a compositor frame in a defined time. | 539 // content but failed to produce a compositor frame in a defined time. |
| 545 void ClearDisplayedGraphics(); | 540 void ClearDisplayedGraphics(); |
| 546 | 541 |
| 547 // Called if we know the renderer is responsive. When we currently think the | 542 // Called if we know the renderer is responsive. When we currently think the |
| 548 // renderer is unresponsive, this will clear that state and call | 543 // renderer is unresponsive, this will clear that state and call |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 640 | 635 |
| 641 void OnSnapshotDataReceivedAsync( | 636 void OnSnapshotDataReceivedAsync( |
| 642 int snapshot_id, | 637 int snapshot_id, |
| 643 scoped_refptr<base::RefCountedBytes> png_data); | 638 scoped_refptr<base::RefCountedBytes> png_data); |
| 644 | 639 |
| 645 // true if a renderer has once been valid. We use this flag to display a sad | 640 // true if a renderer has once been valid. We use this flag to display a sad |
| 646 // tab only when we lose our renderer and not if a paint occurs during | 641 // tab only when we lose our renderer and not if a paint occurs during |
| 647 // initialization. | 642 // initialization. |
| 648 bool renderer_initialized_; | 643 bool renderer_initialized_; |
| 649 | 644 |
| 645 // True if |Destroy()| has been called. | |
| 646 bool destroyed_; | |
| 647 | |
| 650 // Our delegate, which wants to know mainly about keyboard events. | 648 // Our delegate, which wants to know mainly about keyboard events. |
| 651 // It will remain non-NULL until DetachDelegate() is called. | 649 // It will remain non-NULL until DetachDelegate() is called. |
| 652 RenderWidgetHostDelegate* delegate_; | 650 RenderWidgetHostDelegate* delegate_; |
| 653 | 651 |
| 654 // The delegate of the owner of this object. | 652 // The delegate of the owner of this object. |
| 655 RenderWidgetHostOwnerDelegate* owner_delegate_; | 653 RenderWidgetHostOwnerDelegate* owner_delegate_; |
| 656 | 654 |
| 657 // Created during construction and guaranteed never to be NULL, but its | 655 // Created during construction and guaranteed never to be NULL, but its |
| 658 // channel may be NULL if the renderer crashed, so one must always check that. | 656 // channel may be NULL if the renderer crashed, so one must always check that. |
| 659 RenderProcessHost* const process_; | 657 RenderProcessHost* const process_; |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 823 scoped_ptr<base::ElapsedTimer> mouse_wheel_coalesce_timer_; | 821 scoped_ptr<base::ElapsedTimer> mouse_wheel_coalesce_timer_; |
| 824 | 822 |
| 825 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; | 823 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; |
| 826 | 824 |
| 827 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 825 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
| 828 }; | 826 }; |
| 829 | 827 |
| 830 } // namespace content | 828 } // namespace content |
| 831 | 829 |
| 832 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 830 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
| OLD | NEW |