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

Side by Side Diff: content/test/test_render_view_host.cc

Issue 536063002: Clean up RenderWidgetHostView destruction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Safer scheme Created 6 years, 3 months 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
« no previous file with comments | « content/test/test_render_view_host.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "content/test/test_render_view_host.h" 5 #include "content/test/test_render_view_host.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" 8 #include "content/browser/dom_storage/dom_storage_context_wrapper.h"
9 #include "content/browser/dom_storage/session_storage_namespace_impl.h" 9 #include "content/browser/dom_storage/session_storage_namespace_impl.h"
10 #include "content/browser/site_instance_impl.h" 10 #include "content/browser/site_instance_impl.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 } 44 }
45 45
46 TestRenderWidgetHostView::TestRenderWidgetHostView(RenderWidgetHost* rwh) 46 TestRenderWidgetHostView::TestRenderWidgetHostView(RenderWidgetHost* rwh)
47 : rwh_(RenderWidgetHostImpl::From(rwh)), 47 : rwh_(RenderWidgetHostImpl::From(rwh)),
48 is_showing_(false), 48 is_showing_(false),
49 did_swap_compositor_frame_(false) { 49 did_swap_compositor_frame_(false) {
50 rwh_->SetView(this); 50 rwh_->SetView(this);
51 } 51 }
52 52
53 TestRenderWidgetHostView::~TestRenderWidgetHostView() { 53 TestRenderWidgetHostView::~TestRenderWidgetHostView() {
54 rwh_->ViewDestroyed(this);
54 } 55 }
55 56
56 RenderWidgetHost* TestRenderWidgetHostView::GetRenderWidgetHost() const { 57 RenderWidgetHost* TestRenderWidgetHostView::GetRenderWidgetHost() const {
57 return NULL; 58 return NULL;
58 } 59 }
59 60
60 gfx::Vector2dF TestRenderWidgetHostView::GetLastScrollOffset() const { 61 gfx::Vector2dF TestRenderWidgetHostView::GetLastScrollOffset() const {
61 return gfx::Vector2dF(); 62 return gfx::Vector2dF();
62 } 63 }
63 64
(...skipping 26 matching lines...) Expand all
90 } 91 }
91 92
92 void TestRenderWidgetHostView::Hide() { 93 void TestRenderWidgetHostView::Hide() {
93 is_showing_ = false; 94 is_showing_ = false;
94 } 95 }
95 96
96 bool TestRenderWidgetHostView::IsShowing() { 97 bool TestRenderWidgetHostView::IsShowing() {
97 return is_showing_; 98 return is_showing_;
98 } 99 }
99 100
100 void TestRenderWidgetHostView::RenderProcessGone(base::TerminationStatus status,
101 int error_code) {
102 delete this;
103 }
104
105 void TestRenderWidgetHostView::Destroy() { delete this; } 101 void TestRenderWidgetHostView::Destroy() { delete this; }
106 102
107 gfx::Rect TestRenderWidgetHostView::GetViewBounds() const { 103 gfx::Rect TestRenderWidgetHostView::GetViewBounds() const {
108 return gfx::Rect(); 104 return gfx::Rect();
109 } 105 }
110 106
111 void TestRenderWidgetHostView::CopyFromCompositingSurface( 107 void TestRenderWidgetHostView::CopyFromCompositingSurface(
112 const gfx::Rect& src_subrect, 108 const gfx::Rect& src_subrect,
113 const gfx::Size& dst_size, 109 const gfx::Size& dst_size,
114 const base::Callback<void(bool, const SkBitmap&)>& callback, 110 const base::Callback<void(bool, const SkBitmap&)>& callback,
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 390
395 TestRenderFrameHost* RenderViewHostImplTestHarness::main_test_rfh() { 391 TestRenderFrameHost* RenderViewHostImplTestHarness::main_test_rfh() {
396 return contents()->GetMainFrame(); 392 return contents()->GetMainFrame();
397 } 393 }
398 394
399 TestWebContents* RenderViewHostImplTestHarness::contents() { 395 TestWebContents* RenderViewHostImplTestHarness::contents() {
400 return static_cast<TestWebContents*>(web_contents()); 396 return static_cast<TestWebContents*>(web_contents());
401 } 397 }
402 398
403 } // namespace content 399 } // namespace content
OLDNEW
« no previous file with comments | « content/test/test_render_view_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698