 Chromium Code Reviews
 Chromium Code Reviews Issue 775763007:
  Use event init dictionary in modules/device_light  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master
    
  
    Issue 775763007:
  Use event init dictionary in modules/device_light  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master| OLD | NEW | 
|---|---|
| 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/device_light/DeviceLightEvent.h" | 6 #include "modules/device_light/DeviceLightEvent.h" | 
| 7 | 7 | 
| 8 namespace blink { | 8 namespace blink { | 
| 9 | 9 | 
| 10 DeviceLightEvent::~DeviceLightEvent() | 10 DeviceLightEvent::~DeviceLightEvent() | 
| 11 { | 11 { | 
| 12 } | 12 } | 
| 13 | 13 | 
| 14 DeviceLightEvent::DeviceLightEvent() | 14 DeviceLightEvent::DeviceLightEvent() | 
| 15 : m_value(std::numeric_limits<double>::infinity()) | 15 : m_value(std::numeric_limits<double>::infinity()) | 
| 16 { | 16 { | 
| 17 } | 17 } | 
| 18 | 18 | 
| 19 DeviceLightEvent::DeviceLightEvent(const AtomicString& eventType, double value) | 19 DeviceLightEvent::DeviceLightEvent(const AtomicString& eventType, double value) | 
| 20 : Event(eventType, true, false) // The DeviceLightEvent bubbles but is not c ancelable. | 20 : Event(eventType, true, false) // The DeviceLightEvent bubbles but is not c ancelable. | 
| 21 , m_value(value) | 21 , m_value(value) | 
| 22 { | 22 { | 
| 23 } | 23 } | 
| 24 | 24 | 
| 25 DeviceLightEvent::DeviceLightEvent(const AtomicString& eventType, const DeviceLi ghtEventInit& initializer) | 25 DeviceLightEvent::DeviceLightEvent(const AtomicString& eventType, const DeviceLi ghtEventInit& initializer) | 
| 26 : Event(eventType, initializer) | 26 : Event(eventType, initializer) | 
| 27 , m_value(initializer.value) | 27 , m_value(std::numeric_limits<double>::infinity()) | 
| 
haraken
2014/12/03 04:31:06
Doesn't this change existing behavior? I guess the
 
bashi
2014/12/03 04:36:48
This CL changes "bubbles" behavior, but doesn't ch
 
haraken
2014/12/03 04:38:36
ah, makes sense. Thanks.
 | |
| 28 { | 28 { | 
| 29 if (initializer.hasValue()) | |
| 
timvolodine
2014/12/03 12:37:51
is this always false now?
 | |
| 30 m_value = initializer.value(); | |
| 
timvolodine
2014/12/03 12:37:51
can this be initialized directly in the member ini
 | |
| 29 } | 31 } | 
| 30 | 32 | 
| 31 const AtomicString& DeviceLightEvent::interfaceName() const | 33 const AtomicString& DeviceLightEvent::interfaceName() const | 
| 32 { | 34 { | 
| 33 return EventNames::DeviceLightEvent; | 35 return EventNames::DeviceLightEvent; | 
| 34 } | 36 } | 
| 35 | 37 | 
| 36 } // namespace blink | 38 } // namespace blink | 
| 37 | 39 | 
| 38 | 40 | 
| 39 | 41 | 
| 40 | 42 | 
| OLD | NEW |