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/browser/renderer_host/render_view_host_impl.h" | 5 #include "content/browser/renderer_host/render_view_host_impl.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "base/trace_event/trace_event.h" | 24 #include "base/trace_event/trace_event.h" |
25 #include "base/values.h" | 25 #include "base/values.h" |
26 #include "cc/base/switches.h" | 26 #include "cc/base/switches.h" |
27 #include "content/browser/bad_message.h" | 27 #include "content/browser/bad_message.h" |
28 #include "content/browser/child_process_security_policy_impl.h" | 28 #include "content/browser/child_process_security_policy_impl.h" |
29 #include "content/browser/dom_storage/session_storage_namespace_impl.h" | 29 #include "content/browser/dom_storage/session_storage_namespace_impl.h" |
30 #include "content/browser/frame_host/frame_tree.h" | 30 #include "content/browser/frame_host/frame_tree.h" |
31 #include "content/browser/gpu/compositor_util.h" | 31 #include "content/browser/gpu/compositor_util.h" |
32 #include "content/browser/gpu/gpu_data_manager_impl.h" | 32 #include "content/browser/gpu/gpu_data_manager_impl.h" |
33 #include "content/browser/gpu/gpu_process_host.h" | 33 #include "content/browser/gpu/gpu_process_host.h" |
34 #include "content/browser/gpu/gpu_surface_tracker.h" | |
35 #include "content/browser/host_zoom_map_impl.h" | 34 #include "content/browser/host_zoom_map_impl.h" |
36 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 35 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
37 #include "content/browser/renderer_host/dip_util.h" | 36 #include "content/browser/renderer_host/dip_util.h" |
38 #include "content/browser/renderer_host/media/audio_renderer_host.h" | 37 #include "content/browser/renderer_host/media/audio_renderer_host.h" |
39 #include "content/browser/renderer_host/render_process_host_impl.h" | 38 #include "content/browser/renderer_host/render_process_host_impl.h" |
40 #include "content/browser/renderer_host/render_view_host_delegate.h" | 39 #include "content/browser/renderer_host/render_view_host_delegate.h" |
41 #include "content/browser/renderer_host/render_view_host_delegate_view.h" | 40 #include "content/browser/renderer_host/render_view_host_delegate_view.h" |
42 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 41 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
43 #include "content/common/browser_plugin/browser_plugin_messages.h" | 42 #include "content/common/browser_plugin/browser_plugin_messages.h" |
44 #include "content/common/content_switches_internal.h" | 43 #include "content/common/content_switches_internal.h" |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 // initialized it) or may not (we have our own process or the old process | 290 // initialized it) or may not (we have our own process or the old process |
292 // crashed) have been initialized. Calling Init multiple times will be | 291 // crashed) have been initialized. Calling Init multiple times will be |
293 // ignored, so this is safe. | 292 // ignored, so this is safe. |
294 if (!GetProcess()->Init()) | 293 if (!GetProcess()->Init()) |
295 return false; | 294 return false; |
296 DCHECK(GetProcess()->HasConnection()); | 295 DCHECK(GetProcess()->HasConnection()); |
297 DCHECK(GetProcess()->GetBrowserContext()); | 296 DCHECK(GetProcess()->GetBrowserContext()); |
298 | 297 |
299 set_renderer_initialized(true); | 298 set_renderer_initialized(true); |
300 | 299 |
301 // If this is not an active RenderView, then we need to create a | |
302 // handle with NULL_TRANSPORT type. Active RenderViews will implement | |
303 // GetCompositingSurface() in the RenderWidgetHostView delegate which returns | |
304 // the appropriate surface type. | |
305 if (proxy_route_id != MSG_ROUTING_NONE) { | |
306 GpuSurfaceTracker::Get()->SetSurfaceHandle( | |
307 surface_id(), | |
308 gfx::GLSurfaceHandle(gfx::kNullPluginWindow, gfx::NULL_TRANSPORT)); | |
309 } else { | |
310 GpuSurfaceTracker::Get()->SetSurfaceHandle(surface_id(), | |
311 GetCompositingSurface()); | |
312 } | |
313 | |
314 // Ensure the RenderView starts with a next_page_id larger than any existing | 300 // Ensure the RenderView starts with a next_page_id larger than any existing |
315 // page ID it might be asked to render. | 301 // page ID it might be asked to render. |
316 int32 next_page_id = 1; | 302 int32 next_page_id = 1; |
317 if (max_page_id > -1) | 303 if (max_page_id > -1) |
318 next_page_id = max_page_id + 1; | 304 next_page_id = max_page_id + 1; |
319 | 305 |
320 ViewMsg_New_Params params; | 306 ViewMsg_New_Params params; |
321 params.renderer_preferences = | 307 params.renderer_preferences = |
322 delegate_->GetRendererPrefs(GetProcess()->GetBrowserContext()); | 308 delegate_->GetRendererPrefs(GetProcess()->GetBrowserContext()); |
323 #if defined(OS_WIN) | 309 #if defined(OS_WIN) |
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1438 if (!policy->CanReadFile(GetProcess()->GetID(), file)) | 1424 if (!policy->CanReadFile(GetProcess()->GetID(), file)) |
1439 policy->GrantReadFile(GetProcess()->GetID(), file); | 1425 policy->GrantReadFile(GetProcess()->GetID(), file); |
1440 } | 1426 } |
1441 } | 1427 } |
1442 | 1428 |
1443 void RenderViewHostImpl::SelectWordAroundCaret() { | 1429 void RenderViewHostImpl::SelectWordAroundCaret() { |
1444 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); | 1430 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); |
1445 } | 1431 } |
1446 | 1432 |
1447 } // namespace content | 1433 } // namespace content |
OLD | NEW |