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 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1033 | 1033 |
1034 void RenderThreadImpl::SetResourceDispatcherDelegate( | 1034 void RenderThreadImpl::SetResourceDispatcherDelegate( |
1035 ResourceDispatcherDelegate* delegate) { | 1035 ResourceDispatcherDelegate* delegate) { |
1036 resource_dispatcher()->set_delegate(delegate); | 1036 resource_dispatcher()->set_delegate(delegate); |
1037 } | 1037 } |
1038 | 1038 |
1039 void RenderThreadImpl::SetResourceDispatchTaskQueue( | 1039 void RenderThreadImpl::SetResourceDispatchTaskQueue( |
1040 const scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue) { | 1040 const scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue) { |
1041 // Add a filter that forces resource messages to be dispatched via a | 1041 // Add a filter that forces resource messages to be dispatched via a |
1042 // particular task runner. | 1042 // particular task runner. |
1043 resource_scheduling_filter_ = | 1043 scoped_refptr<ResourceSchedulingFilter> filter( |
1044 new ResourceSchedulingFilter(resource_task_queue, resource_dispatcher()); | 1044 new ResourceSchedulingFilter(resource_task_queue, resource_dispatcher())); |
1045 channel()->AddFilter(resource_scheduling_filter_.get()); | 1045 channel()->AddFilter(filter.get()); |
| 1046 resource_dispatcher()->SetResourceSchedulingFilter(filter); |
1046 | 1047 |
1047 // The ChildResourceMessageFilter and the ResourceDispatcher need to use the | 1048 // The ChildResourceMessageFilter and the ResourceDispatcher need to use the |
1048 // same queue to ensure tasks are executed in the expected order. | 1049 // same queue to ensure tasks are executed in the expected order. |
1049 child_resource_message_filter()->SetMainThreadTaskRunner(resource_task_queue); | 1050 child_resource_message_filter()->SetMainThreadTaskRunner(resource_task_queue); |
1050 resource_dispatcher()->SetMainThreadTaskRunner(resource_task_queue); | 1051 resource_dispatcher()->SetMainThreadTaskRunner(resource_task_queue); |
1051 } | 1052 } |
1052 | 1053 |
1053 void RenderThreadImpl::EnsureWebKitInitialized() { | 1054 void RenderThreadImpl::EnsureWebKitInitialized() { |
1054 if (blink_platform_impl_) | 1055 if (blink_platform_impl_) |
1055 return; | 1056 return; |
(...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1983 } | 1984 } |
1984 | 1985 |
1985 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { | 1986 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { |
1986 size_t erased = | 1987 size_t erased = |
1987 RenderThreadImpl::current()->pending_render_frame_connects_.erase( | 1988 RenderThreadImpl::current()->pending_render_frame_connects_.erase( |
1988 routing_id_); | 1989 routing_id_); |
1989 DCHECK_EQ(1u, erased); | 1990 DCHECK_EQ(1u, erased); |
1990 } | 1991 } |
1991 | 1992 |
1992 } // namespace content | 1993 } // namespace content |
OLD | NEW |