| 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 |this|. |
| 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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 | 515 |
| 516 // --------------------------------------------------------------------------- | 516 // --------------------------------------------------------------------------- |
| 517 | 517 |
| 518 bool IsMouseLocked() const; | 518 bool IsMouseLocked() const; |
| 519 | 519 |
| 520 // The View associated with the RenderViewHost. The lifetime of this object | 520 // The View associated with the RenderViewHost. The lifetime of this object |
| 521 // is associated with the lifetime of the Render process. If the Renderer | 521 // is associated with the lifetime of the Render process. If the Renderer |
| 522 // crashes, its View is destroyed and this pointer becomes NULL, even though | 522 // crashes, its View is destroyed and this pointer becomes NULL, even though |
| 523 // render_view_host_ lives on to load another URL (creating a new View while | 523 // render_view_host_ lives on to load another URL (creating a new View while |
| 524 // doing so). | 524 // doing so). |
| 525 RenderWidgetHostViewBase* view_; | 525 base::WeakPtr<RenderWidgetHostViewBase> view_; |
| 526 | |
| 527 // A weak pointer to the view. The above pointer should be weak, but changing | |
| 528 // that to be weak causes crashes on Android. | |
| 529 // TODO(ccameron): Fix this. | |
| 530 // http://crbug.com/404828 | |
| 531 base::WeakPtr<RenderWidgetHostViewBase> view_weak_; | |
| 532 | 526 |
| 533 private: | 527 private: |
| 534 friend class MockRenderWidgetHost; | 528 friend class MockRenderWidgetHost; |
| 535 | 529 |
| 536 // Tell this object to destroy itself. | 530 // Tell this object to destroy itself. If |also_delete| is specified, the |
| 537 void Destroy(); | 531 // destructor is called as well. |
| 532 void Destroy(bool also_delete); |
| 538 | 533 |
| 539 // Called by |hang_monitor_timeout_| on delayed response from the renderer. | 534 // Called by |hang_monitor_timeout_| on delayed response from the renderer. |
| 540 void RendererIsUnresponsive(); | 535 void RendererIsUnresponsive(); |
| 541 | 536 |
| 542 // Called by |new_content_rendering_timeout_| if a renderer has loaded new | 537 // Called by |new_content_rendering_timeout_| if a renderer has loaded new |
| 543 // content but failed to produce a compositor frame in a defined time. | 538 // content but failed to produce a compositor frame in a defined time. |
| 544 void ClearDisplayedGraphics(); | 539 void ClearDisplayedGraphics(); |
| 545 | 540 |
| 546 // Called if we know the renderer is responsive. When we currently think the | 541 // Called if we know the renderer is responsive. When we currently think the |
| 547 // renderer is unresponsive, this will clear that state and call | 542 // renderer is unresponsive, this will clear that state and call |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 | 634 |
| 640 void OnSnapshotDataReceivedAsync( | 635 void OnSnapshotDataReceivedAsync( |
| 641 int snapshot_id, | 636 int snapshot_id, |
| 642 scoped_refptr<base::RefCountedBytes> png_data); | 637 scoped_refptr<base::RefCountedBytes> png_data); |
| 643 | 638 |
| 644 // true if a renderer has once been valid. We use this flag to display a sad | 639 // true if a renderer has once been valid. We use this flag to display a sad |
| 645 // tab only when we lose our renderer and not if a paint occurs during | 640 // tab only when we lose our renderer and not if a paint occurs during |
| 646 // initialization. | 641 // initialization. |
| 647 bool renderer_initialized_; | 642 bool renderer_initialized_; |
| 648 | 643 |
| 644 // True if |Destroy()| has been called. |
| 645 bool destroyed_; |
| 646 |
| 649 // Our delegate, which wants to know mainly about keyboard events. | 647 // Our delegate, which wants to know mainly about keyboard events. |
| 650 // It will remain non-NULL until DetachDelegate() is called. | 648 // It will remain non-NULL until DetachDelegate() is called. |
| 651 RenderWidgetHostDelegate* delegate_; | 649 RenderWidgetHostDelegate* delegate_; |
| 652 | 650 |
| 653 // The delegate of the owner of this object. | 651 // The delegate of the owner of this object. |
| 654 RenderWidgetHostOwnerDelegate* owner_delegate_; | 652 RenderWidgetHostOwnerDelegate* owner_delegate_; |
| 655 | 653 |
| 656 // Created during construction and guaranteed never to be NULL, but its | 654 // Created during construction and guaranteed never to be NULL, but its |
| 657 // channel may be NULL if the renderer crashed, so one must always check that. | 655 // channel may be NULL if the renderer crashed, so one must always check that. |
| 658 RenderProcessHost* const process_; | 656 RenderProcessHost* const process_; |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 scoped_ptr<base::ElapsedTimer> mouse_wheel_coalesce_timer_; | 820 scoped_ptr<base::ElapsedTimer> mouse_wheel_coalesce_timer_; |
| 823 | 821 |
| 824 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; | 822 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; |
| 825 | 823 |
| 826 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 824 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
| 827 }; | 825 }; |
| 828 | 826 |
| 829 } // namespace content | 827 } // namespace content |
| 830 | 828 |
| 831 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 829 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
| OLD | NEW |