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

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

Issue 2762303002: Enable transmitting Fetch Requests over Mojo (Closed)
Patch Set: rebase 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/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/BackgroundFetchTypeConverters.h" 10 #include "modules/background_fetch/BackgroundFetchTypeConverters.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 ServiceWorkerRegistration& registration) 43 ServiceWorkerRegistration& registration)
44 : Supplement<ServiceWorkerRegistration>(registration) {} 44 : Supplement<ServiceWorkerRegistration>(registration) {}
45 45
46 BackgroundFetchBridge::~BackgroundFetchBridge() = default; 46 BackgroundFetchBridge::~BackgroundFetchBridge() = default;
47 47
48 void BackgroundFetchBridge::fetch( 48 void BackgroundFetchBridge::fetch(
49 const String& tag, 49 const String& tag,
50 Vector<WebServiceWorkerRequest> requests, 50 Vector<WebServiceWorkerRequest> requests,
51 const BackgroundFetchOptions& options, 51 const BackgroundFetchOptions& options,
52 std::unique_ptr<RegistrationCallback> callback) { 52 std::unique_ptr<RegistrationCallback> callback) {
53 // TODO(peter): Include |requests| in the Mojo call.
54 getService()->Fetch( 53 getService()->Fetch(
55 supplementable()->webRegistration()->registrationId(), tag, 54 supplementable()->webRegistration()->registrationId(), tag,
56 mojom::blink::BackgroundFetchOptions::From(options), 55 std::move(requests), mojom::blink::BackgroundFetchOptions::From(options),
57 convertToBaseCallback( 56 convertToBaseCallback(
58 WTF::bind(&BackgroundFetchBridge::didGetRegistration, 57 WTF::bind(&BackgroundFetchBridge::didGetRegistration,
59 wrapPersistent(this), WTF::passed(std::move(callback))))); 58 wrapPersistent(this), WTF::passed(std::move(callback)))));
60 } 59 }
61 60
62 void BackgroundFetchBridge::abort(const String& tag, 61 void BackgroundFetchBridge::abort(const String& tag,
63 std::unique_ptr<AbortCallback> callback) { 62 std::unique_ptr<AbortCallback> callback) {
64 getService()->Abort(supplementable()->webRegistration()->registrationId(), 63 getService()->Abort(supplementable()->webRegistration()->registrationId(),
65 tag, convertToBaseCallback(std::move(callback))); 64 tag, convertToBaseCallback(std::move(callback)));
66 } 65 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 105
107 mojom::blink::BackgroundFetchServicePtr& BackgroundFetchBridge::getService() { 106 mojom::blink::BackgroundFetchServicePtr& BackgroundFetchBridge::getService() {
108 if (!m_backgroundFetchService) { 107 if (!m_backgroundFetchService) {
109 Platform::current()->interfaceProvider()->getInterface( 108 Platform::current()->interfaceProvider()->getInterface(
110 mojo::MakeRequest(&m_backgroundFetchService)); 109 mojo::MakeRequest(&m_backgroundFetchService));
111 } 110 }
112 return m_backgroundFetchService; 111 return m_backgroundFetchService;
113 } 112 }
114 113
115 } // namespace blink 114 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698