OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_provider_host.h" | 5 #include "content/browser/service_worker/service_worker_provider_host.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/guid.h" | 9 #include "base/guid.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 provider_host, | 53 provider_host, |
54 blob_storage_context, | 54 blob_storage_context, |
55 resource_type) {} | 55 resource_type) {} |
56 ~ServiceWorkerURLTrackingRequestHandler() override {} | 56 ~ServiceWorkerURLTrackingRequestHandler() override {} |
57 | 57 |
58 // Called via custom URLRequestJobFactory. | 58 // Called via custom URLRequestJobFactory. |
59 net::URLRequestJob* MaybeCreateJob( | 59 net::URLRequestJob* MaybeCreateJob( |
60 net::URLRequest* request, | 60 net::URLRequest* request, |
61 net::NetworkDelegate* network_delegate, | 61 net::NetworkDelegate* network_delegate, |
62 ResourceContext* resource_context) override { | 62 ResourceContext* resource_context) override { |
| 63 // |provider_host_| may have been deleted when the request is resumed. |
| 64 if (!provider_host_) |
| 65 return nullptr; |
63 const GURL stripped_url = net::SimplifyUrlForRequest(request->url()); | 66 const GURL stripped_url = net::SimplifyUrlForRequest(request->url()); |
64 provider_host_->SetDocumentUrl(stripped_url); | 67 provider_host_->SetDocumentUrl(stripped_url); |
65 provider_host_->SetTopmostFrameUrl(request->first_party_for_cookies()); | 68 provider_host_->SetTopmostFrameUrl(request->first_party_for_cookies()); |
66 return nullptr; | 69 return nullptr; |
67 } | 70 } |
68 | 71 |
69 private: | 72 private: |
70 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerURLTrackingRequestHandler); | 73 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerURLTrackingRequestHandler); |
71 }; | 74 }; |
72 | 75 |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 render_thread_id_, provider_id(), | 754 render_thread_id_, provider_id(), |
752 GetOrCreateServiceWorkerHandle( | 755 GetOrCreateServiceWorkerHandle( |
753 associated_registration_->active_version()), | 756 associated_registration_->active_version()), |
754 false /* shouldNotifyControllerChange */, | 757 false /* shouldNotifyControllerChange */, |
755 associated_registration_->active_version()->used_features())); | 758 associated_registration_->active_version()->used_features())); |
756 } | 759 } |
757 } | 760 } |
758 } | 761 } |
759 | 762 |
760 } // namespace content | 763 } // namespace content |
OLD | NEW |