Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1305)

Side by Side Diff: third_party/WebKit/Source/modules/payments/PaymentAppManager.cpp

Issue 2602213002: [PaymentApp] Fix a crash when enabledMethods called. (Closed)
Patch Set: [Payment] fix a crash when enabledMethods called. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/payments/payment-app-manager.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "modules/payments/PaymentAppManager.h" 5 #include "modules/payments/PaymentAppManager.h"
6 6
7 #include "bindings/core/v8/ScriptPromise.h" 7 #include "bindings/core/v8/ScriptPromise.h"
8 #include "bindings/core/v8/ScriptState.h" 8 #include "bindings/core/v8/ScriptState.h"
9 #include "core/dom/DOMException.h" 9 #include "core/dom/DOMException.h"
10 #include "modules/payments/PaymentAppManifest.h" 10 #include "modules/payments/PaymentAppManifest.h"
(...skipping 10 matching lines...) Expand all
21 using payments::mojom::blink::PaymentAppOption; 21 using payments::mojom::blink::PaymentAppOption;
22 using payments::mojom::blink::PaymentAppOptionPtr; 22 using payments::mojom::blink::PaymentAppOptionPtr;
23 23
24 template <> 24 template <>
25 struct TypeConverter<PaymentAppOptionPtr, blink::PaymentAppOption> { 25 struct TypeConverter<PaymentAppOptionPtr, blink::PaymentAppOption> {
26 static PaymentAppOptionPtr Convert(const blink::PaymentAppOption& input) { 26 static PaymentAppOptionPtr Convert(const blink::PaymentAppOption& input) {
27 PaymentAppOptionPtr output = PaymentAppOption::New(); 27 PaymentAppOptionPtr output = PaymentAppOption::New();
28 output->name = input.hasName() ? input.name() : WTF::emptyString(); 28 output->name = input.hasName() ? input.name() : WTF::emptyString();
29 output->icon = input.hasIcon() ? input.icon() : WTF::String(); 29 output->icon = input.hasIcon() ? input.icon() : WTF::String();
30 output->id = input.hasId() ? input.id() : WTF::emptyString(); 30 output->id = input.hasId() ? input.id() : WTF::emptyString();
31 output->enabled_methods = WTF::Vector<WTF::String>(input.enabledMethods()); 31 if (input.hasEnabledMethods()) {
32 output->enabled_methods =
33 WTF::Vector<WTF::String>(input.enabledMethods());
34 }
32 return output; 35 return output;
33 } 36 }
34 }; 37 };
35 38
36 template <> 39 template <>
37 struct TypeConverter<PaymentAppManifestPtr, blink::PaymentAppManifest> { 40 struct TypeConverter<PaymentAppManifestPtr, blink::PaymentAppManifest> {
38 static PaymentAppManifestPtr Convert(const blink::PaymentAppManifest& input) { 41 static PaymentAppManifestPtr Convert(const blink::PaymentAppManifest& input) {
39 PaymentAppManifestPtr output = PaymentAppManifest::New(); 42 PaymentAppManifestPtr output = PaymentAppManifest::New();
40 output->name = input.hasName() ? input.name() : WTF::emptyString(); 43 output->name = input.hasName() ? input.name() : WTF::emptyString();
41 output->icon = input.hasIcon() ? input.icon() : WTF::String(); 44 output->icon = input.hasIcon() ? input.icon() : WTF::String();
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 195
193 void PaymentAppManager::onServiceConnectionError() { 196 void PaymentAppManager::onServiceConnectionError() {
194 if (!Platform::current()) { 197 if (!Platform::current()) {
195 return; 198 return;
196 } 199 }
197 200
198 m_manager.reset(); 201 m_manager.reset();
199 } 202 }
200 203
201 } // namespace blink 204 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/payments/payment-app-manager.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698