| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/renderer/service_worker/service_worker_context_client.h" | 5 #include "content/renderer/service_worker/service_worker_context_client.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 blink::WebString::fromUTF8(it->second)); | 726 blink::WebString::fromUTF8(it->second)); |
| 727 } | 727 } |
| 728 if (!request.blob_uuid.empty()) { | 728 if (!request.blob_uuid.empty()) { |
| 729 webRequest.setBlob(blink::WebString::fromUTF8(request.blob_uuid), | 729 webRequest.setBlob(blink::WebString::fromUTF8(request.blob_uuid), |
| 730 request.blob_size); | 730 request.blob_size); |
| 731 } | 731 } |
| 732 webRequest.setReferrer( | 732 webRequest.setReferrer( |
| 733 blink::WebString::fromUTF8(request.referrer.url.spec()), | 733 blink::WebString::fromUTF8(request.referrer.url.spec()), |
| 734 request.referrer.policy); | 734 request.referrer.policy); |
| 735 webRequest.setMode(GetBlinkFetchRequestMode(request.mode)); | 735 webRequest.setMode(GetBlinkFetchRequestMode(request.mode)); |
| 736 webRequest.setIsMainResourceLoad(request.is_main_resource_load); |
| 736 webRequest.setCredentialsMode( | 737 webRequest.setCredentialsMode( |
| 737 GetBlinkFetchCredentialsMode(request.credentials_mode)); | 738 GetBlinkFetchCredentialsMode(request.credentials_mode)); |
| 738 webRequest.setRedirectMode(GetBlinkFetchRedirectMode(request.redirect_mode)); | 739 webRequest.setRedirectMode(GetBlinkFetchRedirectMode(request.redirect_mode)); |
| 739 webRequest.setRequestContext( | 740 webRequest.setRequestContext( |
| 740 GetBlinkRequestContext(request.request_context_type)); | 741 GetBlinkRequestContext(request.request_context_type)); |
| 741 webRequest.setFrameType(GetBlinkFrameType(request.frame_type)); | 742 webRequest.setFrameType(GetBlinkFrameType(request.frame_type)); |
| 743 webRequest.setClientId(blink::WebString::fromUTF8(request.client_id)); |
| 742 webRequest.setIsReload(request.is_reload); | 744 webRequest.setIsReload(request.is_reload); |
| 743 proxy_->dispatchFetchEvent(request_id, webRequest); | 745 proxy_->dispatchFetchEvent(request_id, webRequest); |
| 744 } | 746 } |
| 745 | 747 |
| 746 void ServiceWorkerContextClient::OnNotificationClickEvent( | 748 void ServiceWorkerContextClient::OnNotificationClickEvent( |
| 747 int request_id, | 749 int request_id, |
| 748 int64_t persistent_notification_id, | 750 int64_t persistent_notification_id, |
| 749 const PlatformNotificationData& notification_data, | 751 const PlatformNotificationData& notification_data, |
| 750 int action_index) { | 752 int action_index) { |
| 751 TRACE_EVENT0("ServiceWorker", | 753 TRACE_EVENT0("ServiceWorker", |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 984 } | 986 } |
| 985 | 987 |
| 986 base::WeakPtr<ServiceWorkerContextClient> | 988 base::WeakPtr<ServiceWorkerContextClient> |
| 987 ServiceWorkerContextClient::GetWeakPtr() { | 989 ServiceWorkerContextClient::GetWeakPtr() { |
| 988 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); | 990 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); |
| 989 DCHECK(context_); | 991 DCHECK(context_); |
| 990 return context_->weak_factory.GetWeakPtr(); | 992 return context_->weak_factory.GetWeakPtr(); |
| 991 } | 993 } |
| 992 | 994 |
| 993 } // namespace content | 995 } // namespace content |
| OLD | NEW |