 Chromium Code Reviews
 Chromium Code Reviews Issue 619383002:
  Move PlatformEventDispatcher implementations to the Oilpan heap.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master
    
  
    Issue 619383002:
  Move PlatformEventDispatcher implementations to the Oilpan heap.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master| Index: Source/modules/device_light/DeviceLightDispatcher.cpp | 
| diff --git a/Source/modules/device_light/DeviceLightDispatcher.cpp b/Source/modules/device_light/DeviceLightDispatcher.cpp | 
| index d56a0a03d95d705c0a6e799d277596521f511f88..eda852be5a35daa151c0155443f6f2f5009d7737 100644 | 
| --- a/Source/modules/device_light/DeviceLightDispatcher.cpp | 
| +++ b/Source/modules/device_light/DeviceLightDispatcher.cpp | 
| @@ -12,8 +12,8 @@ namespace blink { | 
| DeviceLightDispatcher& DeviceLightDispatcher::instance() | 
| { | 
| - DEFINE_STATIC_LOCAL(DeviceLightDispatcher, deviceLightDispatcher, ()); | 
| - return deviceLightDispatcher; | 
| + DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<DeviceLightDispatcher>, deviceLightDispatcher, (adoptPtrWillBeNoop(new DeviceLightDispatcher()))); | 
| 
haraken
2014/10/03 13:18:17
I still don't understand why this isn't Persistent
 
sof
2014/10/03 13:33:58
Ouch, there should be no use of OwnPtr<> here. Fix
 
haraken
2014/10/03 14:15:07
Ideally we want to insert an assert to adoptPtr()
 | 
| + return *deviceLightDispatcher; | 
| } | 
| DeviceLightDispatcher::DeviceLightDispatcher() | 
| @@ -25,6 +25,11 @@ DeviceLightDispatcher::~DeviceLightDispatcher() | 
| { | 
| } | 
| +void DeviceLightDispatcher::trace(Visitor* visitor) | 
| +{ | 
| + PlatformEventDispatcher::trace(visitor); | 
| +} | 
| + | 
| void DeviceLightDispatcher::startListening() | 
| { | 
| Platform::current()->startListening(WebPlatformEventDeviceLight, this); |