OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 Apple Inc. All rights reserved. | 2 * Copyright 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) 2012 Samsung Electronics. All rights reserved. | 3 * Copyright (C) 2012 Samsung Electronics. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above copyright | 10 * * Redistributions in binary form must reproduce the above copyright |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 void DeviceSensorEventController::fireDeviceEvent(Timer<DeviceSensorEventControl
ler>* timer) | 50 void DeviceSensorEventController::fireDeviceEvent(Timer<DeviceSensorEventControl
ler>* timer) |
51 { | 51 { |
52 ASSERT_UNUSED(timer, timer == &m_timer); | 52 ASSERT_UNUSED(timer, timer == &m_timer); |
53 ASSERT(hasLastData()); | 53 ASSERT(hasLastData()); |
54 | 54 |
55 m_timer.stop(); | 55 m_timer.stop(); |
56 dispatchDeviceEvent(getLastEvent()); | 56 dispatchDeviceEvent(getLastEvent()); |
57 } | 57 } |
58 | 58 |
59 void DeviceSensorEventController::dispatchDeviceEvent(PassRefPtr<Event> prpEvent
) | 59 void DeviceSensorEventController::dispatchDeviceEvent(PassRefPtrWillBeRawPtr<Eve
nt> prpEvent) |
60 { | 60 { |
61 if (!m_document.domWindow() || m_document.activeDOMObjectsAreSuspended() ||
m_document.activeDOMObjectsAreStopped()) | 61 if (!m_document.domWindow() || m_document.activeDOMObjectsAreSuspended() ||
m_document.activeDOMObjectsAreStopped()) |
62 return; | 62 return; |
63 | 63 |
64 RefPtr<Event> event = prpEvent; | 64 RefPtrWillBeRawPtr<Event> event = prpEvent; |
65 m_document.domWindow()->dispatchEvent(event); | 65 m_document.domWindow()->dispatchEvent(event); |
66 | 66 |
67 if (m_needsCheckingNullEvents) { | 67 if (m_needsCheckingNullEvents) { |
68 if (isNullEvent(event.get())) | 68 if (isNullEvent(event.get())) |
69 stopUpdating(); | 69 stopUpdating(); |
70 else | 70 else |
71 m_needsCheckingNullEvents = false; | 71 m_needsCheckingNullEvents = false; |
72 } | 72 } |
73 } | 73 } |
74 | 74 |
(...skipping 28 matching lines...) Expand all Loading... |
103 if (!m_hasEventListener) | 103 if (!m_hasEventListener) |
104 return; | 104 return; |
105 | 105 |
106 if (page()->visibilityState() == PageVisibilityStateVisible) | 106 if (page()->visibilityState() == PageVisibilityStateVisible) |
107 startUpdating(); | 107 startUpdating(); |
108 else | 108 else |
109 stopUpdating(); | 109 stopUpdating(); |
110 } | 110 } |
111 | 111 |
112 } // namespace WebCore | 112 } // namespace WebCore |
OLD | NEW |