| 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 17 matching lines...) Expand all Loading... |
| 28 } | 28 } |
| 29 return status_code; | 29 return status_code; |
| 30 } | 30 } |
| 31 | 31 |
| 32 blink::WebPaymentAppRequest | 32 blink::WebPaymentAppRequest |
| 33 TypeConverter<blink::WebPaymentAppRequest, | 33 TypeConverter<blink::WebPaymentAppRequest, |
| 34 payments::mojom::PaymentAppRequestPtr>:: | 34 payments::mojom::PaymentAppRequestPtr>:: |
| 35 Convert(const payments::mojom::PaymentAppRequestPtr& input) { | 35 Convert(const payments::mojom::PaymentAppRequestPtr& input) { |
| 36 blink::WebPaymentAppRequest output; | 36 blink::WebPaymentAppRequest output; |
| 37 | 37 |
| 38 output.origin = blink::WebString::FromUTF8(input->origin.spec()); | 38 output.top_level_origin = |
| 39 blink::WebString::FromUTF8(input->top_level_origin.spec()); |
| 40 output.payment_request_origin = |
| 41 blink::WebString::FromUTF8(input->payment_request_origin.spec()); |
| 42 output.payment_request_id = |
| 43 blink::WebString::FromUTF8(input->payment_request_id); |
| 39 | 44 |
| 40 output.method_data = | 45 output.method_data = |
| 41 blink::WebVector<blink::WebPaymentMethodData>(input->method_data.size()); | 46 blink::WebVector<blink::WebPaymentMethodData>(input->method_data.size()); |
| 42 for (size_t i = 0; i < input->method_data.size(); i++) { | 47 for (size_t i = 0; i < input->method_data.size(); i++) { |
| 43 output.method_data[i] = mojo::ConvertTo<blink::WebPaymentMethodData>( | 48 output.method_data[i] = mojo::ConvertTo<blink::WebPaymentMethodData>( |
| 44 std::move(input->method_data[i])); | 49 std::move(input->method_data[i])); |
| 45 } | 50 } |
| 46 | 51 |
| 47 output.total = mojo::ConvertTo<blink::WebPaymentItem>(input->total); | 52 output.total = mojo::ConvertTo<blink::WebPaymentItem>(input->total); |
| 48 | 53 |
| 49 output.modifiers = blink::WebVector<blink::WebPaymentDetailsModifier>( | 54 output.modifiers = blink::WebVector<blink::WebPaymentDetailsModifier>( |
| 50 input->modifiers.size()); | 55 input->modifiers.size()); |
| 51 for (size_t i = 0; i < input->modifiers.size(); i++) { | 56 for (size_t i = 0; i < input->modifiers.size(); i++) { |
| 52 output.modifiers[i] = | 57 output.modifiers[i] = |
| 53 mojo::ConvertTo<blink::WebPaymentDetailsModifier>(input->modifiers[i]); | 58 mojo::ConvertTo<blink::WebPaymentDetailsModifier>(input->modifiers[i]); |
| 54 } | 59 } |
| 55 | 60 |
| 56 output.option_id = blink::WebString::FromUTF8(input->option_id); | 61 output.instrument_key = blink::WebString::FromUTF8(input->instrument_key); |
| 57 | 62 |
| 58 return output; | 63 return output; |
| 59 } | 64 } |
| 60 | 65 |
| 61 blink::WebPaymentMethodData | 66 blink::WebPaymentMethodData |
| 62 TypeConverter<blink::WebPaymentMethodData, | 67 TypeConverter<blink::WebPaymentMethodData, |
| 63 payments::mojom::PaymentMethodDataPtr>:: | 68 payments::mojom::PaymentMethodDataPtr>:: |
| 64 Convert(const payments::mojom::PaymentMethodDataPtr& input) { | 69 Convert(const payments::mojom::PaymentMethodDataPtr& input) { |
| 65 blink::WebPaymentMethodData output; | 70 blink::WebPaymentMethodData output; |
| 66 | 71 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 kSucceeded; | 144 kSucceeded; |
| 140 case content::mojom::BackgroundFetchState::FAILED: | 145 case content::mojom::BackgroundFetchState::FAILED: |
| 141 return blink::WebServiceWorkerContextProxy::BackgroundFetchState::kFailed; | 146 return blink::WebServiceWorkerContextProxy::BackgroundFetchState::kFailed; |
| 142 } | 147 } |
| 143 | 148 |
| 144 NOTREACHED(); | 149 NOTREACHED(); |
| 145 return blink::WebServiceWorkerContextProxy::BackgroundFetchState::kPending; | 150 return blink::WebServiceWorkerContextProxy::BackgroundFetchState::kPending; |
| 146 } | 151 } |
| 147 | 152 |
| 148 } // namespace mojo | 153 } // namespace mojo |
| OLD | NEW |