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

Side by Side Diff: components/test_runner/web_test_proxy.h

Issue 1962393002: Destroy WebWidgetTestClient when its WebWidget is destroyed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 COMPONENTS_TEST_RUNNER_WEB_TEST_PROXY_H_ 5 #ifndef COMPONENTS_TEST_RUNNER_WEB_TEST_PROXY_H_
6 #define COMPONENTS_TEST_RUNNER_WEB_TEST_PROXY_H_ 6 #define COMPONENTS_TEST_RUNNER_WEB_TEST_PROXY_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 // WebTestProxyBase is the "brain" of WebTestProxy in the sense that 53 // WebTestProxyBase is the "brain" of WebTestProxy in the sense that
54 // WebTestProxy does the bridge between RenderViewImpl and WebTestProxyBase and 54 // WebTestProxy does the bridge between RenderViewImpl and WebTestProxyBase and
55 // when it requires a behavior to be different from the usual, it will call 55 // when it requires a behavior to be different from the usual, it will call
56 // WebTestProxyBase that implements the expected behavior. 56 // WebTestProxyBase that implements the expected behavior.
57 // See WebTestProxy class comments for more information. 57 // See WebTestProxy class comments for more information.
58 class TEST_RUNNER_EXPORT WebTestProxyBase { 58 class TEST_RUNNER_EXPORT WebTestProxyBase {
59 public: 59 public:
60 blink::WebWidget* web_widget() { return web_widget_; } 60 blink::WebWidget* web_widget() { return web_widget_; }
61 void set_web_widget(blink::WebWidget* widget) { 61 void set_web_widget(blink::WebWidget* widget) {
62 DCHECK(widget);
63 DCHECK(!web_widget_);
64 web_widget_ = widget; 62 web_widget_ = widget;
65 } 63 }
66 64
67 blink::WebView* web_view() { return web_view_; } 65 blink::WebView* web_view() { return web_view_; }
68 void set_web_view(blink::WebView* view) { 66 void set_web_view(blink::WebView* view) {
69 DCHECK(view); 67 DCHECK(view);
70 DCHECK(!web_view_); 68 DCHECK(!web_view_);
71 web_view_ = view; 69 web_view_ = view;
72 } 70 }
73 71
74 void set_view_test_client( 72 void set_view_test_client(
75 std::unique_ptr<WebViewTestClient> view_test_client) { 73 std::unique_ptr<WebViewTestClient> view_test_client) {
76 DCHECK(view_test_client); 74 DCHECK(view_test_client);
77 DCHECK(!view_test_client_); 75 DCHECK(!view_test_client_);
78 view_test_client_ = std::move(view_test_client); 76 view_test_client_ = std::move(view_test_client);
79 } 77 }
80 78
81 void set_widget_test_client( 79 void set_widget_test_client(
82 std::unique_ptr<WebWidgetTestClient> widget_test_client) { 80 std::unique_ptr<WebWidgetTestClient> widget_test_client) {
83 DCHECK(widget_test_client);
84 DCHECK(!widget_test_client_);
Łukasz Anforowicz 2016/05/10 19:44:40 This doesn't seem right - WebTestProxy dereference
85 widget_test_client_ = std::move(widget_test_client); 81 widget_test_client_ = std::move(widget_test_client);
86 } 82 }
87 83
88 WebTestDelegate* delegate() { return delegate_; } 84 WebTestDelegate* delegate() { return delegate_; }
89 void set_delegate(WebTestDelegate* delegate) { 85 void set_delegate(WebTestDelegate* delegate) {
90 DCHECK(delegate); 86 DCHECK(delegate);
91 DCHECK(!delegate_); 87 DCHECK(!delegate_);
92 delegate_ = delegate; 88 delegate_ = delegate;
93 } 89 }
94 90
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 247
252 private: 248 private:
253 virtual ~WebTestProxy() {} 249 virtual ~WebTestProxy() {}
254 250
255 DISALLOW_COPY_AND_ASSIGN(WebTestProxy); 251 DISALLOW_COPY_AND_ASSIGN(WebTestProxy);
256 }; 252 };
257 253
258 } // namespace test_runner 254 } // namespace test_runner
259 255
260 #endif // COMPONENTS_TEST_RUNNER_WEB_TEST_PROXY_H_ 256 #endif // COMPONENTS_TEST_RUNNER_WEB_TEST_PROXY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698