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 scoped_refptr<ResourceSchedulingFilter> filter( | 1043 resource_scheduling_filter_ = |
1044 new ResourceSchedulingFilter(resource_task_queue, resource_dispatcher())); | 1044 new ResourceSchedulingFilter(resource_task_queue, resource_dispatcher()); |
1045 channel()->AddFilter(filter.get()); | 1045 channel()->AddFilter(resource_scheduling_filter_.get()); |
1046 resource_dispatcher()->SetResourceSchedulingFilter(filter); | |
1047 | 1046 |
1048 // The ChildResourceMessageFilter and the ResourceDispatcher need to use the | 1047 // The ChildResourceMessageFilter and the ResourceDispatcher need to use the |
1049 // same queue to ensure tasks are executed in the expected order. | 1048 // same queue to ensure tasks are executed in the expected order. |
1050 child_resource_message_filter()->SetMainThreadTaskRunner(resource_task_queue); | 1049 child_resource_message_filter()->SetMainThreadTaskRunner(resource_task_queue); |
1051 resource_dispatcher()->SetMainThreadTaskRunner(resource_task_queue); | 1050 resource_dispatcher()->SetMainThreadTaskRunner(resource_task_queue); |
1052 } | 1051 } |
1053 | 1052 |
1054 void RenderThreadImpl::EnsureWebKitInitialized() { | 1053 void RenderThreadImpl::EnsureWebKitInitialized() { |
1055 if (blink_platform_impl_) | 1054 if (blink_platform_impl_) |
1056 return; | 1055 return; |
(...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1984 } | 1983 } |
1985 | 1984 |
1986 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { | 1985 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { |
1987 size_t erased = | 1986 size_t erased = |
1988 RenderThreadImpl::current()->pending_render_frame_connects_.erase( | 1987 RenderThreadImpl::current()->pending_render_frame_connects_.erase( |
1989 routing_id_); | 1988 routing_id_); |
1990 DCHECK_EQ(1u, erased); | 1989 DCHECK_EQ(1u, erased); |
1991 } | 1990 } |
1992 | 1991 |
1993 } // namespace content | 1992 } // namespace content |
OLD | NEW |