Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(495)

Side by Side Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 972313002: Make <webview> use out-of-process iframe architecture. (Closed) Base URL: ssh://saopaulo.wat/mnt/dev/shared/src@testoopif2z-better-chrome
Patch Set: Rebase after swapped out changes major rework with RFP Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 298
298 GpuSurfaceTracker::Get()->SetSurfaceHandle( 299 GpuSurfaceTracker::Get()->SetSurfaceHandle(
299 surface_id(), GetCompositingSurface()); 300 surface_id(), GetCompositingSurface());
300 301
301 // Ensure the RenderView starts with a next_page_id larger than any existing 302 // Ensure the RenderView starts with a next_page_id larger than any existing
302 // page ID it might be asked to render. 303 // page ID it might be asked to render.
303 int32 next_page_id = 1; 304 int32 next_page_id = 1;
304 if (max_page_id > -1) 305 if (max_page_id > -1)
305 next_page_id = max_page_id + 1; 306 next_page_id = max_page_id + 1;
306 307
308 int proxy_route_id_to_send = proxy_route_id;
309
310 // Do not instruct the view to create a proxy if this is a swapped out
311 // RenderView for an inner WebContents.
312 // The proxy will be created using RFHM::SwapFrameWithProxy().
313 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
314 switches::kSitePerProcess) &&
315 BrowserPluginGuest::IsGuest(this)) {
316 proxy_route_id_to_send = MSG_ROUTING_NONE;
317 }
318
307 ViewMsg_New_Params params; 319 ViewMsg_New_Params params;
308 params.renderer_preferences = 320 params.renderer_preferences =
309 delegate_->GetRendererPrefs(GetProcess()->GetBrowserContext()); 321 delegate_->GetRendererPrefs(GetProcess()->GetBrowserContext());
310 #if defined(OS_WIN) 322 #if defined(OS_WIN)
311 GetWindowsSpecificPrefs(&params.renderer_preferences); 323 GetWindowsSpecificPrefs(&params.renderer_preferences);
312 #endif 324 #endif
313 params.web_preferences = GetWebkitPreferences(); 325 params.web_preferences = GetWebkitPreferences();
314 params.view_id = GetRoutingID(); 326 params.view_id = GetRoutingID();
315 params.main_frame_routing_id = main_frame_routing_id_; 327 params.main_frame_routing_id = main_frame_routing_id_;
316 params.surface_id = surface_id(); 328 params.surface_id = surface_id();
317 params.session_storage_namespace_id = 329 params.session_storage_namespace_id =
318 delegate_->GetSessionStorageNamespace(instance_.get())->id(); 330 delegate_->GetSessionStorageNamespace(instance_.get())->id();
319 params.frame_name = frame_name; 331 params.frame_name = frame_name;
320 // Ensure the RenderView sets its opener correctly. 332 // Ensure the RenderView sets its opener correctly.
321 params.opener_route_id = opener_route_id; 333 params.opener_route_id = opener_route_id;
322 params.swapped_out = !is_active_; 334 params.swapped_out = !is_active_;
323 params.replicated_frame_state = replicated_frame_state; 335 params.replicated_frame_state = replicated_frame_state;
324 params.proxy_routing_id = proxy_route_id; 336 params.proxy_routing_id = proxy_route_id_to_send;
325 params.hidden = is_hidden(); 337 params.hidden = is_hidden();
326 params.never_visible = delegate_->IsNeverVisible(); 338 params.never_visible = delegate_->IsNeverVisible();
327 params.window_was_created_with_opener = window_was_created_with_opener; 339 params.window_was_created_with_opener = window_was_created_with_opener;
328 params.next_page_id = next_page_id; 340 params.next_page_id = next_page_id;
329 params.enable_auto_resize = auto_resize_enabled(); 341 params.enable_auto_resize = auto_resize_enabled();
330 params.min_size = min_size_for_auto_resize(); 342 params.min_size = min_size_for_auto_resize();
331 params.max_size = max_size_for_auto_resize(); 343 params.max_size = max_size_for_auto_resize();
332 GetResizeParams(&params.initial_size); 344 GetResizeParams(&params.initial_size);
333 345
334 if (!Send(new ViewMsg_New(params))) 346 if (!Send(new ViewMsg_New(params)))
(...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after
1433 if (!policy->CanReadFile(GetProcess()->GetID(), file)) 1445 if (!policy->CanReadFile(GetProcess()->GetID(), file))
1434 policy->GrantReadFile(GetProcess()->GetID(), file); 1446 policy->GrantReadFile(GetProcess()->GetID(), file);
1435 } 1447 }
1436 } 1448 }
1437 1449
1438 void RenderViewHostImpl::SelectWordAroundCaret() { 1450 void RenderViewHostImpl::SelectWordAroundCaret() {
1439 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); 1451 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID()));
1440 } 1452 }
1441 1453
1442 } // namespace content 1454 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698