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> |
11 | 11 |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/i18n/rtl.h" | 14 #include "base/i18n/rtl.h" |
15 #include "base/json/json_reader.h" | 15 #include "base/json/json_reader.h" |
16 #include "base/message_loop/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
17 #include "base/metrics/field_trial.h" | 17 #include "base/metrics/field_trial.h" |
18 #include "base/metrics/histogram.h" | 18 #include "base/metrics/histogram.h" |
19 #include "base/stl_util.h" | 19 #include "base/stl_util.h" |
20 #include "base/strings/string_util.h" | 20 #include "base/strings/string_util.h" |
21 #include "base/strings/utf_string_conversions.h" | 21 #include "base/strings/utf_string_conversions.h" |
22 #include "base/sys_info.h" | 22 #include "base/sys_info.h" |
23 #include "base/time/time.h" | 23 #include "base/time/time.h" |
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/browser_plugin/browser_plugin_guest.h" | |
28 #include "content/browser/child_process_security_policy_impl.h" | 29 #include "content/browser/child_process_security_policy_impl.h" |
29 #include "content/browser/dom_storage/session_storage_namespace_impl.h" | 30 #include "content/browser/dom_storage/session_storage_namespace_impl.h" |
30 #include "content/browser/frame_host/frame_tree.h" | 31 #include "content/browser/frame_host/frame_tree.h" |
31 #include "content/browser/gpu/compositor_util.h" | 32 #include "content/browser/gpu/compositor_util.h" |
32 #include "content/browser/gpu/gpu_data_manager_impl.h" | 33 #include "content/browser/gpu/gpu_data_manager_impl.h" |
33 #include "content/browser/gpu/gpu_process_host.h" | 34 #include "content/browser/gpu/gpu_process_host.h" |
34 #include "content/browser/gpu/gpu_surface_tracker.h" | 35 #include "content/browser/gpu/gpu_surface_tracker.h" |
35 #include "content/browser/host_zoom_map_impl.h" | 36 #include "content/browser/host_zoom_map_impl.h" |
36 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 37 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
37 #include "content/browser/renderer_host/dip_util.h" | 38 #include "content/browser/renderer_host/dip_util.h" |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
294 | 295 |
295 GpuSurfaceTracker::Get()->SetSurfaceHandle( | 296 GpuSurfaceTracker::Get()->SetSurfaceHandle( |
296 surface_id(), GetCompositingSurface()); | 297 surface_id(), GetCompositingSurface()); |
297 | 298 |
298 // 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 |
299 // page ID it might be asked to render. | 300 // page ID it might be asked to render. |
300 int32 next_page_id = 1; | 301 int32 next_page_id = 1; |
301 if (max_page_id > -1) | 302 if (max_page_id > -1) |
302 next_page_id = max_page_id + 1; | 303 next_page_id = max_page_id + 1; |
303 | 304 |
305 int proxy_route_id_to_send = proxy_route_id; | |
306 // Do not instruct the view to create a proxy if this is a swapped out | |
nasko
2015/05/28 22:13:46
nit: Either an empty line above the comment or mov
lazyboy
2015/05/29 00:02:24
Done (first one).
| |
307 // RenderView for an inner WebContents. | |
308 // The proxy will be created using RFHM::SwapFrameWithProxy(). | |
309 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | |
310 switches::kSitePerProcess) && | |
311 BrowserPluginGuest::IsGuest(this)) { | |
312 proxy_route_id_to_send = MSG_ROUTING_NONE; | |
313 } | |
314 | |
304 ViewMsg_New_Params params; | 315 ViewMsg_New_Params params; |
305 params.renderer_preferences = | 316 params.renderer_preferences = |
306 delegate_->GetRendererPrefs(GetProcess()->GetBrowserContext()); | 317 delegate_->GetRendererPrefs(GetProcess()->GetBrowserContext()); |
307 #if defined(OS_WIN) | 318 #if defined(OS_WIN) |
308 GetWindowsSpecificPrefs(¶ms.renderer_preferences); | 319 GetWindowsSpecificPrefs(¶ms.renderer_preferences); |
309 #endif | 320 #endif |
310 params.web_preferences = GetWebkitPreferences(); | 321 params.web_preferences = GetWebkitPreferences(); |
311 params.view_id = GetRoutingID(); | 322 params.view_id = GetRoutingID(); |
312 params.main_frame_routing_id = main_frame_routing_id_; | 323 params.main_frame_routing_id = main_frame_routing_id_; |
313 params.surface_id = surface_id(); | 324 params.surface_id = surface_id(); |
314 params.session_storage_namespace_id = | 325 params.session_storage_namespace_id = |
315 delegate_->GetSessionStorageNamespace(instance_.get())->id(); | 326 delegate_->GetSessionStorageNamespace(instance_.get())->id(); |
316 params.frame_name = frame_name; | 327 params.frame_name = frame_name; |
317 // Ensure the RenderView sets its opener correctly. | 328 // Ensure the RenderView sets its opener correctly. |
318 params.opener_route_id = opener_route_id; | 329 params.opener_route_id = opener_route_id; |
319 params.swapped_out = !is_active_; | 330 params.swapped_out = !is_active_; |
320 params.proxy_routing_id = proxy_route_id; | 331 params.proxy_routing_id = proxy_route_id_to_send; |
321 params.hidden = is_hidden(); | 332 params.hidden = is_hidden(); |
322 params.never_visible = delegate_->IsNeverVisible(); | 333 params.never_visible = delegate_->IsNeverVisible(); |
323 params.window_was_created_with_opener = window_was_created_with_opener; | 334 params.window_was_created_with_opener = window_was_created_with_opener; |
324 params.next_page_id = next_page_id; | 335 params.next_page_id = next_page_id; |
325 params.enable_auto_resize = auto_resize_enabled(); | 336 params.enable_auto_resize = auto_resize_enabled(); |
326 params.min_size = min_size_for_auto_resize(); | 337 params.min_size = min_size_for_auto_resize(); |
327 params.max_size = max_size_for_auto_resize(); | 338 params.max_size = max_size_for_auto_resize(); |
328 GetResizeParams(¶ms.initial_size); | 339 GetResizeParams(¶ms.initial_size); |
329 if (!is_active_) { | 340 if (!is_active_) { |
330 params.replicated_frame_state = | 341 params.replicated_frame_state = |
(...skipping 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1424 if (!policy->CanReadFile(GetProcess()->GetID(), file)) | 1435 if (!policy->CanReadFile(GetProcess()->GetID(), file)) |
1425 policy->GrantReadFile(GetProcess()->GetID(), file); | 1436 policy->GrantReadFile(GetProcess()->GetID(), file); |
1426 } | 1437 } |
1427 } | 1438 } |
1428 | 1439 |
1429 void RenderViewHostImpl::SelectWordAroundCaret() { | 1440 void RenderViewHostImpl::SelectWordAroundCaret() { |
1430 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); | 1441 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); |
1431 } | 1442 } |
1432 | 1443 |
1433 } // namespace content | 1444 } // namespace content |
OLD | NEW |