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

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

Issue 2497983002: PaymentApp: Implement PaymentAppManager.setManifest(). (Closed)
Patch Set: PaymentApp: Implement PaymentAppManager.setManifest(). Created 4 years, 1 month 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
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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 wrapPersistent(resolver)))); 83 wrapPersistent(resolver))));
84 84
85 return promise; 85 return promise;
86 } 86 }
87 87
88 void PaymentAppManager::onSetManifest( 88 void PaymentAppManager::onSetManifest(
89 ScriptPromiseResolver* resolver, 89 ScriptPromiseResolver* resolver,
90 payments::mojom::blink::PaymentAppManifestError error) { 90 payments::mojom::blink::PaymentAppManifestError error) {
91 DCHECK(resolver); 91 DCHECK(resolver);
92 switch (error) { 92 switch (error) {
93 case payments::mojom::blink::PaymentAppManifestError::NONE:
94 resolver->resolve();
95 break;
93 case payments::mojom::blink::PaymentAppManifestError::NOT_IMPLEMENTED: 96 case payments::mojom::blink::PaymentAppManifestError::NOT_IMPLEMENTED:
94 resolver->reject( 97 resolver->reject(
95 DOMException::create(NotSupportedError, "Not implemented yet.")); 98 DOMException::create(NotSupportedError, "Not implemented yet."));
96 break; 99 break;
100 case payments::mojom::blink::PaymentAppManifestError::NO_ACTIVE_WORKER:
101 resolver->reject(
102 DOMException::create(InvalidStateError, "No active service worker."));
103 break;
104 case payments::mojom::blink::PaymentAppManifestError::STORE_MANIFEST_FAILED:
105 resolver->reject(DOMException::create(
106 InvalidStateError, "Storing manifest data is failed."));
107 break;
97 default: 108 default:
please use gerrit instead 2016/11/15 20:04:27 If PaymentAppManifestError is an enum, remove the
zino 2016/11/16 18:12:59 Done.
98 NOTREACHED(); 109 NOTREACHED();
99 } 110 }
100 } 111 }
101 112
102 DEFINE_TRACE(PaymentAppManager) { 113 DEFINE_TRACE(PaymentAppManager) {
103 visitor->trace(m_registration); 114 visitor->trace(m_registration);
104 ContextLifecycleObserver::trace(visitor); 115 ContextLifecycleObserver::trace(visitor);
105 } 116 }
106 117
107 PaymentAppManager::PaymentAppManager(ScriptState* scriptState, 118 PaymentAppManager::PaymentAppManager(ScriptState* scriptState,
(...skipping 14 matching lines...) Expand all
122 } 133 }
123 134
124 m_manager.reset(); 135 m_manager.reset();
125 } 136 }
126 137
127 void PaymentAppManager::contextDestroyed() { 138 void PaymentAppManager::contextDestroyed() {
128 m_manager.reset(); 139 m_manager.reset();
129 } 140 }
130 141
131 } // namespace blink 142 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698