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

Side by Side Diff: Source/modules/battery/NavigatorBattery.cpp

Issue 204063002: Oilpan: add transition types to Navigator and its supplements. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Adjust use of 'virtual' Created 6 years, 9 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 "config.h" 5 #include "config.h"
6 #include "modules/battery/NavigatorBattery.h" 6 #include "modules/battery/NavigatorBattery.h"
7 7
8 #include "core/frame/LocalFrame.h" 8 #include "core/frame/LocalFrame.h"
9 #include "modules/battery/BatteryManager.h" 9 #include "modules/battery/BatteryManager.h"
10 10
(...skipping 19 matching lines...) Expand all
30 return m_batteryManager.get(); 30 return m_batteryManager.get();
31 } 31 }
32 32
33 const char* NavigatorBattery::supplementName() 33 const char* NavigatorBattery::supplementName()
34 { 34 {
35 return "NavigatorBattery"; 35 return "NavigatorBattery";
36 } 36 }
37 37
38 NavigatorBattery& NavigatorBattery::from(Navigator& navigator) 38 NavigatorBattery& NavigatorBattery::from(Navigator& navigator)
39 { 39 {
40 NavigatorBattery* supplement = static_cast<NavigatorBattery*>(Supplement<Nav igator>::from(navigator, supplementName())); 40 NavigatorBattery* supplement = static_cast<NavigatorBattery*>(WillBeHeapSupp lement<Navigator>::from(navigator, supplementName()));
41 if (!supplement) { 41 if (!supplement) {
42 supplement = new NavigatorBattery(); 42 supplement = new NavigatorBattery();
43 provideTo(navigator, supplementName(), adoptPtr(supplement)); 43 provideTo(navigator, supplementName(), adoptPtrWillBeNoop(supplement));
44 } 44 }
45 return *supplement; 45 return *supplement;
46 } 46 }
47 47
48 void NavigatorBattery::trace(Visitor* visitor)
49 {
50 visitor->trace(m_batteryManager);
51 }
52
48 } // namespace WebCore 53 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/battery/NavigatorBattery.h ('k') | Source/modules/donottrack/NavigatorDoNotTrack.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698