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

Side by Side Diff: content/browser/frame_host/navigation_handle_impl_browsertest.cc

Issue 2830353003: Tracing for NavigationHandle lifetime and state. (Closed)
Patch Set: Rebase. Created 3 years, 8 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "base/memory/weak_ptr.h" 5 #include "base/memory/weak_ptr.h"
6 #include "content/browser/frame_host/navigation_handle_impl.h" 6 #include "content/browser/frame_host/navigation_handle_impl.h"
7 #include "content/browser/web_contents/web_contents_impl.h" 7 #include "content/browser/web_contents/web_contents_impl.h"
8 #include "content/public/browser/web_contents.h" 8 #include "content/public/browser/web_contents.h"
9 #include "content/public/browser/web_contents_observer.h" 9 #include "content/public/browser/web_contents_observer.h"
10 #include "content/public/common/browser_side_navigation_policy.h" 10 #include "content/public/common/browser_side_navigation_policy.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 base::Closure did_call_will_process) 132 base::Closure did_call_will_process)
133 : NavigationThrottle(handle), 133 : NavigationThrottle(handle),
134 will_start_result_(will_start_result), 134 will_start_result_(will_start_result),
135 will_redirect_result_(will_redirect_result), 135 will_redirect_result_(will_redirect_result),
136 will_process_result_(will_process_result), 136 will_process_result_(will_process_result),
137 did_call_will_start_(did_call_will_start), 137 did_call_will_start_(did_call_will_start),
138 did_call_will_redirect_(did_call_will_redirect), 138 did_call_will_redirect_(did_call_will_redirect),
139 did_call_will_process_(did_call_will_process) {} 139 did_call_will_process_(did_call_will_process) {}
140 ~TestNavigationThrottle() override {} 140 ~TestNavigationThrottle() override {}
141 141
142 const char* GetNameForLogging() override { return "TestNavigationThrottle"; }
143
142 void Resume() { navigation_handle()->Resume(); } 144 void Resume() { navigation_handle()->Resume(); }
143 145
144 RequestContextType request_context_type() { return request_context_type_; } 146 RequestContextType request_context_type() { return request_context_type_; }
145 147
146 private: 148 private:
147 // NavigationThrottle implementation. 149 // NavigationThrottle implementation.
148 NavigationThrottle::ThrottleCheckResult WillStartRequest() override { 150 NavigationThrottle::ThrottleCheckResult WillStartRequest() override {
149 NavigationHandleImpl* navigation_handle_impl = 151 NavigationHandleImpl* navigation_handle_impl =
150 static_cast<NavigationHandleImpl*>(navigation_handle()); 152 static_cast<NavigationHandleImpl*>(navigation_handle());
151 CHECK_NE(REQUEST_CONTEXT_TYPE_UNSPECIFIED, 153 CHECK_NE(REQUEST_CONTEXT_TYPE_UNSPECIFIED,
(...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after
1212 NavigationHandleObserver observer(shell()->web_contents(), error_url); 1214 NavigationHandleObserver observer(shell()->web_contents(), error_url);
1213 EXPECT_FALSE(NavigateToURL(shell(), error_url)); 1215 EXPECT_FALSE(NavigateToURL(shell(), error_url));
1214 EXPECT_TRUE(observer.has_committed()); 1216 EXPECT_TRUE(observer.has_committed());
1215 EXPECT_TRUE(observer.is_error()); 1217 EXPECT_TRUE(observer.is_error());
1216 EXPECT_NE(site_instance, 1218 EXPECT_NE(site_instance,
1217 shell()->web_contents()->GetMainFrame()->GetSiteInstance()); 1219 shell()->web_contents()->GetMainFrame()->GetSiteInstance());
1218 } 1220 }
1219 } 1221 }
1220 1222
1221 } // namespace content 1223 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigation_handle_impl.cc ('k') | content/browser/frame_host/navigation_handle_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698