OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/loader/url_loader_factory_impl.h" | 5 #include "content/browser/loader/url_loader_factory_impl.h" |
6 | 6 |
7 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 7 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
8 #include "content/browser/loader/resource_requester_info.h" | 8 #include "content/browser/loader/resource_requester_info.h" |
9 #include "content/common/resource_request.h" | 9 #include "content/common/resource_request.h" |
10 #include "content/common/url_loader.mojom.h" | 10 #include "content/common/url_loader.mojom.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 } | 29 } |
30 | 30 |
31 callback.Run(*result); | 31 callback.Run(*result); |
32 } | 32 } |
33 | 33 |
34 } // namespace | 34 } // namespace |
35 | 35 |
36 URLLoaderFactoryImpl::URLLoaderFactoryImpl( | 36 URLLoaderFactoryImpl::URLLoaderFactoryImpl( |
37 scoped_refptr<ResourceRequesterInfo> requester_info) | 37 scoped_refptr<ResourceRequesterInfo> requester_info) |
38 : requester_info_(std::move(requester_info)) { | 38 : requester_info_(std::move(requester_info)) { |
39 DCHECK(requester_info_->IsRenderer()); | 39 DCHECK((requester_info_->IsRenderer() && requester_info_->filter()) || |
40 DCHECK(requester_info_->filter()); | 40 requester_info_->IsNavigationPreload()); |
41 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 41 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
42 } | 42 } |
43 | 43 |
44 URLLoaderFactoryImpl::~URLLoaderFactoryImpl() { | 44 URLLoaderFactoryImpl::~URLLoaderFactoryImpl() { |
45 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 45 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
46 } | 46 } |
47 | 47 |
48 void URLLoaderFactoryImpl::CreateLoaderAndStart( | 48 void URLLoaderFactoryImpl::CreateLoaderAndStart( |
49 mojom::URLLoaderAssociatedRequest request, | 49 mojom::URLLoaderAssociatedRequest request, |
50 int32_t routing_id, | 50 int32_t routing_id, |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 97 |
98 void URLLoaderFactoryImpl::Create( | 98 void URLLoaderFactoryImpl::Create( |
99 scoped_refptr<ResourceRequesterInfo> requester_info, | 99 scoped_refptr<ResourceRequesterInfo> requester_info, |
100 mojo::InterfaceRequest<mojom::URLLoaderFactory> request) { | 100 mojo::InterfaceRequest<mojom::URLLoaderFactory> request) { |
101 mojo::MakeStrongBinding( | 101 mojo::MakeStrongBinding( |
102 base::WrapUnique(new URLLoaderFactoryImpl(std::move(requester_info))), | 102 base::WrapUnique(new URLLoaderFactoryImpl(std::move(requester_info))), |
103 std::move(request)); | 103 std::move(request)); |
104 } | 104 } |
105 | 105 |
106 } // namespace content | 106 } // namespace content |
OLD | NEW |