Index: content/browser/frame_host/navigation_request.cc |
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc |
index 8b87b7ecae21e3f00fe93fd05add3bce8975a9e2..57f5479727c1c55f65e29f88a442875a0aa623f8 100644 |
--- a/content/browser/frame_host/navigation_request.cc |
+++ b/content/browser/frame_host/navigation_request.cc |
@@ -4,8 +4,14 @@ |
#include "content/browser/frame_host/navigation_request.h" |
+#include "content/browser/frame_host/frame_tree_node.h" |
#include "content/browser/frame_host/navigation_request_info.h" |
+#include "content/browser/frame_host/navigator.h" |
+#include "content/browser/loader/navigation_url_loader.h" |
#include "content/common/resource_request_body.h" |
+#include "content/public/browser/navigation_controller.h" |
+#include "content/public/browser/stream_handle.h" |
+#include "net/url_request/redirect_info.h" |
namespace content { |
@@ -24,7 +30,37 @@ NavigationRequest::~NavigationRequest() { |
void NavigationRequest::BeginNavigation( |
scoped_ptr<NavigationRequestInfo> info, |
scoped_refptr<ResourceRequestBody> request_body) { |
- info_ = info.Pass(); |
+ DCHECK(!loader_); |
+ loader_ = NavigationURLLoader::Create( |
+ frame_tree_node_->navigator()->GetController()->GetBrowserContext(), |
+ frame_tree_node_->frame_tree_node_id(), common_params_, info.Pass(), |
+ request_body.get(), this); |
+ |
+ // TODO(davidben): Fire (and add as necessary) observer methods such as |
+ // DidStartProvisionalLoadForFrame for the navigation. |
+} |
+ |
+void NavigationRequest::OnRequestRedirected( |
+ const net::RedirectInfo& redirect_info, |
+ const scoped_refptr<ResourceResponse>& response) { |
+ // TODO(davidben): Track other changes from redirects. These are important |
+ // for, e.g., reloads. |
+ common_params_.url = redirect_info.new_url; |
+ |
+ // TODO(davidben): This where prerender and navigation_interceptor should be |
+ // integrated. For now, just always follow all redirects. |
+ loader_->FollowRedirect(); |
+} |
+ |
+void NavigationRequest::OnResponseStarted( |
+ const scoped_refptr<ResourceResponse>& response, |
+ scoped_ptr<StreamHandle> body) { |
+ frame_tree_node_->navigator()->CommitNavigation(frame_tree_node_, |
+ response.get(), body.Pass()); |
+} |
+ |
+void NavigationRequest::OnRequestFailed(int net_error) { |
+ // TODO(davidben): Network failures should display a network error page. |
NOTIMPLEMENTED(); |
} |