Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: content/browser/renderer_host/render_widget_host_impl.h

Issue 1453803002: Separate RenderViewHost from RenderWidgetHost, part 10: shutdown. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 188
189 // Signal whether this RenderWidgetHost is owned by a RenderFrameHost, in 189 // Signal whether this RenderWidgetHost is owned by a RenderFrameHost, in
190 // which case it does not do self-deletion. 190 // which case it does not do self-deletion.
191 void set_owned_by_render_frame_host(bool owned_by_rfh) { 191 void set_owned_by_render_frame_host(bool owned_by_rfh) {
192 owned_by_render_frame_host_ = owned_by_rfh; 192 owned_by_render_frame_host_ = owned_by_rfh;
193 } 193 }
194 bool owned_by_render_frame_host() const { 194 bool owned_by_render_frame_host() const {
195 return owned_by_render_frame_host_; 195 return owned_by_render_frame_host_;
196 } 196 }
197 197
198 // Tells the renderer to die and then calls Destroy(). 198 // Tells the renderer to die and optionally call Destroy().
199 virtual void Shutdown(); 199 void ShutdownWidget(bool destroy);
200 200
201 // IPC::Listener 201 // IPC::Listener
202 bool OnMessageReceived(const IPC::Message& msg) override; 202 bool OnMessageReceived(const IPC::Message& msg) override;
203 203
204 // Sends a message to the corresponding object in the renderer. 204 // Sends a message to the corresponding object in the renderer.
205 bool Send(IPC::Message* msg) override; 205 bool Send(IPC::Message* msg) override;
206 206
207 // Indicates if the page has finished loading. 207 // Indicates if the page has finished loading.
208 void SetIsLoading(bool is_loading); 208 void SetIsLoading(bool is_loading);
209 209
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_;
ncarter (slow) 2015/11/17 22:22:55 My understanding was that the RWH owns the RWHV, s
Avi (use Gerrit) 2015/11/18 00:29:59 The RWHV owns the RWHI. Note that they (being Rend
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.
537 void Destroy(); 531 void Destroy();
538 532
539 // Called by |hang_monitor_timeout_| on delayed response from the renderer. 533 // Called by |hang_monitor_timeout_| on delayed response from the renderer.
540 void RendererIsUnresponsive(); 534 void RendererIsUnresponsive();
541 535
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
821 scoped_ptr<base::ElapsedTimer> mouse_wheel_coalesce_timer_; 815 scoped_ptr<base::ElapsedTimer> mouse_wheel_coalesce_timer_;
822 816
823 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; 817 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_;
824 818
825 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); 819 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl);
826 }; 820 };
827 821
828 } // namespace content 822 } // namespace content
829 823
830 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ 824 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698