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

Side by Side Diff: third_party/WebKit/Source/modules/background_fetch/BackgroundFetchManager.cpp

Issue 2777183002: Hook up the other Background Fetch Mojo methods with the system (Closed)
Patch Set: Hook up the other Background Fetch Mojo methods with the system 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
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/background_fetch/BackgroundFetchManager.h" 5 #include "modules/background_fetch/BackgroundFetchManager.h"
6 6
7 #include "bindings/core/v8/ScriptPromiseResolver.h" 7 #include "bindings/core/v8/ScriptPromiseResolver.h"
8 #include "bindings/core/v8/ScriptState.h" 8 #include "bindings/core/v8/ScriptState.h"
9 #include "bindings/core/v8/V8ThrowException.h" 9 #include "bindings/core/v8/V8ThrowException.h"
10 #include "bindings/modules/v8/RequestOrUSVString.h" 10 #include "bindings/modules/v8/RequestOrUSVString.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 169
170 return webRequests; 170 return webRequests;
171 } 171 }
172 172
173 void BackgroundFetchManager::didGetRegistration( 173 void BackgroundFetchManager::didGetRegistration(
174 ScriptPromiseResolver* resolver, 174 ScriptPromiseResolver* resolver,
175 mojom::blink::BackgroundFetchError error, 175 mojom::blink::BackgroundFetchError error,
176 BackgroundFetchRegistration* registration) { 176 BackgroundFetchRegistration* registration) {
177 switch (error) { 177 switch (error) {
178 case mojom::blink::BackgroundFetchError::NONE: 178 case mojom::blink::BackgroundFetchError::NONE:
179 case mojom::blink::BackgroundFetchError::INVALID_TAG:
179 resolver->resolve(registration); 180 resolver->resolve(registration);
180 return; 181 return;
181 case mojom::blink::BackgroundFetchError::DUPLICATED_TAG: 182 case mojom::blink::BackgroundFetchError::DUPLICATED_TAG:
182 case mojom::blink::BackgroundFetchError::INVALID_ARGUMENT: 183 case mojom::blink::BackgroundFetchError::INVALID_ARGUMENT:
183 case mojom::blink::BackgroundFetchError::INVALID_TAG:
184 // Not applicable for this callback. 184 // Not applicable for this callback.
185 break; 185 break;
186 } 186 }
187 187
188 NOTREACHED(); 188 NOTREACHED();
189 } 189 }
190 190
191 ScriptPromise BackgroundFetchManager::getTags(ScriptState* scriptState) { 191 ScriptPromise BackgroundFetchManager::getTags(ScriptState* scriptState) {
192 if (!m_registration->active()) { 192 if (!m_registration->active()) {
193 return ScriptPromise::reject( 193 return ScriptPromise::reject(
(...skipping 29 matching lines...) Expand all
223 223
224 NOTREACHED(); 224 NOTREACHED();
225 } 225 }
226 226
227 DEFINE_TRACE(BackgroundFetchManager) { 227 DEFINE_TRACE(BackgroundFetchManager) {
228 visitor->trace(m_registration); 228 visitor->trace(m_registration);
229 visitor->trace(m_bridge); 229 visitor->trace(m_bridge);
230 } 230 }
231 231
232 } // namespace blink 232 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698