Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "webkit/child/webkitplatformsupport_impl.h" | 5 #include "webkit/child/webkitplatformsupport_impl.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 898 #else | 898 #else |
| 899 return noDecodedImageByteLimit; | 899 return noDecodedImageByteLimit; |
| 900 #endif | 900 #endif |
| 901 } | 901 } |
| 902 | 902 |
| 903 void WebKitPlatformSupportImpl::SuspendSharedTimer() { | 903 void WebKitPlatformSupportImpl::SuspendSharedTimer() { |
| 904 ++shared_timer_suspended_; | 904 ++shared_timer_suspended_; |
| 905 } | 905 } |
| 906 | 906 |
| 907 void WebKitPlatformSupportImpl::ResumeSharedTimer() { | 907 void WebKitPlatformSupportImpl::ResumeSharedTimer() { |
| 908 DCHECK(shared_timer_suspended_ > 0); | |
| 909 | |
|
jamesr
2014/03/07 05:46:26
nit: DCHECK_GT() gives a slightly better error mes
| |
| 908 // The shared timer may have fired or been adjusted while we were suspended. | 910 // The shared timer may have fired or been adjusted while we were suspended. |
| 909 if (--shared_timer_suspended_ == 0 && | 911 if (--shared_timer_suspended_ == 0 && |
| 910 (!shared_timer_.IsRunning() || | 912 (!shared_timer_.IsRunning() || |
| 911 shared_timer_fire_time_was_set_while_suspended_)) { | 913 shared_timer_fire_time_was_set_while_suspended_)) { |
| 912 shared_timer_fire_time_was_set_while_suspended_ = false; | 914 shared_timer_fire_time_was_set_while_suspended_ = false; |
| 913 setSharedTimerFireInterval( | 915 setSharedTimerFireInterval( |
| 914 shared_timer_fire_time_ - monotonicallyIncreasingTime()); | 916 shared_timer_fire_time_ - monotonicallyIncreasingTime()); |
| 915 } | 917 } |
| 916 } | 918 } |
| 917 | 919 |
| 918 } // namespace webkit_glue | 920 } // namespace webkit_glue |
| OLD | NEW |