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

Side by Side Diff: Source/modules/device_orientation/DeviceSensorEventController.cpp

Issue 189833009: Trace where timers were scheduled in Blink (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated 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 | Annotate | Revision Log
OLDNEW
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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 } 72 }
73 } 73 }
74 74
75 void DeviceSensorEventController::startUpdating() 75 void DeviceSensorEventController::startUpdating()
76 { 76 {
77 if (m_isActive) 77 if (m_isActive)
78 return; 78 return;
79 79
80 if (hasLastData() && !m_timer.isActive()) { 80 if (hasLastData() && !m_timer.isActive()) {
81 // Make sure to fire the device motion data as soon as possible. 81 // Make sure to fire the device motion data as soon as possible.
82 m_timer.startOneShot(0); 82 m_timer.startOneShot(0, FROM_HERE);
83 } 83 }
84 84
85 registerWithDispatcher(); 85 registerWithDispatcher();
86 m_isActive = true; 86 m_isActive = true;
87 } 87 }
88 88
89 void DeviceSensorEventController::stopUpdating() 89 void DeviceSensorEventController::stopUpdating()
90 { 90 {
91 if (!m_isActive) 91 if (!m_isActive)
92 return; 92 return;
(...skipping 10 matching lines...) Expand all
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
OLDNEW
« no previous file with comments | « Source/core/xml/XMLHttpRequestProgressEventThrottle.cpp ('k') | Source/modules/encryptedmedia/MediaKeySession.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698