OLD | NEW |
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/ExecutionContextTask.h" | 10 #include "core/dom/ExecutionContextTask.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 } | 30 } |
31 | 31 |
32 } // namespace | 32 } // namespace |
33 | 33 |
34 // static | 34 // static |
35 void TimeZoneMonitorClient::Init() { | 35 void TimeZoneMonitorClient::Init() { |
36 DEFINE_STATIC_LOCAL(TimeZoneMonitorClient, instance, ()); | 36 DEFINE_STATIC_LOCAL(TimeZoneMonitorClient, instance, ()); |
37 | 37 |
38 device::mojom::blink::TimeZoneMonitorPtr monitor; | 38 device::mojom::blink::TimeZoneMonitorPtr monitor; |
39 Platform::current()->interfaceProvider()->getInterface( | 39 Platform::current()->interfaceProvider()->getInterface( |
40 mojo::GetProxy(&monitor)); | 40 mojo::MakeRequest(&monitor)); |
41 monitor->AddClient(instance.m_binding.CreateInterfacePtrAndBind()); | 41 monitor->AddClient(instance.m_binding.CreateInterfacePtrAndBind()); |
42 } | 42 } |
43 | 43 |
44 TimeZoneMonitorClient::TimeZoneMonitorClient() : m_binding(this) { | 44 TimeZoneMonitorClient::TimeZoneMonitorClient() : m_binding(this) { |
45 DCHECK(isMainThread()); | 45 DCHECK(isMainThread()); |
46 } | 46 } |
47 | 47 |
48 TimeZoneMonitorClient::~TimeZoneMonitorClient() {} | 48 TimeZoneMonitorClient::~TimeZoneMonitorClient() {} |
49 | 49 |
50 void TimeZoneMonitorClient::OnTimeZoneChange(const String& timeZoneInfo) { | 50 void TimeZoneMonitorClient::OnTimeZoneChange(const String& timeZoneInfo) { |
(...skipping 16 matching lines...) Expand all Loading... |
67 // among multiple WorkerThreads. | 67 // among multiple WorkerThreads. |
68 if (posted.contains(&thread->workerBackingThread())) | 68 if (posted.contains(&thread->workerBackingThread())) |
69 continue; | 69 continue; |
70 thread->postTask(BLINK_FROM_HERE, createCrossThreadTask( | 70 thread->postTask(BLINK_FROM_HERE, createCrossThreadTask( |
71 &NotifyTimezoneChangeOnWorkerThread)); | 71 &NotifyTimezoneChangeOnWorkerThread)); |
72 posted.add(&thread->workerBackingThread()); | 72 posted.add(&thread->workerBackingThread()); |
73 } | 73 } |
74 } | 74 } |
75 | 75 |
76 } // namespace blink | 76 } // namespace blink |
OLD | NEW |