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

Unified Diff: third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp

Issue 2815313002: Reland of Move ScriptState::GetExecutionContext (Part 5) (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp
index a9b3218c85a749e97b3b42203c55db379da98c55..ec1a10d0dbd163bb6e2a3449296f45f78500ec8b 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp
+++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp
@@ -9,6 +9,7 @@
#include "bindings/core/v8/ScriptPromiseResolver.h"
#include "core/dom/DOMException.h"
#include "core/dom/ExceptionCode.h"
+#include "core/dom/ExecutionContext.h"
#include "core/page/PageVisibilityState.h"
#include "core/workers/WorkerGlobalScope.h"
#include "core/workers/WorkerLocation.h"
@@ -48,14 +49,14 @@
ScriptPromiseResolver* resolver = ScriptPromiseResolver::Create(script_state);
ScriptPromise promise = resolver->Promise();
- if (!script_state->GetExecutionContext()->IsWindowInteractionAllowed()) {
+ if (!ExecutionContext::From(script_state)->IsWindowInteractionAllowed()) {
resolver->Reject(DOMException::Create(kInvalidAccessError,
"Not allowed to focus a window."));
return promise;
}
- script_state->GetExecutionContext()->ConsumeWindowInteraction();
+ ExecutionContext::From(script_state)->ConsumeWindowInteraction();
- ServiceWorkerGlobalScopeClient::From(script_state->GetExecutionContext())
+ ServiceWorkerGlobalScopeClient::From(ExecutionContext::From(script_state))
->Focus(Uuid(),
WTF::MakeUnique<CallbackPromiseAdapter<ServiceWorkerWindowClient,
ServiceWorkerError>>(
@@ -67,7 +68,7 @@
const String& url) {
ScriptPromiseResolver* resolver = ScriptPromiseResolver::Create(script_state);
ScriptPromise promise = resolver->Promise();
- ExecutionContext* context = script_state->GetExecutionContext();
+ ExecutionContext* context = ExecutionContext::From(script_state);
KURL parsed_url = KURL(ToWorkerGlobalScope(context)->location()->Url(), url);
if (!parsed_url.IsValid() || parsed_url.ProtocolIsAbout()) {

Powered by Google App Engine
This is Rietveld 408576698