| 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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 // initialized it) or may not (we have our own process or the old process | 289 // initialized it) or may not (we have our own process or the old process |
| 291 // crashed) have been initialized. Calling Init multiple times will be | 290 // crashed) have been initialized. Calling Init multiple times will be |
| 292 // ignored, so this is safe. | 291 // ignored, so this is safe. |
| 293 if (!GetProcess()->Init()) | 292 if (!GetProcess()->Init()) |
| 294 return false; | 293 return false; |
| 295 DCHECK(GetProcess()->HasConnection()); | 294 DCHECK(GetProcess()->HasConnection()); |
| 296 DCHECK(GetProcess()->GetBrowserContext()); | 295 DCHECK(GetProcess()->GetBrowserContext()); |
| 297 | 296 |
| 298 set_renderer_initialized(true); | 297 set_renderer_initialized(true); |
| 299 | 298 |
| 300 // If this is not an active RenderView, then we need to create a | |
| 301 // handle with NULL_TRANSPORT type. Active RenderViews will implement | |
| 302 // GetCompositingSurface() in the RenderWidgetHostView delegate which returns | |
| 303 // the appropriate surface type. | |
| 304 if (proxy_route_id != MSG_ROUTING_NONE) { | |
| 305 GpuSurfaceTracker::Get()->SetSurfaceHandle( | |
| 306 surface_id(), | |
| 307 gfx::GLSurfaceHandle(gfx::kNullPluginWindow, gfx::NULL_TRANSPORT)); | |
| 308 } else { | |
| 309 GpuSurfaceTracker::Get()->SetSurfaceHandle(surface_id(), | |
| 310 GetCompositingSurface()); | |
| 311 } | |
| 312 | |
| 313 // Ensure the RenderView starts with a next_page_id larger than any existing | 299 // Ensure the RenderView starts with a next_page_id larger than any existing |
| 314 // page ID it might be asked to render. | 300 // page ID it might be asked to render. |
| 315 int32 next_page_id = 1; | 301 int32 next_page_id = 1; |
| 316 if (max_page_id > -1) | 302 if (max_page_id > -1) |
| 317 next_page_id = max_page_id + 1; | 303 next_page_id = max_page_id + 1; |
| 318 | 304 |
| 319 ViewMsg_New_Params params; | 305 ViewMsg_New_Params params; |
| 320 params.renderer_preferences = | 306 params.renderer_preferences = |
| 321 delegate_->GetRendererPrefs(GetProcess()->GetBrowserContext()); | 307 delegate_->GetRendererPrefs(GetProcess()->GetBrowserContext()); |
| 322 #if defined(OS_WIN) | 308 #if defined(OS_WIN) |
| (...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1437 if (!policy->CanReadFile(GetProcess()->GetID(), file)) | 1423 if (!policy->CanReadFile(GetProcess()->GetID(), file)) |
| 1438 policy->GrantReadFile(GetProcess()->GetID(), file); | 1424 policy->GrantReadFile(GetProcess()->GetID(), file); |
| 1439 } | 1425 } |
| 1440 } | 1426 } |
| 1441 | 1427 |
| 1442 void RenderViewHostImpl::SelectWordAroundCaret() { | 1428 void RenderViewHostImpl::SelectWordAroundCaret() { |
| 1443 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); | 1429 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); |
| 1444 } | 1430 } |
| 1445 | 1431 |
| 1446 } // namespace content | 1432 } // namespace content |
| OLD | NEW |