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

Side by Side Diff: third_party/WebKit/Source/modules/battery/BatteryDispatcher.cpp

Issue 2196843003: Blink ServiceRegistry -> InterfaceProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 4 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/battery/BatteryDispatcher.h" 5 #include "modules/battery/BatteryDispatcher.h"
6 6
7 #include "platform/mojo/MojoHelper.h" 7 #include "platform/mojo/MojoHelper.h"
8 #include "public/platform/InterfaceProvider.h"
8 #include "public/platform/Platform.h" 9 #include "public/platform/Platform.h"
9 #include "public/platform/ServiceRegistry.h"
10 #include "wtf/Assertions.h" 10 #include "wtf/Assertions.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 BatteryDispatcher& BatteryDispatcher::instance() 14 BatteryDispatcher& BatteryDispatcher::instance()
15 { 15 {
16 DEFINE_STATIC_LOCAL(BatteryDispatcher, batteryDispatcher, (new BatteryDispat cher)); 16 DEFINE_STATIC_LOCAL(BatteryDispatcher, batteryDispatcher, (new BatteryDispat cher));
17 return batteryDispatcher; 17 return batteryDispatcher;
18 } 18 }
19 19
(...skipping 23 matching lines...) Expand all
43 void BatteryDispatcher::updateBatteryStatus(const BatteryStatus& batteryStatus) 43 void BatteryDispatcher::updateBatteryStatus(const BatteryStatus& batteryStatus)
44 { 44 {
45 m_batteryStatus = batteryStatus; 45 m_batteryStatus = batteryStatus;
46 m_hasLatestData = true; 46 m_hasLatestData = true;
47 notifyControllers(); 47 notifyControllers();
48 } 48 }
49 49
50 void BatteryDispatcher::startListening() 50 void BatteryDispatcher::startListening()
51 { 51 {
52 DCHECK(!m_monitor.is_bound()); 52 DCHECK(!m_monitor.is_bound());
53 Platform::current()->serviceRegistry()->connectToRemoteService( 53 Platform::current()->interfaceProvider()->getInterface(mojo::GetProxy(&m_mon itor));
54 mojo::GetProxy(&m_monitor));
55 queryNextStatus(); 54 queryNextStatus();
56 } 55 }
57 56
58 void BatteryDispatcher::stopListening() 57 void BatteryDispatcher::stopListening()
59 { 58 {
60 m_monitor.reset(); 59 m_monitor.reset();
61 m_hasLatestData = false; 60 m_hasLatestData = false;
62 } 61 }
63 62
64 } // namespace blink 63 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698