Index: content/browser/loader/navigation_url_loader_impl.cc |
diff --git a/content/browser/loader/navigation_url_loader_impl.cc b/content/browser/loader/navigation_url_loader_impl.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..beec234fde8244fde30b1275c728713e8f2d0253 |
--- /dev/null |
+++ b/content/browser/loader/navigation_url_loader_impl.cc |
@@ -0,0 +1,63 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "content/browser/loader/navigation_url_loader_impl.h" |
+ |
+#include "base/bind.h" |
+#include "base/location.h" |
+#include "content/browser/frame_host/navigation_request_info.h" |
+#include "content/browser/loader/navigation_url_loader_core.h" |
+#include "content/public/browser/browser_context.h" |
+#include "content/public/browser/browser_thread.h" |
+#include "content/public/browser/stream_handle.h" |
+ |
+namespace content { |
+ |
+NavigationURLLoaderImpl::NavigationURLLoaderImpl( |
+ BrowserContext* browser_context, |
+ int64 frame_tree_node_id, |
+ const CommonNavigationParams& common_params, |
+ scoped_ptr<NavigationRequestInfo> request_info, |
+ ResourceRequestBody* request_body, |
+ NavigationURLLoader::Delegate* delegate) |
+ : delegate_(delegate), |
mmenke
2014/10/22 15:32:58
nit: +2 indent
davidben
2014/10/22 20:58:04
Done.
|
+ weak_factory_(this) { |
+ core_ = new NavigationURLLoaderCore(weak_factory_.GetWeakPtr()); |
+ BrowserThread::PostTask( |
+ BrowserThread::IO, FROM_HERE, |
+ base::Bind(&NavigationURLLoaderCore::Start, base::Unretained(core_), |
+ browser_context->GetResourceContext(), frame_tree_node_id, |
+ common_params, base::Passed(&request_info), |
+ make_scoped_refptr(request_body))); |
+} |
+ |
+NavigationURLLoaderImpl::~NavigationURLLoaderImpl() { |
+ BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, core_); |
+ core_ = nullptr; |
+} |
+ |
+void NavigationURLLoaderImpl::FollowRedirect() { |
mmenke
2014/10/22 15:32:58
Suggest adding thread dchecks here and in Navigati
davidben
2014/10/22 20:58:04
Done. (I actually ended up removing them now that
|
+ BrowserThread::PostTask( |
+ BrowserThread::IO, FROM_HERE, |
+ base::Bind(&NavigationURLLoaderCore::FollowRedirect, |
+ base::Unretained(core_))); |
+} |
+ |
+void NavigationURLLoaderImpl::NotifyRequestRedirected( |
+ const net::RedirectInfo& redirect_info, |
+ ResourceResponse* response) { |
+ delegate_->OnRequestRedirected(redirect_info, response); |
+} |
+ |
+void NavigationURLLoaderImpl::NotifyResponseStarted( |
+ ResourceResponse* response, |
+ scoped_ptr<StreamHandle> body) { |
+ delegate_->OnResponseStarted(response, body.Pass()); |
+} |
+ |
+void NavigationURLLoaderImpl::NotifyRequestFailed(int net_error) { |
+ delegate_->OnRequestFailed(net_error); |
+} |
+ |
+} // namespace content |