| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/appcache/appcache_url_loader_factory.h" | 5 #include "content/browser/appcache/appcache_url_loader_factory.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "content/browser/appcache/appcache_request_handler.h" | 9 #include "content/browser/appcache/appcache_request_handler.h" |
| 10 #include "content/browser/appcache/appcache_url_loader_job.h" | 10 #include "content/browser/appcache/appcache_url_loader_job.h" |
| 11 #include "content/browser/appcache/appcache_url_loader_request.h" | 11 #include "content/browser/appcache/appcache_url_loader_request.h" |
| 12 #include "content/browser/url_loader_factory_getter.h" | 12 #include "content/browser/url_loader_factory_getter.h" |
| 13 #include "content/common/resource_request.h" | 13 #include "content/common/resource_request.h" |
| 14 #include "content/common/url_loader_factory.mojom.h" | 14 #include "content/common/url_loader_factory.mojom.h" |
| 15 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
| 16 #include "mojo/public/cpp/bindings/binding.h" | 16 #include "mojo/public/cpp/bindings/binding.h" |
| 17 #include "mojo/public/cpp/bindings/binding_set.h" | 17 #include "mojo/public/cpp/bindings/binding_set.h" |
| 18 #include "mojo/public/cpp/bindings/interface_ptr.h" | 18 #include "mojo/public/cpp/bindings/interface_ptr.h" |
| 19 #include "net/traffic_annotation/network_traffic_annotation.h" |
| 19 | 20 |
| 20 namespace content { | 21 namespace content { |
| 21 | 22 |
| 22 // Implements the URLLoaderFactory mojom for AppCache requests. | 23 // Implements the URLLoaderFactory mojom for AppCache requests. |
| 23 AppCacheURLLoaderFactory::AppCacheURLLoaderFactory( | 24 AppCacheURLLoaderFactory::AppCacheURLLoaderFactory( |
| 24 mojom::URLLoaderFactoryRequest request, | 25 mojom::URLLoaderFactoryRequest request, |
| 25 URLLoaderFactoryGetter* factory_getter) | 26 URLLoaderFactoryGetter* factory_getter) |
| 26 : binding_(this, std::move(request)), factory_getter_(factory_getter) { | 27 : binding_(this, std::move(request)), factory_getter_(factory_getter) { |
| 27 binding_.set_connection_error_handler(base::Bind( | 28 binding_.set_connection_error_handler(base::Bind( |
| 28 &AppCacheURLLoaderFactory::OnConnectionError, base::Unretained(this))); | 29 &AppCacheURLLoaderFactory::OnConnectionError, base::Unretained(this))); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 41 new AppCacheURLLoaderFactory(std::move(request), factory_getter); | 42 new AppCacheURLLoaderFactory(std::move(request), factory_getter); |
| 42 return loader_factory; | 43 return loader_factory; |
| 43 } | 44 } |
| 44 | 45 |
| 45 void AppCacheURLLoaderFactory::CreateLoaderAndStart( | 46 void AppCacheURLLoaderFactory::CreateLoaderAndStart( |
| 46 mojom::URLLoaderAssociatedRequest url_loader_request, | 47 mojom::URLLoaderAssociatedRequest url_loader_request, |
| 47 int32_t routing_id, | 48 int32_t routing_id, |
| 48 int32_t request_id, | 49 int32_t request_id, |
| 49 uint32_t options, | 50 uint32_t options, |
| 50 const ResourceRequest& request, | 51 const ResourceRequest& request, |
| 51 mojom::URLLoaderClientPtr client) { | 52 mojom::URLLoaderClientPtr client, |
| 53 const net::MutableNetworkTrafficAnnotationTag& traffic_annotation) { |
| 52 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 54 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 53 NOTREACHED() << "Currently not implemented"; | 55 NOTREACHED() << "Currently not implemented"; |
| 54 } | 56 } |
| 55 | 57 |
| 56 void AppCacheURLLoaderFactory::SyncLoad(int32_t routing_id, | 58 void AppCacheURLLoaderFactory::SyncLoad(int32_t routing_id, |
| 57 int32_t request_id, | 59 int32_t request_id, |
| 58 const ResourceRequest& request, | 60 const ResourceRequest& request, |
| 59 SyncLoadCallback callback) { | 61 SyncLoadCallback callback) { |
| 60 NOTREACHED(); | 62 NOTREACHED(); |
| 61 } | 63 } |
| 62 | 64 |
| 63 void AppCacheURLLoaderFactory::OnConnectionError() { | 65 void AppCacheURLLoaderFactory::OnConnectionError() { |
| 64 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this); | 66 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this); |
| 65 } | 67 } |
| 66 | 68 |
| 67 } // namespace content | 69 } // namespace content |
| OLD | NEW |