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 "content/renderer/render_thread_impl.h" | 5 #include "content/renderer/render_thread_impl.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 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
846 | 846 |
847 int64 RenderThreadImpl::GetIdleNotificationDelayInMs() const { | 847 int64 RenderThreadImpl::GetIdleNotificationDelayInMs() const { |
848 return idle_notification_delay_in_ms_; | 848 return idle_notification_delay_in_ms_; |
849 } | 849 } |
850 | 850 |
851 void RenderThreadImpl::SetIdleNotificationDelayInMs( | 851 void RenderThreadImpl::SetIdleNotificationDelayInMs( |
852 int64 idle_notification_delay_in_ms) { | 852 int64 idle_notification_delay_in_ms) { |
853 idle_notification_delay_in_ms_ = idle_notification_delay_in_ms; | 853 idle_notification_delay_in_ms_ = idle_notification_delay_in_ms; |
854 } | 854 } |
855 | 855 |
856 void RenderThreadImpl::ToggleWebKitSharedTimer(bool suspend) { | |
857 if (suspend_webkit_shared_timer_) { | |
858 EnsureWebKitInitialized(); | |
859 if (suspend) { | |
860 webkit_platform_support_->SuspendSharedTimer(); | |
861 } else { | |
862 webkit_platform_support_->ResumeSharedTimer(); | |
863 } | |
864 } | |
865 } | |
866 | |
867 void RenderThreadImpl::UpdateHistograms(int sequence_number) { | 856 void RenderThreadImpl::UpdateHistograms(int sequence_number) { |
868 child_histogram_message_filter()->SendHistograms(sequence_number); | 857 child_histogram_message_filter()->SendHistograms(sequence_number); |
869 } | 858 } |
870 | 859 |
871 int RenderThreadImpl::PostTaskToAllWebWorkers(const base::Closure& closure) { | 860 int RenderThreadImpl::PostTaskToAllWebWorkers(const base::Closure& closure) { |
872 return webkit_glue::WorkerTaskRunner::Instance()->PostTaskToAllThreads( | 861 return webkit_glue::WorkerTaskRunner::Instance()->PostTaskToAllThreads( |
873 closure); | 862 closure); |
874 } | 863 } |
875 | 864 |
876 bool RenderThreadImpl::ResolveProxy(const GURL& url, std::string* proxy_list) { | 865 bool RenderThreadImpl::ResolveProxy(const GURL& url, std::string* proxy_list) { |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1286 GetContentClient()->SetActiveURL(data); | 1275 GetContentClient()->SetActiveURL(data); |
1287 CHECK(false); | 1276 CHECK(false); |
1288 } | 1277 } |
1289 | 1278 |
1290 void RenderThreadImpl::OnSetRendererProcessID(base::ProcessId process_id) { | 1279 void RenderThreadImpl::OnSetRendererProcessID(base::ProcessId process_id) { |
1291 renderer_process_id_ = process_id; | 1280 renderer_process_id_ = process_id; |
1292 } | 1281 } |
1293 | 1282 |
1294 #if defined(OS_ANDROID) | 1283 #if defined(OS_ANDROID) |
1295 void RenderThreadImpl::OnSetWebKitSharedTimersSuspended(bool suspend) { | 1284 void RenderThreadImpl::OnSetWebKitSharedTimersSuspended(bool suspend) { |
1296 ToggleWebKitSharedTimer(suspend); | 1285 if (suspend_webkit_shared_timer_) { |
| 1286 EnsureWebKitInitialized(); |
| 1287 if (suspend) { |
| 1288 webkit_platform_support_->SuspendSharedTimer(); |
| 1289 } else { |
| 1290 webkit_platform_support_->ResumeSharedTimer(); |
| 1291 } |
| 1292 } |
1297 } | 1293 } |
1298 #endif | 1294 #endif |
1299 | 1295 |
1300 #if defined(OS_MACOSX) | 1296 #if defined(OS_MACOSX) |
1301 void RenderThreadImpl::OnUpdateScrollbarTheme(float initial_button_delay, | 1297 void RenderThreadImpl::OnUpdateScrollbarTheme(float initial_button_delay, |
1302 float autoscroll_button_delay, | 1298 float autoscroll_button_delay, |
1303 bool jump_on_track_click, | 1299 bool jump_on_track_click, |
1304 bool redraw) { | 1300 bool redraw) { |
1305 blink::WebScrollbarTheme::updateScrollbars(initial_button_delay, | 1301 blink::WebScrollbarTheme::updateScrollbars(initial_button_delay, |
1306 autoscroll_button_delay, | 1302 autoscroll_button_delay, |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1402 hidden_widget_count_--; | 1398 hidden_widget_count_--; |
1403 | 1399 |
1404 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { | 1400 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { |
1405 return; | 1401 return; |
1406 } | 1402 } |
1407 | 1403 |
1408 ScheduleIdleHandler(kLongIdleHandlerDelayMs); | 1404 ScheduleIdleHandler(kLongIdleHandlerDelayMs); |
1409 } | 1405 } |
1410 | 1406 |
1411 } // namespace content | 1407 } // namespace content |
OLD | NEW |