Chromium Code Reviews| 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 ResourceSchedulingFilter* filter = |
|
Sami
2015/09/29 11:22:47
scoped_ptr?
alex clarke (OOO till 29th)
2015/09/29 16:37:38
Done.
| |
| 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); |
| 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 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2000 } | 2001 } |
| 2001 | 2002 |
| 2002 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { | 2003 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { |
| 2003 size_t erased = | 2004 size_t erased = |
| 2004 RenderThreadImpl::current()->pending_render_frame_connects_.erase( | 2005 RenderThreadImpl::current()->pending_render_frame_connects_.erase( |
| 2005 routing_id_); | 2006 routing_id_); |
| 2006 DCHECK_EQ(1u, erased); | 2007 DCHECK_EQ(1u, erased); |
| 2007 } | 2008 } |
| 2008 | 2009 |
| 2009 } // namespace content | 2010 } // namespace content |
| OLD | NEW |