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

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

Issue 2821443002: Revert of Move ScriptState::GetExecutionContext (Part 5) (Closed)
Patch Set: Revert 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 ec1a10d0dbd163bb6e2a3449296f45f78500ec8b..a9b3218c85a749e97b3b42203c55db379da98c55 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp
+++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp
@@ -9,7 +9,6 @@
#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"
@@ -49,14 +48,14 @@ ScriptPromise ServiceWorkerWindowClient::focus(ScriptState* script_state) {
ScriptPromiseResolver* resolver = ScriptPromiseResolver::Create(script_state);
ScriptPromise promise = resolver->Promise();
- if (!ExecutionContext::From(script_state)->IsWindowInteractionAllowed()) {
+ if (!script_state->GetExecutionContext()->IsWindowInteractionAllowed()) {
resolver->Reject(DOMException::Create(kInvalidAccessError,
"Not allowed to focus a window."));
return promise;
}
- ExecutionContext::From(script_state)->ConsumeWindowInteraction();
+ script_state->GetExecutionContext()->ConsumeWindowInteraction();
- ServiceWorkerGlobalScopeClient::From(ExecutionContext::From(script_state))
+ ServiceWorkerGlobalScopeClient::From(script_state->GetExecutionContext())
->Focus(Uuid(),
WTF::MakeUnique<CallbackPromiseAdapter<ServiceWorkerWindowClient,
ServiceWorkerError>>(
@@ -68,7 +67,7 @@ ScriptPromise ServiceWorkerWindowClient::navigate(ScriptState* script_state,
const String& url) {
ScriptPromiseResolver* resolver = ScriptPromiseResolver::Create(script_state);
ScriptPromise promise = resolver->Promise();
- ExecutionContext* context = ExecutionContext::From(script_state);
+ ExecutionContext* context = script_state->GetExecutionContext();
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