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

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

Issue 2762663002: BackgroundFetchRegistration.abort() should return a Promise. (Closed)
Patch Set: Created 3 years, 9 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/BackgroundFetchedEvent.h" 5 #include "modules/background_fetch/BackgroundFetchedEvent.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 "core/dom/DOMException.h" 9 #include "core/dom/DOMException.h"
10 #include "modules/EventModulesNames.h" 10 #include "modules/EventModulesNames.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 } 49 }
50 50
51 void BackgroundFetchedEvent::didUpdateUI( 51 void BackgroundFetchedEvent::didUpdateUI(
52 ScriptPromiseResolver* resolver, 52 ScriptPromiseResolver* resolver,
53 mojom::blink::BackgroundFetchError error) { 53 mojom::blink::BackgroundFetchError error) {
54 switch (error) { 54 switch (error) {
55 case mojom::blink::BackgroundFetchError::NONE: 55 case mojom::blink::BackgroundFetchError::NONE:
56 resolver->resolve(); 56 resolver->resolve();
57 return; 57 return;
58 case mojom::blink::BackgroundFetchError::DUPLICATED_TAG: 58 case mojom::blink::BackgroundFetchError::DUPLICATED_TAG:
59 case mojom::blink::BackgroundFetchError::INVALID_TAG:
59 // Not applicable for this callback. 60 // Not applicable for this callback.
60 break; 61 break;
61 } 62 }
62 63
63 NOTREACHED(); 64 NOTREACHED();
64 } 65 }
65 66
66 const AtomicString& BackgroundFetchedEvent::interfaceName() const { 67 const AtomicString& BackgroundFetchedEvent::interfaceName() const {
67 return EventNames::BackgroundFetchedEvent; 68 return EventNames::BackgroundFetchedEvent;
68 } 69 }
69 70
70 DEFINE_TRACE(BackgroundFetchedEvent) { 71 DEFINE_TRACE(BackgroundFetchedEvent) {
71 visitor->trace(m_fetches); 72 visitor->trace(m_fetches);
72 visitor->trace(m_registration); 73 visitor->trace(m_registration);
73 BackgroundFetchEvent::trace(visitor); 74 BackgroundFetchEvent::trace(visitor);
74 } 75 }
75 76
76 } // namespace blink 77 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698