| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/renderer/render_thread.h" | 5 #include "chrome/renderer/render_thread.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 897 | 897 |
| 898 WebRuntimeFeatures::enableTouch( | 898 WebRuntimeFeatures::enableTouch( |
| 899 command_line.HasSwitch(switches::kEnableTouch)); | 899 command_line.HasSwitch(switches::kEnableTouch)); |
| 900 } | 900 } |
| 901 | 901 |
| 902 void RenderThread::IdleHandler() { | 902 void RenderThread::IdleHandler() { |
| 903 #if (defined(OS_WIN) || defined(OS_LINUX)) && defined(USE_TCMALLOC) | 903 #if (defined(OS_WIN) || defined(OS_LINUX)) && defined(USE_TCMALLOC) |
| 904 MallocExtension::instance()->ReleaseFreeMemory(); | 904 MallocExtension::instance()->ReleaseFreeMemory(); |
| 905 #endif | 905 #endif |
| 906 | 906 |
| 907 LOG(INFO) << "RenderThread calling v8 IdleNotification for " << this; | |
| 908 v8::V8::IdleNotification(); | 907 v8::V8::IdleNotification(); |
| 909 | 908 |
| 910 // Schedule next invocation. | 909 // Schedule next invocation. |
| 911 // Dampen the delay using the algorithm: | 910 // Dampen the delay using the algorithm: |
| 912 // delay = delay + 1 / (delay + 2) | 911 // delay = delay + 1 / (delay + 2) |
| 913 // Using floor(delay) has a dampening effect such as: | 912 // Using floor(delay) has a dampening effect such as: |
| 914 // 1s, 1, 1, 2, 2, 2, 2, 3, 3, ... | 913 // 1s, 1, 1, 2, 2, 2, 2, 3, 3, ... |
| 915 // Note that idle_notification_delay_in_s_ would be reset to | 914 // Note that idle_notification_delay_in_s_ would be reset to |
| 916 // kInitialIdleHandlerDelayS in RenderThread::WidgetHidden. | 915 // kInitialIdleHandlerDelayS in RenderThread::WidgetHidden. |
| 917 ScheduleIdleHandler(idle_notification_delay_in_s_ + | 916 ScheduleIdleHandler(idle_notification_delay_in_s_ + |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1037 if (url.SchemeIs(chrome::kExtensionScheme)) | 1036 if (url.SchemeIs(chrome::kExtensionScheme)) |
| 1038 return url.host(); | 1037 return url.host(); |
| 1039 | 1038 |
| 1040 for (size_t i = 0; i < extension_extents_.size(); ++i) { | 1039 for (size_t i = 0; i < extension_extents_.size(); ++i) { |
| 1041 if (extension_extents_[i].web_extent.ContainsURL(url)) | 1040 if (extension_extents_[i].web_extent.ContainsURL(url)) |
| 1042 return extension_extents_[i].extension_id; | 1041 return extension_extents_[i].extension_id; |
| 1043 } | 1042 } |
| 1044 | 1043 |
| 1045 return std::string(); | 1044 return std::string(); |
| 1046 } | 1045 } |
| OLD | NEW |