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