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

Side by Side Diff: content/public/test/navigation_simulator.cc

Issue 2830353003: Tracing for NavigationHandle lifetime and state. (Closed)
Patch Set: Rebase. Created 3 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/public/test/navigation_simulator.h" 5 #include "content/public/test/navigation_simulator.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "content/browser/frame_host/navigation_handle_impl.h" 10 #include "content/browser/frame_host/navigation_handle_impl.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 NavigationThrottle::ThrottleCheckResult WillRedirectRequest() override { 42 NavigationThrottle::ThrottleCheckResult WillRedirectRequest() override {
43 on_will_redirect_request_.Run(); 43 on_will_redirect_request_.Run();
44 return NavigationThrottle::PROCEED; 44 return NavigationThrottle::PROCEED;
45 } 45 }
46 46
47 NavigationThrottle::ThrottleCheckResult WillProcessResponse() override { 47 NavigationThrottle::ThrottleCheckResult WillProcessResponse() override {
48 on_will_process_response_.Run(); 48 on_will_process_response_.Run();
49 return NavigationThrottle::PROCEED; 49 return NavigationThrottle::PROCEED;
50 } 50 }
51 51
52 const char* GetNameForLogging() override {
53 return "NavigationThrottleCallbackRunner";
54 }
55
52 private: 56 private:
53 base::Closure on_will_start_request_; 57 base::Closure on_will_start_request_;
54 base::Closure on_will_redirect_request_; 58 base::Closure on_will_redirect_request_;
55 base::Closure on_will_process_response_; 59 base::Closure on_will_process_response_;
56 }; 60 };
57 61
58 } // namespace 62 } // namespace
59 63
60 // static 64 // static
61 void NavigationSimulator::NavigateAndCommitFromDocument( 65 void NavigationSimulator::NavigateAndCommitFromDocument(
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 base::Bind(&NavigationSimulator::OnThrottleChecksComplete, 569 base::Bind(&NavigationSimulator::OnThrottleChecksComplete,
566 weak_factory_.GetWeakPtr())); 570 weak_factory_.GetWeakPtr()));
567 } 571 }
568 572
569 RenderFrameHost* NavigationSimulator::GetFinalRenderFrameHost() { 573 RenderFrameHost* NavigationSimulator::GetFinalRenderFrameHost() {
570 CHECK_EQ(state_, FINISHED); 574 CHECK_EQ(state_, FINISHED);
571 return render_frame_host_; 575 return render_frame_host_;
572 } 576 }
573 577
574 } // namespace content 578 } // namespace content
OLDNEW
« no previous file with comments | « content/public/test/browser_test_utils.cc ('k') | content/test/navigation_simulator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698