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

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

Issue 789643005: PlzNavigate: make content unit tests work with browser side navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cancel-navigations
Patch Set: Fixed nits Created 5 years, 11 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/browser/frame_host/navigation_request.h ('k') | content/browser/frame_host/navigator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "content/browser/frame_host/navigation_request.h" 5 #include "content/browser/frame_host/navigation_request.h"
6 6
7 #include "content/browser/frame_host/frame_tree_node.h" 7 #include "content/browser/frame_host/frame_tree_node.h"
8 #include "content/browser/frame_host/navigation_request_info.h" 8 #include "content/browser/frame_host/navigation_request_info.h"
9 #include "content/browser/frame_host/navigator.h" 9 #include "content/browser/frame_host/navigator.h"
10 #include "content/browser/loader/navigation_url_loader.h" 10 #include "content/browser/loader/navigation_url_loader.h"
11 #include "content/browser/site_instance_impl.h" 11 #include "content/browser/site_instance_impl.h"
12 #include "content/common/resource_request_body.h" 12 #include "content/common/resource_request_body.h"
13 #include "content/public/browser/navigation_controller.h" 13 #include "content/public/browser/navigation_controller.h"
14 #include "content/public/browser/stream_handle.h" 14 #include "content/public/browser/stream_handle.h"
15 #include "net/url_request/redirect_info.h" 15 #include "net/url_request/redirect_info.h"
16 16
17 namespace content { 17 namespace content {
18 18
19 // static
20 scoped_ptr<NavigationRequest> NavigationRequest::Create(
21 FrameTreeNode* frame_tree_node,
22 const NavigationEntryImpl& entry,
23 FrameMsg_Navigate_Type::Value navigation_type,
24 base::TimeTicks navigation_start) {
25 scoped_ptr<NavigationRequest> navigation_request(new NavigationRequest(
26 frame_tree_node,
27 CommonNavigationParams(entry.GetURL(), entry.GetReferrer(),
28 entry.GetTransitionType(), navigation_type,
29 !entry.IsViewSourceMode()),
30 CommitNavigationParams(entry.GetPageState(),
31 entry.GetIsOverridingUserAgent(),
32 navigation_start),
33 &entry));
34 return navigation_request.Pass();
35 }
36
19 NavigationRequest::NavigationRequest( 37 NavigationRequest::NavigationRequest(
20 FrameTreeNode* frame_tree_node, 38 FrameTreeNode* frame_tree_node,
21 const CommonNavigationParams& common_params, 39 const CommonNavigationParams& common_params,
22 const CommitNavigationParams& commit_params, 40 const CommitNavigationParams& commit_params,
23 const NavigationEntryImpl* entry) 41 const NavigationEntryImpl* entry)
24 : frame_tree_node_(frame_tree_node), 42 : frame_tree_node_(frame_tree_node),
25 common_params_(common_params), 43 common_params_(common_params),
26 commit_params_(commit_params), 44 commit_params_(commit_params),
27 state_(NOT_STARTED), 45 state_(NOT_STARTED),
28 restore_type_(NavigationEntryImpl::RESTORE_NONE), 46 restore_type_(NavigationEntryImpl::RESTORE_NONE),
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 } 95 }
78 96
79 void NavigationRequest::OnRequestFailed(int net_error) { 97 void NavigationRequest::OnRequestFailed(int net_error) {
80 DCHECK(state_ == STARTED); 98 DCHECK(state_ == STARTED);
81 state_ = FAILED; 99 state_ = FAILED;
82 // TODO(davidben): Network failures should display a network error page. 100 // TODO(davidben): Network failures should display a network error page.
83 NOTIMPLEMENTED(); 101 NOTIMPLEMENTED();
84 } 102 }
85 103
86 } // namespace content 104 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigation_request.h ('k') | content/browser/frame_host/navigator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698