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

Side by Side Diff: third_party/WebKit/Source/modules/background_fetch/BackgroundFetchBridge.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/BackgroundFetchBridge.h" 5 #include "modules/background_fetch/BackgroundFetchBridge.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include "modules/background_fetch/BackgroundFetchOptions.h" 8 #include "modules/background_fetch/BackgroundFetchOptions.h"
9 #include "modules/background_fetch/BackgroundFetchRegistration.h" 9 #include "modules/background_fetch/BackgroundFetchRegistration.h"
10 #include "modules/background_fetch/IconDefinition.h" 10 #include "modules/background_fetch/IconDefinition.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 const char* BackgroundFetchBridge::supplementName() { 61 const char* BackgroundFetchBridge::supplementName() {
62 return "BackgroundFetchBridge"; 62 return "BackgroundFetchBridge";
63 } 63 }
64 64
65 BackgroundFetchBridge::BackgroundFetchBridge( 65 BackgroundFetchBridge::BackgroundFetchBridge(
66 ServiceWorkerRegistration& registration) 66 ServiceWorkerRegistration& registration)
67 : Supplement<ServiceWorkerRegistration>(registration) {} 67 : Supplement<ServiceWorkerRegistration>(registration) {}
68 68
69 BackgroundFetchBridge::~BackgroundFetchBridge() = default; 69 BackgroundFetchBridge::~BackgroundFetchBridge() = default;
70 70
71 void BackgroundFetchBridge::abort(const String& tag) { 71 void BackgroundFetchBridge::abort(const String& tag,
72 std::unique_ptr<AbortCallback> callback) {
72 getService()->Abort(supplementable()->webRegistration()->registrationId(), 73 getService()->Abort(supplementable()->webRegistration()->registrationId(),
73 tag); 74 tag, convertToBaseCallback(std::move(callback)));
74 } 75 }
75 76
76 void BackgroundFetchBridge::updateUI( 77 void BackgroundFetchBridge::updateUI(
77 const String& tag, 78 const String& tag,
78 const String& title, 79 const String& title,
79 std::unique_ptr<UpdateUICallback> callback) { 80 std::unique_ptr<UpdateUICallback> callback) {
80 getService()->UpdateUI(supplementable()->webRegistration()->registrationId(), 81 getService()->UpdateUI(supplementable()->webRegistration()->registrationId(),
81 tag, title, 82 tag, title,
82 convertToBaseCallback(std::move(callback))); 83 convertToBaseCallback(std::move(callback)));
83 } 84 }
(...skipping 30 matching lines...) Expand all
114 115
115 mojom::blink::BackgroundFetchServicePtr& BackgroundFetchBridge::getService() { 116 mojom::blink::BackgroundFetchServicePtr& BackgroundFetchBridge::getService() {
116 if (!m_backgroundFetchService) { 117 if (!m_backgroundFetchService) {
117 Platform::current()->interfaceProvider()->getInterface( 118 Platform::current()->interfaceProvider()->getInterface(
118 mojo::MakeRequest(&m_backgroundFetchService)); 119 mojo::MakeRequest(&m_backgroundFetchService));
119 } 120 }
120 return m_backgroundFetchService; 121 return m_backgroundFetchService;
121 } 122 }
122 123
123 } // namespace blink 124 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698