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 // Represents the browser side of the browser <--> renderer communication | 5 // Represents the browser side of the browser <--> renderer communication |
6 // channel. There will be one RenderProcessHost per renderer process. | 6 // channel. There will be one RenderProcessHost per renderer process. |
7 | 7 |
8 #include "content/browser/renderer_host/render_process_host_impl.h" | 8 #include "content/browser/renderer_host/render_process_host_impl.h" |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 virtual ~RendererMainThread() { | 147 virtual ~RendererMainThread() { |
148 Stop(); | 148 Stop(); |
149 } | 149 } |
150 | 150 |
151 protected: | 151 protected: |
152 virtual void Init() OVERRIDE { | 152 virtual void Init() OVERRIDE { |
153 render_process_.reset(new RenderProcessImpl()); | 153 render_process_.reset(new RenderProcessImpl()); |
154 new RenderThreadImpl(channel_id_); | 154 new RenderThreadImpl(channel_id_); |
155 } | 155 } |
156 | 156 |
157 virtual void CleanUp() { | 157 virtual void CleanUp() OVERRIDE { |
158 render_process_.reset(); | 158 render_process_.reset(); |
159 | 159 |
160 // It's a little lame to manually set this flag. But the single process | 160 // It's a little lame to manually set this flag. But the single process |
161 // RendererThread will receive the WM_QUIT. We don't need to assert on | 161 // RendererThread will receive the WM_QUIT. We don't need to assert on |
162 // this thread, so just force the flag manually. | 162 // this thread, so just force the flag manually. |
163 // If we want to avoid this, we could create the InProcRendererThread | 163 // If we want to avoid this, we could create the InProcRendererThread |
164 // directly with _beginthreadex() rather than using the Thread class. | 164 // directly with _beginthreadex() rather than using the Thread class. |
165 // We used to set this flag in the Init function above. However there | 165 // We used to set this flag in the Init function above. However there |
166 // other threads like WebThread which are created by this thread | 166 // other threads like WebThread which are created by this thread |
167 // which resets this flag. Please see Thread::StartWithOptions. Setting | 167 // which resets this flag. Please see Thread::StartWithOptions. Setting |
(...skipping 18 matching lines...) Expand all Loading... |
186 RendererURLRequestContextSelector(BrowserContext* browser_context, | 186 RendererURLRequestContextSelector(BrowserContext* browser_context, |
187 int render_child_id) | 187 int render_child_id) |
188 : request_context_(browser_context->GetRequestContextForRenderProcess( | 188 : request_context_(browser_context->GetRequestContextForRenderProcess( |
189 render_child_id)), | 189 render_child_id)), |
190 media_request_context_( | 190 media_request_context_( |
191 browser_context->GetMediaRequestContextForRenderProcess( | 191 browser_context->GetMediaRequestContextForRenderProcess( |
192 render_child_id)) { | 192 render_child_id)) { |
193 } | 193 } |
194 | 194 |
195 virtual net::URLRequestContext* GetRequestContext( | 195 virtual net::URLRequestContext* GetRequestContext( |
196 ResourceType::Type resource_type) { | 196 ResourceType::Type resource_type) OVERRIDE { |
197 net::URLRequestContextGetter* request_context = request_context_; | 197 net::URLRequestContextGetter* request_context = request_context_; |
198 // If the request has resource type of ResourceType::MEDIA, we use a request | 198 // If the request has resource type of ResourceType::MEDIA, we use a request |
199 // context specific to media for handling it because these resources have | 199 // context specific to media for handling it because these resources have |
200 // specific needs for caching. | 200 // specific needs for caching. |
201 if (resource_type == ResourceType::MEDIA) | 201 if (resource_type == ResourceType::MEDIA) |
202 request_context = media_request_context_; | 202 request_context = media_request_context_; |
203 return request_context->GetURLRequestContext(); | 203 return request_context->GetURLRequestContext(); |
204 } | 204 } |
205 | 205 |
206 private: | 206 private: |
(...skipping 1416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1623 TRACE_EVENT0("renderer_host", | 1623 TRACE_EVENT0("renderer_host", |
1624 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost"); | 1624 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost"); |
1625 AcceleratedSurfaceMsg_BufferPresented_Params ack_params; | 1625 AcceleratedSurfaceMsg_BufferPresented_Params ack_params; |
1626 ack_params.sync_point = 0; | 1626 ack_params.sync_point = 0; |
1627 RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id, | 1627 RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id, |
1628 gpu_process_host_id, | 1628 gpu_process_host_id, |
1629 ack_params); | 1629 ack_params); |
1630 } | 1630 } |
1631 | 1631 |
1632 } // namespace content | 1632 } // namespace content |
OLD | NEW |