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