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 26 matching lines...) Expand all Loading... |
37 #include "content/child/appcache/appcache_frontend_impl.h" | 37 #include "content/child/appcache/appcache_frontend_impl.h" |
38 #include "content/child/child_gpu_memory_buffer_manager.h" | 38 #include "content/child/child_gpu_memory_buffer_manager.h" |
39 #include "content/child/child_histogram_message_filter.h" | 39 #include "content/child/child_histogram_message_filter.h" |
40 #include "content/child/content_child_helpers.h" | 40 #include "content/child/content_child_helpers.h" |
41 #include "content/child/db_message_filter.h" | 41 #include "content/child/db_message_filter.h" |
42 #include "content/child/indexed_db/indexed_db_dispatcher.h" | 42 #include "content/child/indexed_db/indexed_db_dispatcher.h" |
43 #include "content/child/indexed_db/indexed_db_message_filter.h" | 43 #include "content/child/indexed_db/indexed_db_message_filter.h" |
44 #include "content/child/npapi/npobject_util.h" | 44 #include "content/child/npapi/npobject_util.h" |
45 #include "content/child/plugin_messages.h" | 45 #include "content/child/plugin_messages.h" |
46 #include "content/child/resource_dispatcher.h" | 46 #include "content/child/resource_dispatcher.h" |
| 47 #include "content/child/resource_scheduling_filter.h" |
47 #include "content/child/runtime_features.h" | 48 #include "content/child/runtime_features.h" |
48 #include "content/child/thread_safe_sender.h" | 49 #include "content/child/thread_safe_sender.h" |
49 #include "content/child/web_database_observer_impl.h" | 50 #include "content/child/web_database_observer_impl.h" |
50 #include "content/child/worker_task_runner.h" | 51 #include "content/child/worker_task_runner.h" |
51 #include "content/common/child_process_messages.h" | 52 #include "content/common/child_process_messages.h" |
52 #include "content/common/content_constants_internal.h" | 53 #include "content/common/content_constants_internal.h" |
53 #include "content/common/database_messages.h" | 54 #include "content/common/database_messages.h" |
54 #include "content/common/dom_storage/dom_storage_messages.h" | 55 #include "content/common/dom_storage/dom_storage_messages.h" |
55 #include "content/common/frame_messages.h" | 56 #include "content/common/frame_messages.h" |
56 #include "content/common/gpu/client/context_provider_command_buffer.h" | 57 #include "content/common/gpu/client/context_provider_command_buffer.h" |
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 v8::Isolate* isolate = blink::mainThreadIsolate(); | 846 v8::Isolate* isolate = blink::mainThreadIsolate(); |
846 | 847 |
847 isolate->SetCounterFunction(base::StatsTable::FindLocation); | 848 isolate->SetCounterFunction(base::StatsTable::FindLocation); |
848 isolate->SetCreateHistogramFunction(CreateHistogram); | 849 isolate->SetCreateHistogramFunction(CreateHistogram); |
849 isolate->SetAddHistogramSampleFunction(AddHistogramSample); | 850 isolate->SetAddHistogramSampleFunction(AddHistogramSample); |
850 | 851 |
851 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 852 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
852 | 853 |
853 main_thread_compositor_task_runner_ = base::MessageLoopProxy::current(); | 854 main_thread_compositor_task_runner_ = base::MessageLoopProxy::current(); |
854 | 855 |
| 856 // Add a filter that forces resource messages to be dispatched via a |
| 857 // particular task runner. |
| 858 // FIXME: hook this up to the blink scheduler. |
| 859 resource_scheduling_filter_ = new ResourceSchedulingFilter( |
| 860 base::MessageLoopProxy::current(), resource_dispatcher()); |
| 861 GetChannel()->AddFilter(resource_scheduling_filter_.get()); |
| 862 channel()->AddFilter(resource_scheduling_filter_.get()); |
| 863 |
855 bool enable = !command_line.HasSwitch(switches::kDisableThreadedCompositing); | 864 bool enable = !command_line.HasSwitch(switches::kDisableThreadedCompositing); |
856 if (enable) { | 865 if (enable) { |
857 #if defined(OS_ANDROID) | 866 #if defined(OS_ANDROID) |
858 if (SynchronousCompositorFactory* factory = | 867 if (SynchronousCompositorFactory* factory = |
859 SynchronousCompositorFactory::GetInstance()) | 868 SynchronousCompositorFactory::GetInstance()) |
860 compositor_message_loop_proxy_ = | 869 compositor_message_loop_proxy_ = |
861 factory->GetCompositorMessageLoop(); | 870 factory->GetCompositorMessageLoop(); |
862 #endif | 871 #endif |
863 if (!compositor_message_loop_proxy_.get()) { | 872 if (!compositor_message_loop_proxy_.get()) { |
864 compositor_thread_.reset(new base::Thread("Compositor")); | 873 compositor_thread_.reset(new base::Thread("Compositor")); |
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1582 hidden_widget_count_--; | 1591 hidden_widget_count_--; |
1583 | 1592 |
1584 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { | 1593 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { |
1585 return; | 1594 return; |
1586 } | 1595 } |
1587 | 1596 |
1588 ScheduleIdleHandler(kLongIdleHandlerDelayMs); | 1597 ScheduleIdleHandler(kLongIdleHandlerDelayMs); |
1589 } | 1598 } |
1590 | 1599 |
1591 } // namespace content | 1600 } // namespace content |
OLD | NEW |