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 |
new file mode 100644 |
index 0000000000000000000000000000000000000000..43f06f947d230fb8c84ed5205e1d1029c539fbcc |
--- /dev/null |
+++ b/content/browser/frame_host/navigation_request.cc |
@@ -0,0 +1,45 @@ |
+// 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/frame_host/navigation_request.h" |
+ |
+#include "base/logging.h" |
+#include "content/browser/frame_host/navigation_request_info.h" |
+#include "content/browser/loader/resource_dispatcher_host_impl.h" |
+#include "content/common/resource_request_body.h" |
+#include "content/public/browser/browser_thread.h" |
+ |
+namespace content { |
+ |
+namespace { |
+ |
+void OnBeginNavigation(const NavigationRequestInfo& info, |
+ scoped_refptr<ResourceRequestBody> request_body, |
clamy
2014/07/03 15:10:51
request_body is used as a separate parameter in th
|
+ int64 frame_node_id) { |
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
+ ResourceDispatcherHostImpl::Get()->NavigationRequest( |
+ info, request_body, frame_node_id); |
+} |
+ |
+} // namespace |
+ |
+NavigationRequest::NavigationRequest() {} |
+ |
+NavigationRequest::~NavigationRequest() { |
+ // TODO(clamy): Cancel the corresponding request in ResourceDispatcherHost if |
+ // it has not commited yet. |
+} |
+ |
+void NavigationRequest::BeginNavigation( |
+ const NavigationRequestInfo& info, |
+ scoped_refptr<ResourceRequestBody> request_body, |
+ int64 frame_node_id) { |
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
+ BrowserThread::PostTask( |
+ BrowserThread::IO, |
+ FROM_HERE, |
+ base::Bind(&OnBeginNavigation, info, request_body, frame_node_id)); |
+} |
+ |
+} // namespace content |