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

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

Issue 2762303002: Enable transmitting Fetch Requests over Mojo (Closed)
Patch Set: Enable transmitting Fetch Requests over Mojo 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 | « content/common/typemaps.gni ('k') | third_party/WebKit/Source/platform/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(), 54 supplementable()->webRegistration()->registrationId(),
56 getSecurityOrigin(), tag, 55 getSecurityOrigin(), tag, std::move(requests),
57 mojom::blink::BackgroundFetchOptions::From(options), 56 mojom::blink::BackgroundFetchOptions::From(options),
58 convertToBaseCallback( 57 convertToBaseCallback(
59 WTF::bind(&BackgroundFetchBridge::didGetRegistration, 58 WTF::bind(&BackgroundFetchBridge::didGetRegistration,
60 wrapPersistent(this), WTF::passed(std::move(callback))))); 59 wrapPersistent(this), WTF::passed(std::move(callback)))));
61 } 60 }
62 61
63 void BackgroundFetchBridge::abort(const String& tag, 62 void BackgroundFetchBridge::abort(const String& tag,
64 std::unique_ptr<AbortCallback> callback) { 63 std::unique_ptr<AbortCallback> callback) {
65 getService()->Abort(supplementable()->webRegistration()->registrationId(), 64 getService()->Abort(supplementable()->webRegistration()->registrationId(),
66 getSecurityOrigin(), tag, 65 getSecurityOrigin(), tag,
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 113
115 mojom::blink::BackgroundFetchServicePtr& BackgroundFetchBridge::getService() { 114 mojom::blink::BackgroundFetchServicePtr& BackgroundFetchBridge::getService() {
116 if (!m_backgroundFetchService) { 115 if (!m_backgroundFetchService) {
117 Platform::current()->interfaceProvider()->getInterface( 116 Platform::current()->interfaceProvider()->getInterface(
118 mojo::MakeRequest(&m_backgroundFetchService)); 117 mojo::MakeRequest(&m_backgroundFetchService));
119 } 118 }
120 return m_backgroundFetchService; 119 return m_backgroundFetchService;
121 } 120 }
122 121
123 } // namespace blink 122 } // namespace blink
OLDNEW
« no previous file with comments | « content/common/typemaps.gni ('k') | third_party/WebKit/Source/platform/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698