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 "content/child/blink_platform_impl.h" | 5 #include "content/child/blink_platform_impl.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
895 #else | 895 #else |
896 return noDecodedImageByteLimit; | 896 return noDecodedImageByteLimit; |
897 #endif | 897 #endif |
898 } | 898 } |
899 | 899 |
900 void BlinkPlatformImpl::SuspendSharedTimer() { | 900 void BlinkPlatformImpl::SuspendSharedTimer() { |
901 ++shared_timer_suspended_; | 901 ++shared_timer_suspended_; |
902 } | 902 } |
903 | 903 |
904 void BlinkPlatformImpl::ResumeSharedTimer() { | 904 void BlinkPlatformImpl::ResumeSharedTimer() { |
| 905 DCHECK_GT(shared_timer_suspended_, 0); |
| 906 |
905 // The shared timer may have fired or been adjusted while we were suspended. | 907 // The shared timer may have fired or been adjusted while we were suspended. |
906 if (--shared_timer_suspended_ == 0 && | 908 if (--shared_timer_suspended_ == 0 && |
907 (!shared_timer_.IsRunning() || | 909 (!shared_timer_.IsRunning() || |
908 shared_timer_fire_time_was_set_while_suspended_)) { | 910 shared_timer_fire_time_was_set_while_suspended_)) { |
909 shared_timer_fire_time_was_set_while_suspended_ = false; | 911 shared_timer_fire_time_was_set_while_suspended_ = false; |
910 setSharedTimerFireInterval( | 912 setSharedTimerFireInterval( |
911 shared_timer_fire_time_ - monotonicallyIncreasingTime()); | 913 shared_timer_fire_time_ - monotonicallyIncreasingTime()); |
912 } | 914 } |
913 } | 915 } |
914 | 916 |
915 } // namespace content | 917 } // namespace content |
OLD | NEW |