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

Unified Diff: third_party/WebKit/Source/modules/time_zone_monitor/TimeZoneMonitorClient.cpp

Issue 2642113002: Worker: Reduce use of ExecutionContextTask in core/workers (Closed)
Patch Set: fix build failures Created 3 years, 11 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/time_zone_monitor/TimeZoneMonitorClient.cpp
diff --git a/third_party/WebKit/Source/modules/time_zone_monitor/TimeZoneMonitorClient.cpp b/third_party/WebKit/Source/modules/time_zone_monitor/TimeZoneMonitorClient.cpp
index a7c0ab459f76a265c2449eb88bb1ca621d0bd245..a383c046f6e6385e4672e13c154d4eb1e55b8b5e 100644
--- a/third_party/WebKit/Source/modules/time_zone_monitor/TimeZoneMonitorClient.cpp
+++ b/third_party/WebKit/Source/modules/time_zone_monitor/TimeZoneMonitorClient.cpp
@@ -7,9 +7,10 @@
#include "bindings/core/v8/V8Binding.h"
#include "bindings/core/v8/V8PerIsolateData.h"
#include "core/dom/ExecutionContext.h"
-#include "core/dom/ExecutionContextTask.h"
#include "core/workers/WorkerBackingThread.h"
+#include "core/workers/WorkerOrWorkletGlobalScope.h"
#include "core/workers/WorkerThread.h"
+#include "platform/CrossThreadFunctional.h"
#include "platform/ServiceConnector.h"
#include "public/platform/Platform.h"
#include "services/device/public/interfaces/constants.mojom-blink.h"
@@ -26,8 +27,9 @@ void NotifyTimezoneChangeToV8(v8::Isolate* isolate) {
v8::Date::DateTimeConfigurationChangeNotification(isolate);
}
-void NotifyTimezoneChangeOnWorkerThread(ExecutionContext* context) {
- NotifyTimezoneChangeToV8(toIsolate(context));
+void NotifyTimezoneChangeOnWorkerThread(WorkerThread* workerThread) {
+ DCHECK(workerThread->isCurrentThread());
+ NotifyTimezoneChangeToV8(toIsolate(workerThread->globalScope()));
}
} // namespace
@@ -68,8 +70,9 @@ void TimeZoneMonitorClient::OnTimeZoneChange(const String& timeZoneInfo) {
// among multiple WorkerThreads.
if (posted.contains(&thread->workerBackingThread()))
continue;
- thread->postTask(BLINK_FROM_HERE, createCrossThreadTask(
- &NotifyTimezoneChangeOnWorkerThread));
+ thread->postTask(BLINK_FROM_HERE,
+ crossThreadBind(&NotifyTimezoneChangeOnWorkerThread,
+ WTF::crossThreadUnretained(thread)));
posted.add(&thread->workerBackingThread());
}
}
« no previous file with comments | « third_party/WebKit/Source/core/workers/WorkletGlobalScope.h ('k') | third_party/WebKit/Source/web/WebSharedWorkerImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698