| 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 279 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 | 290 // 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 | 291 // crashed) have been initialized. Calling Init multiple times will be |
| 292 // ignored, so this is safe. | 292 // ignored, so this is safe. |
| 293 if (!GetProcess()->Init()) | 293 if (!GetProcess()->Init()) |
| 294 return false; | 294 return false; |
| 295 DCHECK(GetProcess()->HasConnection()); | 295 DCHECK(GetProcess()->HasConnection()); |
| 296 DCHECK(GetProcess()->GetBrowserContext()); | 296 DCHECK(GetProcess()->GetBrowserContext()); |
| 297 | 297 |
| 298 set_renderer_initialized(true); | 298 set_renderer_initialized(true); |
| 299 | 299 |
| 300 GpuSurfaceTracker::Get()->SetSurfaceHandle( | 300 // If this is not an active RenderView, then we need to create a |
| 301 surface_id(), GetCompositingSurface()); | 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 } |
| 302 | 312 |
| 303 // Ensure the RenderView starts with a next_page_id larger than any existing | 313 // Ensure the RenderView starts with a next_page_id larger than any existing |
| 304 // page ID it might be asked to render. | 314 // page ID it might be asked to render. |
| 305 int32 next_page_id = 1; | 315 int32 next_page_id = 1; |
| 306 if (max_page_id > -1) | 316 if (max_page_id > -1) |
| 307 next_page_id = max_page_id + 1; | 317 next_page_id = max_page_id + 1; |
| 308 | 318 |
| 309 ViewMsg_New_Params params; | 319 ViewMsg_New_Params params; |
| 310 params.renderer_preferences = | 320 params.renderer_preferences = |
| 311 delegate_->GetRendererPrefs(GetProcess()->GetBrowserContext()); | 321 delegate_->GetRendererPrefs(GetProcess()->GetBrowserContext()); |
| (...skipping 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1430 if (!policy->CanReadFile(GetProcess()->GetID(), file)) | 1440 if (!policy->CanReadFile(GetProcess()->GetID(), file)) |
| 1431 policy->GrantReadFile(GetProcess()->GetID(), file); | 1441 policy->GrantReadFile(GetProcess()->GetID(), file); |
| 1432 } | 1442 } |
| 1433 } | 1443 } |
| 1434 | 1444 |
| 1435 void RenderViewHostImpl::SelectWordAroundCaret() { | 1445 void RenderViewHostImpl::SelectWordAroundCaret() { |
| 1436 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); | 1446 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); |
| 1437 } | 1447 } |
| 1438 | 1448 |
| 1439 } // namespace content | 1449 } // namespace content |
| OLD | NEW |