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

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

Issue 1850413002: Improve DEFINE_STATIC_LOCAL()'s handling of Blink GCed objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address compilation failure Created 4 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 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/MojoHelper.h" 7 #include "platform/MojoHelper.h"
8 #include "public/platform/Platform.h" 8 #include "public/platform/Platform.h"
9 #include "wtf/Assertions.h" 9 #include "wtf/Assertions.h"
10 #include "wtf/PassOwnPtr.h" 10 #include "wtf/PassOwnPtr.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(Persistent<BatteryDispatcher>, batteryDispatcher, (new B atteryDispatcher())); 16 DEFINE_STATIC_LOCAL(BatteryDispatcher, batteryDispatcher, (new BatteryDispat cher));
17 return *batteryDispatcher; 17 return batteryDispatcher;
18 } 18 }
19 19
20 BatteryDispatcher::BatteryDispatcher() 20 BatteryDispatcher::BatteryDispatcher()
21 : m_hasLatestData(false) 21 : m_hasLatestData(false)
22 { 22 {
23 } 23 }
24 24
25 void BatteryDispatcher::queryNextStatus() 25 void BatteryDispatcher::queryNextStatus()
26 { 26 {
27 m_monitor->QueryNextStatus( 27 m_monitor->QueryNextStatus(
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 61
62 void BatteryDispatcher::stopListening() 62 void BatteryDispatcher::stopListening()
63 { 63 {
64 // m_monitor can be null during testing. 64 // m_monitor can be null during testing.
65 if (m_monitor) 65 if (m_monitor)
66 m_monitor.reset(); 66 m_monitor.reset();
67 m_hasLatestData = false; 67 m_hasLatestData = false;
68 } 68 }
69 69
70 } // namespace blink 70 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698