OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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.h" | 5 #include "content/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 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 // kInitialIdleHandlerDelayS in RenderThread::WidgetHidden. | 681 // kInitialIdleHandlerDelayS in RenderThread::WidgetHidden. |
682 ScheduleIdleHandler(idle_notification_delay_in_s_ + | 682 ScheduleIdleHandler(idle_notification_delay_in_s_ + |
683 1.0 / (idle_notification_delay_in_s_ + 2.0)); | 683 1.0 / (idle_notification_delay_in_s_ + 2.0)); |
684 | 684 |
685 FOR_EACH_OBSERVER(RenderProcessObserver, observers_, IdleNotification()); | 685 FOR_EACH_OBSERVER(RenderProcessObserver, observers_, IdleNotification()); |
686 } | 686 } |
687 | 687 |
688 void RenderThread::ScheduleIdleHandler(double initial_delay_s) { | 688 void RenderThread::ScheduleIdleHandler(double initial_delay_s) { |
689 idle_notification_delay_in_s_ = initial_delay_s; | 689 idle_notification_delay_in_s_ = initial_delay_s; |
690 idle_timer_.Stop(); | 690 idle_timer_.Stop(); |
691 idle_timer_.Start(FROM_HERE, | 691 idle_timer_.Start( |
692 base::TimeDelta::FromSeconds(static_cast<int64>(initial_delay_s)), | 692 base::TimeDelta::FromSeconds(static_cast<int64>(initial_delay_s)), |
693 this, &RenderThread::IdleHandler); | 693 this, &RenderThread::IdleHandler); |
694 } | 694 } |
695 | 695 |
696 void RenderThread::OnPurgePluginListCache(bool reload_pages) { | 696 void RenderThread::OnPurgePluginListCache(bool reload_pages) { |
697 EnsureWebKitInitialized(); | 697 EnsureWebKitInitialized(); |
698 // The call below will cause a GetPlugins call with refresh=true, but at this | 698 // The call below will cause a GetPlugins call with refresh=true, but at this |
699 // point we already know that the browser has refreshed its list, so disable | 699 // point we already know that the browser has refreshed its list, so disable |
700 // refresh temporarily to prevent each renderer process causing the list to be | 700 // refresh temporarily to prevent each renderer process causing the list to be |
701 // regenerated. | 701 // regenerated. |
(...skipping 19 matching lines...) Expand all Loading... |
721 | 721 |
722 void RenderThread::RegisterExtension(v8::Extension* extension) { | 722 void RenderThread::RegisterExtension(v8::Extension* extension) { |
723 WebScriptController::registerExtension(extension); | 723 WebScriptController::registerExtension(extension); |
724 v8_extensions_.insert(extension->name()); | 724 v8_extensions_.insert(extension->name()); |
725 } | 725 } |
726 | 726 |
727 bool RenderThread::IsRegisteredExtension( | 727 bool RenderThread::IsRegisteredExtension( |
728 const std::string& v8_extension_name) const { | 728 const std::string& v8_extension_name) const { |
729 return v8_extensions_.find(v8_extension_name) != v8_extensions_.end(); | 729 return v8_extensions_.find(v8_extension_name) != v8_extensions_.end(); |
730 } | 730 } |
OLD | NEW |