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_type_converters.h" | 5 #include "content/renderer/service_worker/service_worker_type_converters.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 | 8 |
9 namespace mojo { | 9 namespace mojo { |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 } else if (status == blink::mojom::ServiceWorkerEventStatus::ABORTED) { | 22 } else if (status == blink::mojom::ServiceWorkerEventStatus::ABORTED) { |
23 status_code = content::SERVICE_WORKER_ERROR_ABORT; | 23 status_code = content::SERVICE_WORKER_ERROR_ABORT; |
24 } else { | 24 } else { |
25 // We received an unexpected value back. This can theoretically happen as | 25 // We received an unexpected value back. This can theoretically happen as |
26 // mojo doesn't validate enum values. | 26 // mojo doesn't validate enum values. |
27 status_code = content::SERVICE_WORKER_ERROR_IPC_FAILED; | 27 status_code = content::SERVICE_WORKER_ERROR_IPC_FAILED; |
28 } | 28 } |
29 return status_code; | 29 return status_code; |
30 } | 30 } |
31 | 31 |
32 blink::WebPaymentAppRequest | 32 blink::WebPaymentRequestEventData |
33 TypeConverter<blink::WebPaymentAppRequest, | 33 TypeConverter<blink::WebPaymentRequestEventData, |
34 payments::mojom::PaymentAppRequestPtr>:: | 34 payments::mojom::PaymentRequestEventDataPtr>:: |
35 Convert(const payments::mojom::PaymentAppRequestPtr& input) { | 35 Convert(const payments::mojom::PaymentRequestEventDataPtr& input) { |
36 blink::WebPaymentAppRequest output; | 36 blink::WebPaymentRequestEventData output; |
37 | 37 |
38 output.top_level_origin = | 38 output.top_level_origin = |
39 blink::WebString::FromUTF8(input->top_level_origin.spec()); | 39 blink::WebString::FromUTF8(input->top_level_origin.spec()); |
40 output.payment_request_origin = | 40 output.payment_request_origin = |
41 blink::WebString::FromUTF8(input->payment_request_origin.spec()); | 41 blink::WebString::FromUTF8(input->payment_request_origin.spec()); |
42 output.payment_request_id = | 42 output.payment_request_id = |
43 blink::WebString::FromUTF8(input->payment_request_id); | 43 blink::WebString::FromUTF8(input->payment_request_id); |
44 | 44 |
45 output.method_data = | 45 output.method_data = |
46 blink::WebVector<blink::WebPaymentMethodData>(input->method_data.size()); | 46 blink::WebVector<blink::WebPaymentMethodData>(input->method_data.size()); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 kSucceeded; | 144 kSucceeded; |
145 case content::mojom::BackgroundFetchState::FAILED: | 145 case content::mojom::BackgroundFetchState::FAILED: |
146 return blink::WebServiceWorkerContextProxy::BackgroundFetchState::kFailed; | 146 return blink::WebServiceWorkerContextProxy::BackgroundFetchState::kFailed; |
147 } | 147 } |
148 | 148 |
149 NOTREACHED(); | 149 NOTREACHED(); |
150 return blink::WebServiceWorkerContextProxy::BackgroundFetchState::kPending; | 150 return blink::WebServiceWorkerContextProxy::BackgroundFetchState::kPending; |
151 } | 151 } |
152 | 152 |
153 } // namespace mojo | 153 } // namespace mojo |
OLD | NEW |