OLD | NEW |
---|---|
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/common/resource_request_body.h" | 12 #include "content/common/resource_request_body.h" |
12 #include "content/public/browser/navigation_controller.h" | 13 #include "content/public/browser/navigation_controller.h" |
13 #include "content/public/browser/stream_handle.h" | 14 #include "content/public/browser/stream_handle.h" |
14 #include "net/url_request/redirect_info.h" | 15 #include "net/url_request/redirect_info.h" |
15 | 16 |
16 namespace content { | 17 namespace content { |
17 | 18 |
18 NavigationRequest::NavigationRequest( | 19 NavigationRequest::NavigationRequest( |
19 FrameTreeNode* frame_tree_node, | 20 FrameTreeNode* frame_tree_node, |
20 const CommonNavigationParams& common_params, | 21 const CommonNavigationParams& common_params, |
21 const CommitNavigationParams& commit_params) | 22 const CommitNavigationParams& commit_params, |
23 const NavigationEntryImpl* entry) | |
22 : frame_tree_node_(frame_tree_node), | 24 : frame_tree_node_(frame_tree_node), |
23 common_params_(common_params), | 25 common_params_(common_params), |
24 commit_params_(commit_params), | 26 commit_params_(commit_params), |
25 state_(NOT_STARTED) { | 27 state_(NOT_STARTED), |
28 restore_type_(NavigationEntryImpl::RESTORE_NONE), | |
29 is_view_source_(false), | |
30 bindings_(NavigationEntryImpl::kInvalidBindings) { | |
31 if (entry != nullptr) { | |
nasko
2015/01/21 00:29:55
nit: if (entry)
carlosk
2015/01/21 13:53:54
Done.
| |
32 source_site_instance_ = entry->source_site_instance(); | |
33 dest_site_instance_ = entry->site_instance(); | |
34 restore_type_ = entry->restore_type(); | |
35 is_view_source_ = entry->IsViewSourceMode(); | |
36 bindings_ = entry->bindings(); | |
37 } | |
26 } | 38 } |
27 | 39 |
28 NavigationRequest::~NavigationRequest() { | 40 NavigationRequest::~NavigationRequest() { |
29 } | 41 } |
30 | 42 |
31 void NavigationRequest::BeginNavigation( | 43 void NavigationRequest::BeginNavigation( |
32 scoped_ptr<NavigationRequestInfo> info, | 44 scoped_ptr<NavigationRequestInfo> info, |
33 scoped_refptr<ResourceRequestBody> request_body) { | 45 scoped_refptr<ResourceRequestBody> request_body) { |
34 DCHECK(!loader_); | 46 DCHECK(!loader_); |
35 DCHECK(state_ == NOT_STARTED || state_ == WAITING_FOR_RENDERER_RESPONSE); | 47 DCHECK(state_ == NOT_STARTED || state_ == WAITING_FOR_RENDERER_RESPONSE); |
(...skipping 29 matching lines...) Expand all Loading... | |
65 } | 77 } |
66 | 78 |
67 void NavigationRequest::OnRequestFailed(int net_error) { | 79 void NavigationRequest::OnRequestFailed(int net_error) { |
68 DCHECK(state_ == STARTED); | 80 DCHECK(state_ == STARTED); |
69 state_ = FAILED; | 81 state_ = FAILED; |
70 // TODO(davidben): Network failures should display a network error page. | 82 // TODO(davidben): Network failures should display a network error page. |
71 NOTIMPLEMENTED(); | 83 NOTIMPLEMENTED(); |
72 } | 84 } |
73 | 85 |
74 } // namespace content | 86 } // namespace content |
OLD | NEW |