| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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/service_worker/service_worker_fetch_dispatcher.h" | 5 #include "content/browser/service_worker/service_worker_fetch_dispatcher.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 namespace { | 42 namespace { |
| 43 | 43 |
| 44 // This class wraps a mojo::AssociatedInterfacePtr<URLLoader>. It also is a | 44 // This class wraps a mojo::AssociatedInterfacePtr<URLLoader>. It also is a |
| 45 // URLLoader implementation and delegates URLLoader calls to the wrapped loader. | 45 // URLLoader implementation and delegates URLLoader calls to the wrapped loader. |
| 46 class DelegatingURLLoader final : public mojom::URLLoader { | 46 class DelegatingURLLoader final : public mojom::URLLoader { |
| 47 public: | 47 public: |
| 48 explicit DelegatingURLLoader(mojom::URLLoaderAssociatedPtr loader) | 48 explicit DelegatingURLLoader(mojom::URLLoaderAssociatedPtr loader) |
| 49 : binding_(this), loader_(std::move(loader)) {} | 49 : binding_(this), loader_(std::move(loader)) {} |
| 50 ~DelegatingURLLoader() override {} | 50 ~DelegatingURLLoader() override {} |
| 51 | 51 |
| 52 void Start(mojom::URLLoaderAssociatedRequest loader, |
| 53 mojom::URLLoaderClientPtr client) override { |
| 54 NOTREACHED(); |
| 55 } |
| 56 |
| 52 void FollowRedirect() override { loader_->FollowRedirect(); } | 57 void FollowRedirect() override { loader_->FollowRedirect(); } |
| 53 | 58 |
| 54 void SetPriority(net::RequestPriority priority, | 59 void SetPriority(net::RequestPriority priority, |
| 55 int intra_priority_value) override { | 60 int intra_priority_value) override { |
| 56 loader_->SetPriority(priority, intra_priority_value); | 61 loader_->SetPriority(priority, intra_priority_value); |
| 57 } | 62 } |
| 58 | 63 |
| 59 mojom::URLLoaderPtr CreateInterfacePtrAndBind() { | 64 mojom::URLLoaderPtr CreateInterfacePtrAndBind() { |
| 60 auto p = binding_.CreateInterfacePtrAndBind(); | 65 auto p = binding_.CreateInterfacePtrAndBind(); |
| 61 // This unretained pointer is safe, because |binding_| is owned by |this| | 66 // This unretained pointer is safe, because |binding_| is owned by |this| |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 ServiceWorkerVersion* version, | 691 ServiceWorkerVersion* version, |
| 687 int event_finish_id, | 692 int event_finish_id, |
| 688 scoped_refptr<URLLoaderAssets> url_loader_assets, | 693 scoped_refptr<URLLoaderAssets> url_loader_assets, |
| 689 ServiceWorkerStatusCode status, | 694 ServiceWorkerStatusCode status, |
| 690 base::Time dispatch_event_time) { | 695 base::Time dispatch_event_time) { |
| 691 version->FinishRequest(event_finish_id, status != SERVICE_WORKER_ERROR_ABORT, | 696 version->FinishRequest(event_finish_id, status != SERVICE_WORKER_ERROR_ABORT, |
| 692 dispatch_event_time); | 697 dispatch_event_time); |
| 693 } | 698 } |
| 694 | 699 |
| 695 } // namespace content | 700 } // namespace content |
| OLD | NEW |