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