Commit a6856b26 authored by Leon Han's avatar Leon Han Committed by Commit Bot

[OnionSoup] Reduce usages of blink::WebServiceWorkerRegistration

Currently some modules (push_messaging, background_fetch etc.) are
calling blink::SWRegistration::WebRegistration() to get a pointer to
blink::WebSWRegistration to continue their work there.
However, they use that blink::WebSWRegistration just to retrieve the
service worker registration id, i.e. what they really want is not
blink::WebSWRegistration, but just the registration id.

So, this CL removes blink::SWRegistration::WebRegistration() and
provides a new function blink::SWRegistration::RegistrationId() for
those users instead.

This CL is in preparation for https://crrev.com/c/1275300 which plans to
merge content::WebSWRegistrationImpl into blink::SWRegistration and
remove the public interface blink::WebSWRegistration completely.

BUG=789857,879019

Change-Id: Iafb245ec6f978dfaa294f58ee800d80c5ba60fac
Reviewed-on: https://chromium-review.googlesource.com/c/1275298
Commit-Queue: Leon Han <leon.han@intel.com>
Reviewed-by: default avatarVictor Costan <pwnall@chromium.org>
Reviewed-by: default avatarPeter Beverloo <peter@chromium.org>
Reviewed-by: default avatarIan Clelland <iclelland@chromium.org>
Reviewed-by: default avatarMakoto Shimazu <shimazu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599093}
parent cb88d559
......@@ -15,13 +15,11 @@
#include "content/public/common/service_names.mojom.h"
#include "content/renderer/push_messaging/push_provider.h"
#include "content/renderer/render_frame_impl.h"
#include "content/renderer/service_worker/web_service_worker_registration_impl.h"
#include "services/service_manager/public/cpp/connector.h"
#include "third_party/blink/public/mojom/manifest/manifest_manager.mojom.h"
#include "third_party/blink/public/platform/modules/push_messaging/web_push_error.h"
#include "third_party/blink/public/platform/modules/push_messaging/web_push_subscription.h"
#include "third_party/blink/public/platform/modules/push_messaging/web_push_subscription_options.h"
#include "third_party/blink/public/platform/modules/service_worker/web_service_worker_registration.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/public/web/web_console_message.h"
#include "third_party/blink/public/web/web_local_frame.h"
......@@ -45,11 +43,10 @@ void PushMessagingClient::OnDestruct() {
}
void PushMessagingClient::Subscribe(
blink::WebServiceWorkerRegistration* service_worker_registration,
int64_t service_worker_registration_id,
const blink::WebPushSubscriptionOptions& options,
bool user_gesture,
std::unique_ptr<blink::WebPushSubscriptionCallbacks> callbacks) {
DCHECK(service_worker_registration);
DCHECK(callbacks);
// If a developer provided an application server key in |options|, skip
......@@ -59,7 +56,7 @@ void PushMessagingClient::Subscribe(
->GetManifestManager()
.RequestManifest(base::BindOnce(&PushMessagingClient::DidGetManifest,
base::Unretained(this),
service_worker_registration, options,
service_worker_registration_id, options,
user_gesture, std::move(callbacks)));
} else {
PushSubscriptionOptions content_options;
......@@ -67,13 +64,13 @@ void PushMessagingClient::Subscribe(
// Just treat the server key as a string of bytes and pass it to the push
// service.
content_options.sender_info = options.application_server_key.Latin1();
DoSubscribe(service_worker_registration, content_options, user_gesture,
DoSubscribe(service_worker_registration_id, content_options, user_gesture,
std::move(callbacks));
}
}
void PushMessagingClient::DidGetManifest(
blink::WebServiceWorkerRegistration* service_worker_registration,
int64_t service_worker_registration_id,
const blink::WebPushSubscriptionOptions& options,
bool user_gesture,
std::unique_ptr<blink::WebPushSubscriptionCallbacks> callbacks,
......@@ -95,20 +92,15 @@ void PushMessagingClient::DidGetManifest(
base::UTF16ToUTF8(manifest.gcm_sender_id.string());
}
DoSubscribe(service_worker_registration, content_options, user_gesture,
DoSubscribe(service_worker_registration_id, content_options, user_gesture,
std::move(callbacks));
}
void PushMessagingClient::DoSubscribe(
blink::WebServiceWorkerRegistration* service_worker_registration,
int64_t service_worker_registration_id,
const PushSubscriptionOptions& options,
bool user_gesture,
std::unique_ptr<blink::WebPushSubscriptionCallbacks> callbacks) {
int64_t service_worker_registration_id =
static_cast<WebServiceWorkerRegistrationImpl*>(
service_worker_registration)
->RegistrationId();
if (options.sender_info.empty()) {
DidSubscribe(std::move(callbacks),
mojom::PushRegistrationStatus::NO_SENDER_ID, base::nullopt,
......
......@@ -44,13 +44,13 @@ class PushMessagingClient : public RenderFrameObserver,
// WebPushClient implementation.
void Subscribe(
blink::WebServiceWorkerRegistration* service_worker_registration,
int64_t service_worker_registration_id,
const blink::WebPushSubscriptionOptions& options,
bool user_gesture,
std::unique_ptr<blink::WebPushSubscriptionCallbacks> callbacks) override;
void DidGetManifest(
blink::WebServiceWorkerRegistration* service_worker_registration,
int64_t service_worker_registration_id,
const blink::WebPushSubscriptionOptions& options,
bool user_gesture,
std::unique_ptr<blink::WebPushSubscriptionCallbacks> callbacks,
......@@ -58,7 +58,7 @@ class PushMessagingClient : public RenderFrameObserver,
const blink::Manifest& manifest);
void DoSubscribe(
blink::WebServiceWorkerRegistration* service_worker_registration,
int64_t service_worker_registration_id,
const PushSubscriptionOptions& options,
bool user_gesture,
std::unique_ptr<blink::WebPushSubscriptionCallbacks> callbacks);
......
......@@ -15,7 +15,6 @@
#include "content/public/common/push_messaging_status.mojom.h"
#include "content/public/common/push_subscription_options.h"
#include "content/public/common/service_names.mojom.h"
#include "content/renderer/service_worker/web_service_worker_registration_impl.h"
#include "services/service_manager/public/cpp/connector.h"
#include "third_party/blink/public/platform/modules/push_messaging/web_push_subscription.h"
#include "third_party/blink/public/platform/modules/push_messaging/web_push_subscription_options.h"
......@@ -87,15 +86,6 @@ const char* PushRegistrationStatusToString(
return "";
}
// Returns the id of the given |service_worker_registration|, which
// is only available on the implementation of the interface.
int64_t GetServiceWorkerRegistrationId(
blink::WebServiceWorkerRegistration* service_worker_registration) {
return static_cast<WebServiceWorkerRegistrationImpl*>(
service_worker_registration)
->RegistrationId();
}
} // namespace
blink::WebPushError PushRegistrationStatusToWebPushError(
......@@ -180,15 +170,12 @@ void PushProvider::WillStopCurrentWorkerThread() {
}
void PushProvider::Subscribe(
blink::WebServiceWorkerRegistration* service_worker_registration,
int64_t service_worker_registration_id,
const blink::WebPushSubscriptionOptions& options,
bool user_gesture,
std::unique_ptr<blink::WebPushSubscriptionCallbacks> callbacks) {
DCHECK(service_worker_registration);
DCHECK(callbacks);
int64_t service_worker_registration_id =
GetServiceWorkerRegistrationId(service_worker_registration);
PushSubscriptionOptions content_options;
content_options.user_visible_only = options.user_visible_only;
......@@ -233,14 +220,10 @@ void PushProvider::DidSubscribe(
}
void PushProvider::Unsubscribe(
blink::WebServiceWorkerRegistration* service_worker_registration,
int64_t service_worker_registration_id,
std::unique_ptr<blink::WebPushUnsubscribeCallbacks> callbacks) {
DCHECK(service_worker_registration);
DCHECK(callbacks);
int64_t service_worker_registration_id =
GetServiceWorkerRegistrationId(service_worker_registration);
push_messaging_manager_->Unsubscribe(
service_worker_registration_id,
// Safe to use base::Unretained because |push_messaging_manager_ |is owned
......@@ -266,14 +249,10 @@ void PushProvider::DidUnsubscribe(
}
void PushProvider::GetSubscription(
blink::WebServiceWorkerRegistration* service_worker_registration,
int64_t service_worker_registration_id,
std::unique_ptr<blink::WebPushSubscriptionCallbacks> callbacks) {
DCHECK(service_worker_registration);
DCHECK(callbacks);
int64_t service_worker_registration_id =
GetServiceWorkerRegistrationId(service_worker_registration);
push_messaging_manager_->GetSubscription(
service_worker_registration_id,
// Safe to use base::Unretained because |push_messaging_manager_ |is owned
......
......@@ -50,15 +50,15 @@ class PushProvider : public blink::WebPushProvider,
// blink::WebPushProvider implementation.
void Subscribe(
blink::WebServiceWorkerRegistration* service_worker_registration,
int64_t service_worker_registration_id,
const blink::WebPushSubscriptionOptions& options,
bool user_gesture,
std::unique_ptr<blink::WebPushSubscriptionCallbacks> callbacks) override;
void Unsubscribe(
blink::WebServiceWorkerRegistration* service_worker_registration,
int64_t service_worker_registration_id,
std::unique_ptr<blink::WebPushUnsubscribeCallbacks> callbacks) override;
void GetSubscription(
blink::WebServiceWorkerRegistration* service_worker_registration,
int64_t service_worker_registration_id,
std::unique_ptr<blink::WebPushSubscriptionCallbacks> callbacks) override;
private:
......
......@@ -12,16 +12,14 @@
namespace blink {
class WebServiceWorkerRegistration;
struct WebPushSubscriptionOptions;
class WebPushClient {
public:
virtual ~WebPushClient() = default;
// Ownership of the WebServiceWorkerRegistration is not transferred.
// Ownership of the callbacks is transferred to the client.
virtual void Subscribe(WebServiceWorkerRegistration*,
virtual void Subscribe(int64_t service_worker_registration_id,
const WebPushSubscriptionOptions&,
bool user_gesture,
std::unique_ptr<WebPushSubscriptionCallbacks>) = 0;
......
......@@ -12,7 +12,6 @@
namespace blink {
class WebServiceWorkerRegistration;
struct WebPushError;
struct WebPushSubscriptionOptions;
......@@ -25,21 +24,18 @@ class WebPushProvider {
virtual ~WebPushProvider() = default;
// Takes ownership of the WebPushSubscriptionCallbacks.
// Does not take ownership of the WebServiceWorkerRegistration.
virtual void Subscribe(WebServiceWorkerRegistration*,
virtual void Subscribe(int64_t service_worker_registration_id,
const WebPushSubscriptionOptions&,
bool user_gesture,
std::unique_ptr<WebPushSubscriptionCallbacks>) = 0;
// Takes ownership of the WebPushSubscriptionCallbacks.
// Does not take ownership of the WebServiceWorkerRegistration.
virtual void GetSubscription(
WebServiceWorkerRegistration*,
int64_t service_worker_registration_id,
std::unique_ptr<WebPushSubscriptionCallbacks>) = 0;
// Takes ownership if the WebPushUnsubscribeCallbacks.
// Does not take ownership of the WebServiceWorkerRegistration.
virtual void Unsubscribe(WebServiceWorkerRegistration*,
virtual void Unsubscribe(int64_t service_worker_registration_id,
std::unique_ptr<WebPushUnsubscribeCallbacks>) = 0;
};
......
......@@ -6,7 +6,6 @@
#include <utility>
#include "services/service_manager/public/cpp/interface_provider.h"
#include "third_party/blink/public/platform/modules/service_worker/web_service_worker_registration.h"
#include "third_party/blink/public/platform/modules/service_worker/web_service_worker_request.h"
#include "third_party/blink/renderer/modules/background_fetch/background_fetch_options.h"
#include "third_party/blink/renderer/modules/background_fetch/background_fetch_registration.h"
......@@ -54,9 +53,9 @@ void BackgroundFetchBridge::MatchRequests(
bool match_all,
mojom::blink::BackgroundFetchService::MatchRequestsCallback callback) {
GetService()->MatchRequests(
GetSupplementable()->WebRegistration()->RegistrationId(), developer_id,
unique_id, std::move(request_to_match), std::move(cache_query_params),
match_all, std::move(callback));
GetSupplementable()->RegistrationId(), developer_id, unique_id,
std::move(request_to_match), std::move(cache_query_params), match_all,
std::move(callback));
}
void BackgroundFetchBridge::Fetch(
......@@ -67,8 +66,8 @@ void BackgroundFetchBridge::Fetch(
mojom::blink::BackgroundFetchUkmDataPtr ukm_data,
RegistrationCallback callback) {
GetService()->Fetch(
GetSupplementable()->WebRegistration()->RegistrationId(), developer_id,
std::move(requests), std::move(options), icon, std::move(ukm_data),
GetSupplementable()->RegistrationId(), developer_id, std::move(requests),
std::move(options), icon, std::move(ukm_data),
WTF::Bind(&BackgroundFetchBridge::DidGetRegistration,
WrapPersistent(this), WTF::Passed(std::move(callback))));
}
......@@ -76,8 +75,8 @@ void BackgroundFetchBridge::Fetch(
void BackgroundFetchBridge::Abort(const String& developer_id,
const String& unique_id,
AbortCallback callback) {
GetService()->Abort(GetSupplementable()->WebRegistration()->RegistrationId(),
developer_id, unique_id, std::move(callback));
GetService()->Abort(GetSupplementable()->RegistrationId(), developer_id,
unique_id, std::move(callback));
}
void BackgroundFetchBridge::UpdateUI(const String& developer_id,
......@@ -91,15 +90,14 @@ void BackgroundFetchBridge::UpdateUI(const String& developer_id,
return;
}
GetService()->UpdateUI(
GetSupplementable()->WebRegistration()->RegistrationId(), developer_id,
unique_id, title, icon, std::move(callback));
GetService()->UpdateUI(GetSupplementable()->RegistrationId(), developer_id,
unique_id, title, icon, std::move(callback));
}
void BackgroundFetchBridge::GetRegistration(const String& developer_id,
RegistrationCallback callback) {
GetService()->GetRegistration(
GetSupplementable()->WebRegistration()->RegistrationId(), developer_id,
GetSupplementable()->RegistrationId(), developer_id,
WTF::Bind(&BackgroundFetchBridge::DidGetRegistration,
WrapPersistent(this), WTF::Passed(std::move(callback))));
}
......@@ -121,9 +119,8 @@ void BackgroundFetchBridge::DidGetRegistration(
}
void BackgroundFetchBridge::GetDeveloperIds(GetDeveloperIdsCallback callback) {
GetService()->GetDeveloperIds(
GetSupplementable()->WebRegistration()->RegistrationId(),
std::move(callback));
GetService()->GetDeveloperIds(GetSupplementable()->RegistrationId(),
std::move(callback));
}
void BackgroundFetchBridge::AddRegistrationObserver(
......
......@@ -44,8 +44,7 @@ ScriptPromise SyncManager::registerFunction(ScriptState* script_state,
blink::mojom::BackgroundSyncNetworkState::ONLINE;
GetBackgroundSyncServicePtr()->Register(
std::move(sync_registration),
registration_->WebRegistration()->RegistrationId(),
std::move(sync_registration), registration_->RegistrationId(),
WTF::Bind(SyncManager::RegisterCallback, WrapPersistent(resolver)));
return promise;
......@@ -56,7 +55,7 @@ ScriptPromise SyncManager::getTags(ScriptState* script_state) {
ScriptPromise promise = resolver->Promise();
GetBackgroundSyncServicePtr()->GetRegistrations(
registration_->WebRegistration()->RegistrationId(),
registration_->RegistrationId(),
WTF::Bind(&SyncManager::GetRegistrationsCallback,
WrapPersistent(resolver)));
......
......@@ -348,7 +348,7 @@ ScriptPromise CookieStore::subscribeToChanges(
ScriptPromiseResolver* resolver = ScriptPromiseResolver::Create(script_state);
int64_t service_worker_registration_id =
scope->registration()->WebRegistration()->RegistrationId();
scope->registration()->RegistrationId();
subscription_backend_->AppendSubscriptions(
service_worker_registration_id, std::move(backend_subscriptions),
WTF::Bind(&CookieStore::OnSubscribeToCookieChangesResult,
......@@ -374,7 +374,7 @@ ScriptPromise CookieStore::getChangeSubscriptions(
ServiceWorkerGlobalScope* scope =
ToServiceWorkerGlobalScope(GetExecutionContext());
int64_t service_worker_registration_id =
scope->registration()->WebRegistration()->RegistrationId();
scope->registration()->RegistrationId();
subscription_backend_->GetSubscriptions(
service_worker_registration_id,
WTF::Bind(&CookieStore::OnGetCookieChangeSubscriptionResult,
......
......@@ -129,7 +129,7 @@ void NotificationManager::CloseNonPersistentNotification(const String& token) {
}
void NotificationManager::DisplayPersistentNotification(
blink::WebServiceWorkerRegistration* service_worker_registration,
int64_t service_worker_registration_id,
mojom::blink::NotificationDataPtr notification_data,
mojom::blink::NotificationResourcesPtr notification_resources,
ScriptPromiseResolver* resolver) {
......@@ -165,8 +165,8 @@ void NotificationManager::DisplayPersistentNotification(
}
GetNotificationService()->DisplayPersistentNotification(
service_worker_registration->RegistrationId(),
std::move(notification_data), std::move(notification_resources),
service_worker_registration_id, std::move(notification_data),
std::move(notification_resources),
WTF::Bind(&NotificationManager::DidDisplayPersistentNotification,
WrapPersistent(this), WrapPersistent(resolver)));
}
......@@ -193,11 +193,11 @@ void NotificationManager::ClosePersistentNotification(
}
void NotificationManager::GetNotifications(
WebServiceWorkerRegistration* service_worker_registration,
int64_t service_worker_registration_id,
const WebString& filter_tag,
ScriptPromiseResolver* resolver) {
GetNotificationService()->GetNotifications(
service_worker_registration->RegistrationId(), filter_tag,
service_worker_registration_id, filter_tag,
WTF::Bind(&NotificationManager::DidGetNotifications, WrapPersistent(this),
WrapPersistent(resolver)));
}
......
......@@ -18,7 +18,6 @@ namespace blink {
class ScriptPromise;
class ScriptPromiseResolver;
class ScriptState;
class WebServiceWorkerRegistration;
// The notification manager, unique to the execution context, is responsible for
// connecting and communicating with the Mojo notification service.
......@@ -61,7 +60,7 @@ class NotificationManager final
// Shows a notification from a service worker.
void DisplayPersistentNotification(
blink::WebServiceWorkerRegistration* service_worker_registration,
int64_t service_worker_registration_id,
mojom::blink::NotificationDataPtr notification_data,
mojom::blink::NotificationResourcesPtr notification_resources,
ScriptPromiseResolver* resolver);
......@@ -72,10 +71,9 @@ class NotificationManager final
// Asynchronously gets the persistent notifications belonging to the Service
// Worker Registration. If |filter_tag| is not an empty string, only the
// notification with the given tag will be considered.
void GetNotifications(
WebServiceWorkerRegistration* service_worker_registration,
const WebString& filter_tag,
ScriptPromiseResolver* resolver);
void GetNotifications(int64_t service_worker_registration_id,
const WebString& filter_tag,
ScriptPromiseResolver* resolver);
void Trace(blink::Visitor* visitor) override;
......
......@@ -87,7 +87,7 @@ ScriptPromise ServiceWorkerRegistrationNotifications::getNotifications(
ExecutionContext* execution_context = ExecutionContext::From(script_state);
NotificationManager::From(execution_context)
->GetNotifications(registration.WebRegistration(), options.tag(),
->GetNotifications(registration.RegistrationId(), options.tag(),
WrapPersistent(resolver));
return promise;
}
......@@ -144,7 +144,7 @@ void ServiceWorkerRegistrationNotifications::DidLoadResources(
DCHECK(loaders_.Contains(loader));
NotificationManager::From(GetExecutionContext())
->DisplayPersistentNotification(registration_->WebRegistration(),
->DisplayPersistentNotification(registration_->RegistrationId(),
std::move(data), loader->GetResources(),
WrapPersistent(resolver));
loaders_.erase(loader);
......
......@@ -79,13 +79,13 @@ ScriptPromise PushManager::subscribe(ScriptState* script_state,
DOMException::Create(DOMExceptionCode::kInvalidStateError,
"Document is detached from window."));
PushController::ClientFrom(frame).Subscribe(
registration_->WebRegistration(), web_options,
registration_->RegistrationId(), web_options,
LocalFrame::HasTransientUserActivation(frame,
true /* check_if_main_thread */),
std::make_unique<PushSubscriptionCallbacks>(resolver, registration_));
} else {
PushProvider()->Subscribe(
registration_->WebRegistration(), web_options,
registration_->RegistrationId(), web_options,
LocalFrame::HasTransientUserActivation(nullptr,
true /* check_if_main_thread */),
std::make_unique<PushSubscriptionCallbacks>(resolver, registration_));
......@@ -99,7 +99,7 @@ ScriptPromise PushManager::getSubscription(ScriptState* script_state) {
ScriptPromise promise = resolver->Promise();
PushProvider()->GetSubscription(
registration_->WebRegistration(),
registration_->RegistrationId(),
std::make_unique<PushSubscriptionCallbacks>(resolver, registration_));
return promise;
}
......
......@@ -98,7 +98,7 @@ ScriptPromise PushSubscription::unsubscribe(ScriptState* script_state) {
DCHECK(web_push_provider);
web_push_provider->Unsubscribe(
service_worker_registration_->WebRegistration(),
service_worker_registration_->RegistrationId(),
std::make_unique<CallbackPromiseAdapter<bool, PushError>>(resolver));
return promise;
}
......
......@@ -36,7 +36,7 @@ ScriptPromise NavigationPreloadManager::setHeaderValue(
ScriptPromiseResolver* resolver = ScriptPromiseResolver::Create(script_state);
ScriptPromise promise = resolver->Promise();
registration_->WebRegistration()->SetNavigationPreloadHeader(
registration_->SetNavigationPreloadHeader(
value, std::make_unique<SetNavigationPreloadHeaderCallbacks>(resolver));
return promise;
}
......@@ -44,7 +44,7 @@ ScriptPromise NavigationPreloadManager::setHeaderValue(
ScriptPromise NavigationPreloadManager::getState(ScriptState* script_state) {
ScriptPromiseResolver* resolver = ScriptPromiseResolver::Create(script_state);
ScriptPromise promise = resolver->Promise();
registration_->WebRegistration()->GetNavigationPreloadState(
registration_->GetNavigationPreloadState(
std::make_unique<GetNavigationPreloadStateCallbacks>(resolver));
return promise;
}
......@@ -57,7 +57,7 @@ ScriptPromise NavigationPreloadManager::SetEnabled(bool enable,
ScriptState* script_state) {
ScriptPromiseResolver* resolver = ScriptPromiseResolver::Create(script_state);
ScriptPromise promise = resolver->Promise();
registration_->WebRegistration()->EnableNavigationPreload(
registration_->EnableNavigationPreload(
enable, std::make_unique<EnableNavigationPreloadCallbacks>(resolver));
return promise;
}
......
......@@ -79,6 +79,10 @@ NavigationPreloadManager* ServiceWorkerRegistration::navigationPreload() {
return navigation_preload_;
}
int64_t ServiceWorkerRegistration::RegistrationId() const {
return handle_->Registration()->RegistrationId();
}
String ServiceWorkerRegistration::scope() const {
return handle_->Registration()->Scope().GetString();
}
......@@ -96,6 +100,31 @@ String ServiceWorkerRegistration::updateViaCache() const {
return "";
}
void ServiceWorkerRegistration::EnableNavigationPreload(
bool enable,
std::unique_ptr<
WebServiceWorkerRegistration::WebEnableNavigationPreloadCallbacks>
callbacks) {
handle_->Registration()->EnableNavigationPreload(enable,
std::move(callbacks));
}
void ServiceWorkerRegistration::GetNavigationPreloadState(
std::unique_ptr<
WebServiceWorkerRegistration::WebGetNavigationPreloadStateCallbacks>
callbacks) {
handle_->Registration()->GetNavigationPreloadState(std::move(callbacks));
}
void ServiceWorkerRegistration::SetNavigationPreloadHeader(
const WebString& value,
std::unique_ptr<
WebServiceWorkerRegistration::WebSetNavigationPreloadHeaderCallbacks>
callbacks) {
handle_->Registration()->SetNavigationPreloadHeader(value,
std::move(callbacks));
}
ScriptPromise ServiceWorkerRegistration::update(ScriptState* script_state) {
if (!GetExecutionContext()) {
return ScriptPromise::RejectWithDOMException(
......
......@@ -73,9 +73,19 @@ class ServiceWorkerRegistration final
String scope() const;
String updateViaCache() const;
WebServiceWorkerRegistration* WebRegistration() {
return handle_->Registration();
}
int64_t RegistrationId() const;
void EnableNavigationPreload(
bool enable,
std::unique_ptr<
WebServiceWorkerRegistration::WebEnableNavigationPreloadCallbacks>);
void GetNavigationPreloadState(
std::unique_ptr<
WebServiceWorkerRegistration::WebGetNavigationPreloadStateCallbacks>);
void SetNavigationPreloadHeader(
const WebString& value,
std::unique_ptr<WebServiceWorkerRegistration::
WebSetNavigationPreloadHeaderCallbacks>);
ScriptPromise update(ScriptState*);
ScriptPromise unregister(ScriptState*);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment