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

Side by Side Diff: third_party/WebKit/Source/modules/time_zone_monitor/TimeZoneMonitorClient.cpp

Issue 2806623004: Worker: Introduce per-global-scope task scheduler (Closed)
Patch Set: remove WorkerTaskRunners 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/time_zone_monitor/TimeZoneMonitorClient.h" 5 #include "modules/time_zone_monitor/TimeZoneMonitorClient.h"
6 6
7 #include "bindings/core/v8/V8Binding.h" 7 #include "bindings/core/v8/V8Binding.h"
8 #include "bindings/core/v8/V8PerIsolateData.h" 8 #include "bindings/core/v8/V8PerIsolateData.h"
9 #include "core/dom/ExecutionContext.h" 9 #include "core/dom/ExecutionContext.h"
10 #include "core/dom/TaskRunnerHelper.h"
10 #include "core/workers/WorkerBackingThread.h" 11 #include "core/workers/WorkerBackingThread.h"
11 #include "core/workers/WorkerOrWorkletGlobalScope.h" 12 #include "core/workers/WorkerOrWorkletGlobalScope.h"
12 #include "core/workers/WorkerThread.h" 13 #include "core/workers/WorkerThread.h"
13 #include "platform/CrossThreadFunctional.h" 14 #include "platform/CrossThreadFunctional.h"
14 #include "public/platform/Platform.h" 15 #include "public/platform/Platform.h"
15 #include "services/device/public/interfaces/constants.mojom-blink.h" 16 #include "services/device/public/interfaces/constants.mojom-blink.h"
16 #include "services/service_manager/public/cpp/connector.h" 17 #include "services/service_manager/public/cpp/connector.h"
17 #include "third_party/icu/source/i18n/unicode/timezone.h" 18 #include "third_party/icu/source/i18n/unicode/timezone.h"
18 #include "v8/include/v8.h" 19 #include "v8/include/v8.h"
19 20
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 NotifyTimezoneChangeToV8(V8PerIsolateData::MainThreadIsolate()); 64 NotifyTimezoneChangeToV8(V8PerIsolateData::MainThreadIsolate());
64 65
65 HashSet<WorkerThread*>& threads = WorkerThread::WorkerThreads(); 66 HashSet<WorkerThread*>& threads = WorkerThread::WorkerThreads();
66 HashSet<WorkerBackingThread*> posted; 67 HashSet<WorkerBackingThread*> posted;
67 for (WorkerThread* thread : threads) { 68 for (WorkerThread* thread : threads) {
68 // Ensure every WorkerBackingThread(holding one platform thread) only get 69 // Ensure every WorkerBackingThread(holding one platform thread) only get
69 // the task posted once, because one WorkerBackingThread could be shared 70 // the task posted once, because one WorkerBackingThread could be shared
70 // among multiple WorkerThreads. 71 // among multiple WorkerThreads.
71 if (posted.Contains(&thread->GetWorkerBackingThread())) 72 if (posted.Contains(&thread->GetWorkerBackingThread()))
72 continue; 73 continue;
73 thread->PostTask(BLINK_FROM_HERE, 74 TaskRunnerHelper::Get(TaskType::kUnthrottled, thread)
haraken 2017/04/13 07:03:36 Why kUnthrottled?
nhiroki 2017/04/13 08:23:50 Hm... this should be kUnspecedTimer. Replaced.
74 CrossThreadBind(&NotifyTimezoneChangeOnWorkerThread, 75 ->PostTask(BLINK_FROM_HERE,
75 WTF::CrossThreadUnretained(thread))); 76 CrossThreadBind(&NotifyTimezoneChangeOnWorkerThread,
77 WTF::CrossThreadUnretained(thread)));
76 posted.insert(&thread->GetWorkerBackingThread()); 78 posted.insert(&thread->GetWorkerBackingThread());
77 } 79 }
78 } 80 }
79 81
80 } // namespace blink 82 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698