| 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 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 721 | 721 |
| 722 int64 RenderThreadImpl::GetIdleNotificationDelayInMs() const { | 722 int64 RenderThreadImpl::GetIdleNotificationDelayInMs() const { |
| 723 return idle_notification_delay_in_ms_; | 723 return idle_notification_delay_in_ms_; |
| 724 } | 724 } |
| 725 | 725 |
| 726 void RenderThreadImpl::SetIdleNotificationDelayInMs( | 726 void RenderThreadImpl::SetIdleNotificationDelayInMs( |
| 727 int64 idle_notification_delay_in_ms) { | 727 int64 idle_notification_delay_in_ms) { |
| 728 idle_notification_delay_in_ms_ = idle_notification_delay_in_ms; | 728 idle_notification_delay_in_ms_ = idle_notification_delay_in_ms; |
| 729 } | 729 } |
| 730 | 730 |
| 731 void RenderThreadImpl::ToggleWebKitSharedTimer(bool suspend) { |
| 732 if (suspend_webkit_shared_timer_) { |
| 733 EnsureWebKitInitialized(); |
| 734 if (suspend) { |
| 735 webkit_platform_support_->SuspendSharedTimer(); |
| 736 } else { |
| 737 webkit_platform_support_->ResumeSharedTimer(); |
| 738 } |
| 739 } |
| 740 } |
| 741 |
| 742 void RenderThreadImpl::UpdateHistograms(int sequence_number) { |
| 743 child_histogram_message_filter()->SendHistograms(sequence_number); |
| 744 } |
| 745 |
| 731 void RenderThreadImpl::PostponeIdleNotification() { | 746 void RenderThreadImpl::PostponeIdleNotification() { |
| 732 idle_notifications_to_skip_ = 2; | 747 idle_notifications_to_skip_ = 2; |
| 733 } | 748 } |
| 734 | 749 |
| 735 base::WeakPtr<WebGraphicsContext3DCommandBufferImpl> | 750 base::WeakPtr<WebGraphicsContext3DCommandBufferImpl> |
| 736 RenderThreadImpl::GetGpuVDAContext3D() { | 751 RenderThreadImpl::GetGpuVDAContext3D() { |
| 737 // If we already handed out a pointer to a context and it's been lost, create | 752 // If we already handed out a pointer to a context and it's been lost, create |
| 738 // a new one. | 753 // a new one. |
| 739 if (gpu_vda_context3d_.get() && gpu_vda_context3d_->isContextLost()) { | 754 if (gpu_vda_context3d_.get() && gpu_vda_context3d_->isContextLost()) { |
| 740 if (compositor_thread()) { | 755 if (compositor_thread()) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 768 void RenderThreadImpl::PreCacheFont(const LOGFONT& log_font) { | 783 void RenderThreadImpl::PreCacheFont(const LOGFONT& log_font) { |
| 769 Send(new ChildProcessHostMsg_PreCacheFont(log_font)); | 784 Send(new ChildProcessHostMsg_PreCacheFont(log_font)); |
| 770 } | 785 } |
| 771 | 786 |
| 772 void RenderThreadImpl::ReleaseCachedFonts() { | 787 void RenderThreadImpl::ReleaseCachedFonts() { |
| 773 Send(new ChildProcessHostMsg_ReleaseCachedFonts()); | 788 Send(new ChildProcessHostMsg_ReleaseCachedFonts()); |
| 774 } | 789 } |
| 775 | 790 |
| 776 #endif // OS_WIN | 791 #endif // OS_WIN |
| 777 | 792 |
| 778 void RenderThreadImpl::UpdateHistograms(int sequence_number) { | |
| 779 child_histogram_message_filter()->SendHistograms(sequence_number); | |
| 780 } | |
| 781 | |
| 782 bool RenderThreadImpl::IsWebFrameValid(WebKit::WebFrame* web_frame) { | 793 bool RenderThreadImpl::IsWebFrameValid(WebKit::WebFrame* web_frame) { |
| 783 if (!web_frame) | 794 if (!web_frame) |
| 784 return false; // We must be shutting down. | 795 return false; // We must be shutting down. |
| 785 | 796 |
| 786 RenderViewImpl* render_view = RenderViewImpl::FromWebView(web_frame->view()); | 797 RenderViewImpl* render_view = RenderViewImpl::FromWebView(web_frame->view()); |
| 787 if (!render_view) | 798 if (!render_view) |
| 788 return false; // We must be shutting down. | 799 return false; // We must be shutting down. |
| 789 | 800 |
| 790 return true; | 801 return true; |
| 791 } | 802 } |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1044 | 1055 |
| 1045 scoped_refptr<base::MessageLoopProxy> | 1056 scoped_refptr<base::MessageLoopProxy> |
| 1046 RenderThreadImpl::GetFileThreadMessageLoopProxy() { | 1057 RenderThreadImpl::GetFileThreadMessageLoopProxy() { |
| 1047 DCHECK(message_loop() == MessageLoop::current()); | 1058 DCHECK(message_loop() == MessageLoop::current()); |
| 1048 if (!file_thread_.get()) { | 1059 if (!file_thread_.get()) { |
| 1049 file_thread_.reset(new base::Thread("Renderer::FILE")); | 1060 file_thread_.reset(new base::Thread("Renderer::FILE")); |
| 1050 file_thread_->Start(); | 1061 file_thread_->Start(); |
| 1051 } | 1062 } |
| 1052 return file_thread_->message_loop_proxy(); | 1063 return file_thread_->message_loop_proxy(); |
| 1053 } | 1064 } |
| OLD | NEW |