OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "content/browser/frame_host/navigation_request.h" | |
6 | |
7 #include "base/logging.h" | |
8 #include "content/browser/frame_host/navigation_request_info.h" | |
9 #include "content/browser/loader/resource_dispatcher_host_impl.h" | |
10 #include "content/common/resource_request_body.h" | |
11 #include "content/public/browser/browser_thread.h" | |
12 | |
13 namespace content { | |
14 | |
15 namespace { | |
16 | |
17 void OnBeginNavigation(const NavigationRequestInfo& info, | |
18 scoped_refptr<ResourceRequestBody> request_body, | |
clamy
2014/07/03 15:10:51
request_body is used as a separate parameter in th
| |
19 int64 frame_node_id) { | |
20 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | |
21 ResourceDispatcherHostImpl::Get()->NavigationRequest( | |
22 info, request_body, frame_node_id); | |
23 } | |
24 | |
25 } // namespace | |
26 | |
27 NavigationRequest::NavigationRequest() {} | |
28 | |
29 NavigationRequest::~NavigationRequest() { | |
30 // TODO(clamy): Cancel the corresponding request in ResourceDispatcherHost if | |
31 // it has not commited yet. | |
32 } | |
33 | |
34 void NavigationRequest::BeginNavigation( | |
35 const NavigationRequestInfo& info, | |
36 scoped_refptr<ResourceRequestBody> request_body, | |
37 int64 frame_node_id) { | |
38 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | |
39 BrowserThread::PostTask( | |
40 BrowserThread::IO, | |
41 FROM_HERE, | |
42 base::Bind(&OnBeginNavigation, info, request_body, frame_node_id)); | |
43 } | |
44 | |
45 } // namespace content | |
OLD | NEW |