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

Unified Diff: Source/modules/push_messaging/PushManager.cpp

Issue 297513008: Decrease call sites of ScriptState::current() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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
« no previous file with comments | « Source/modules/push_messaging/PushManager.h ('k') | Source/modules/push_messaging/PushManager.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/push_messaging/PushManager.cpp
diff --git a/Source/modules/push_messaging/PushManager.cpp b/Source/modules/push_messaging/PushManager.cpp
index 7cc7a97b34ee3c3e2b2d67c4787af713ca5fa330..ae888862bea6050fe8eeadfe38bb1bc67ea37424 100644
--- a/Source/modules/push_messaging/PushManager.cpp
+++ b/Source/modules/push_messaging/PushManager.cpp
@@ -28,12 +28,12 @@ PushManager::~PushManager()
{
}
-ScriptPromise PushManager::registerPushMessaging(ExecutionContext* context, const String& senderId)
+ScriptPromise PushManager::registerPushMessaging(ScriptState* scriptState, const String& senderId)
{
- ASSERT(context->isDocument());
- RefPtr<ScriptPromiseResolverWithContext> resolver = ScriptPromiseResolverWithContext::create(ScriptState::current(toIsolate(context)));
+ ASSERT(scriptState->executionContext()->isDocument());
+ RefPtr<ScriptPromiseResolverWithContext> resolver = ScriptPromiseResolverWithContext::create(scriptState);
ScriptPromise promise = resolver->promise();
- blink::WebPushClient* client = PushController::clientFrom(toDocument(context)->page());
+ blink::WebPushClient* client = PushController::clientFrom(toDocument(scriptState->executionContext())->page());
ASSERT(client);
client->registerPushMessaging(senderId, new CallbackPromiseAdapter<PushRegistration, PushError>(resolver));
return promise;
« no previous file with comments | « Source/modules/push_messaging/PushManager.h ('k') | Source/modules/push_messaging/PushManager.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698