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

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

Issue 2790013002: PaymentHandler: Implement set/get methods in PaymentInstruments (blink) (Closed)
Patch Set: blink Created 3 years, 8 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/Source/modules/payments/PaymentManager.h ('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/PaymentManager.h" 5 #include "modules/payments/PaymentManager.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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 124
125 manager_->GetManifest(ConvertToBaseCallback( 125 manager_->GetManifest(ConvertToBaseCallback(
126 WTF::Bind(&PaymentManager::OnGetManifest, WrapPersistent(this), 126 WTF::Bind(&PaymentManager::OnGetManifest, WrapPersistent(this),
127 WrapPersistent(resolver)))); 127 WrapPersistent(resolver))));
128 128
129 return promise; 129 return promise;
130 } 130 }
131 131
132 PaymentInstruments* PaymentManager::instruments() { 132 PaymentInstruments* PaymentManager::instruments() {
133 if (!instruments_) 133 if (!instruments_)
134 instruments_ = new PaymentInstruments(); 134 instruments_ = new PaymentInstruments(manager_);
135 return instruments_; 135 return instruments_;
136 } 136 }
137 137
138 DEFINE_TRACE(PaymentManager) { 138 DEFINE_TRACE(PaymentManager) {
139 visitor->Trace(registration_); 139 visitor->Trace(registration_);
140 visitor->Trace(instruments_); 140 visitor->Trace(instruments_);
141 } 141 }
142 142
143 PaymentManager::PaymentManager(ServiceWorkerRegistration* registration) 143 PaymentManager::PaymentManager(ServiceWorkerRegistration* registration)
144 : registration_(registration), instruments_(nullptr) { 144 : registration_(registration), instruments_(nullptr) {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 "No payment app manifest associated with the service worker.")); 198 "No payment app manifest associated with the service worker."));
199 break; 199 break;
200 } 200 }
201 } 201 }
202 202
203 void PaymentManager::OnServiceConnectionError() { 203 void PaymentManager::OnServiceConnectionError() {
204 manager_.reset(); 204 manager_.reset();
205 } 205 }
206 206
207 } // namespace blink 207 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/payments/PaymentManager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698