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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 10377170: Browser Plugin: browser process side changes (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Updated according to jam@ Created 8 years, 7 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 | Annotate | Revision Log
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/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
11 #include "base/metrics/stats_counters.h" 11 #include "base/metrics/stats_counters.h"
12 #include "base/string16.h" 12 #include "base/string16.h"
13 #include "base/string_number_conversions.h" 13 #include "base/string_number_conversions.h"
14 #include "base/string_util.h" 14 #include "base/string_util.h"
15 #include "base/time.h" 15 #include "base/time.h"
16 #include "base/utf_string_conversions.h" 16 #include "base/utf_string_conversions.h"
17 #include "content/browser/browser_plugin/browser_plugin_host.h"
17 #include "content/browser/child_process_security_policy_impl.h" 18 #include "content/browser/child_process_security_policy_impl.h"
18 #include "content/browser/debugger/devtools_manager_impl.h" 19 #include "content/browser/debugger/devtools_manager_impl.h"
19 #include "content/browser/dom_storage/session_storage_namespace_impl.h" 20 #include "content/browser/dom_storage/session_storage_namespace_impl.h"
20 #include "content/browser/download/download_stats.h" 21 #include "content/browser/download/download_stats.h"
21 #include "content/browser/download/mhtml_generation_manager.h" 22 #include "content/browser/download/mhtml_generation_manager.h"
22 #include "content/browser/download/save_package.h" 23 #include "content/browser/download/save_package.h"
23 #include "content/browser/gpu/gpu_data_manager_impl.h" 24 #include "content/browser/gpu/gpu_data_manager_impl.h"
24 #include "content/browser/gpu/gpu_process_host.h" 25 #include "content/browser/gpu/gpu_process_host.h"
25 #include "content/browser/host_zoom_map_impl.h" 26 #include "content/browser/host_zoom_map_impl.h"
26 #include "content/browser/intents/web_intents_dispatcher_impl.h" 27 #include "content/browser/intents/web_intents_dispatcher_impl.h"
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 // Listen for whether our opener gets destroyed. 314 // Listen for whether our opener gets destroyed.
314 if (opener_) { 315 if (opener_) {
315 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, 316 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED,
316 content::Source<WebContents>(opener_)); 317 content::Source<WebContents>(opener_));
317 } 318 }
318 319
319 #if defined(ENABLE_JAVA_BRIDGE) 320 #if defined(ENABLE_JAVA_BRIDGE)
320 java_bridge_dispatcher_host_manager_.reset( 321 java_bridge_dispatcher_host_manager_.reset(
321 new JavaBridgeDispatcherHostManager(this)); 322 new JavaBridgeDispatcherHostManager(this));
322 #endif 323 #endif
324
325 browser_plugin_host_.reset(new content::BrowserPluginHost(this));
323 } 326 }
324 327
325 WebContentsImpl::~WebContentsImpl() { 328 WebContentsImpl::~WebContentsImpl() {
326 is_being_destroyed_ = true; 329 is_being_destroyed_ = true;
327 330
328 // Clear out any JavaScript state. 331 // Clear out any JavaScript state.
329 if (dialog_creator_) 332 if (dialog_creator_)
330 dialog_creator_->ResetJavaScriptState(this); 333 dialog_creator_->ResetJavaScriptState(this);
331 334
332 if (color_chooser_) 335 if (color_chooser_)
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after
1139 content::GetContentClient()->SetActiveURL(entry.GetURL()); 1142 content::GetContentClient()->SetActiveURL(entry.GetURL());
1140 CHECK(0); 1143 CHECK(0);
1141 } 1144 }
1142 1145
1143 // Tell DevTools agent that it is attached prior to the navigation. 1146 // Tell DevTools agent that it is attached prior to the navigation.
1144 DevToolsManagerImpl::GetInstance()->OnNavigatingToPendingEntry( 1147 DevToolsManagerImpl::GetInstance()->OnNavigatingToPendingEntry(
1145 GetRenderViewHost(), 1148 GetRenderViewHost(),
1146 dest_render_view_host, 1149 dest_render_view_host,
1147 entry.GetURL()); 1150 entry.GetURL());
1148 1151
1152 // Tell BrowserPluginHost about the pending cross-process navigation.
Charlie Reis 2012/05/21 18:20:44 Please add TODO to remove this and list the bug nu
Fady Samuel 2012/05/21 19:22:17 Done.
1153 browser_plugin_host()->OnPendingNavigation(dest_render_view_host);
1154
1149 // Used for page load time metrics. 1155 // Used for page load time metrics.
1150 current_load_start_ = base::TimeTicks::Now(); 1156 current_load_start_ = base::TimeTicks::Now();
1151 1157
1152 // Navigate in the desired RenderViewHost. 1158 // Navigate in the desired RenderViewHost.
1153 ViewMsg_Navigate_Params navigate_params; 1159 ViewMsg_Navigate_Params navigate_params;
1154 MakeNavigateParams(entry, controller_, delegate_, reload_type, 1160 MakeNavigateParams(entry, controller_, delegate_, reload_type,
1155 &navigate_params); 1161 &navigate_params);
1156 dest_render_view_host->Navigate(navigate_params); 1162 dest_render_view_host->Navigate(navigate_params);
1157 1163
1158 if (entry.GetPageID() == -1) { 1164 if (entry.GetPageID() == -1) {
(...skipping 1564 matching lines...) Expand 10 before | Expand all | Expand 10 after
2723 2729
2724 // Now that the RenderView has been created, we need to tell it its size. 2730 // Now that the RenderView has been created, we need to tell it its size.
2725 if (rwh_view) 2731 if (rwh_view)
2726 rwh_view->SetSize(view_->GetContainerSize()); 2732 rwh_view->SetSize(view_->GetContainerSize());
2727 2733
2728 // Make sure we use the correct starting page_id in the new RenderView. 2734 // Make sure we use the correct starting page_id in the new RenderView.
2729 UpdateMaxPageIDIfNecessary(render_view_host); 2735 UpdateMaxPageIDIfNecessary(render_view_host);
2730 int32 max_page_id = 2736 int32 max_page_id =
2731 GetMaxPageIDForSiteInstance(render_view_host->GetSiteInstance()); 2737 GetMaxPageIDForSiteInstance(render_view_host->GetSiteInstance());
2732 2738
2739 content::RenderProcessHost* embedder_render_process_host =
2740 browser_plugin_host()->embedder_render_process_host();
2741 int embedder_process_id =
2742 embedder_render_process_host ? embedder_render_process_host->GetID() : -1;
2733 if (!static_cast<RenderViewHostImpl*>( 2743 if (!static_cast<RenderViewHostImpl*>(
2734 render_view_host)->CreateRenderView(string16(), 2744 render_view_host)->CreateRenderView(string16(),
2735 opener_route_id, 2745 opener_route_id,
2736 max_page_id, 2746 max_page_id,
2737 -1)) { 2747 embedder_process_id)) {
2738 return false; 2748 return false;
2739 } 2749 }
2740 2750
2741 #if defined(OS_LINUX) || defined(OS_OPENBSD) 2751 #if defined(OS_LINUX) || defined(OS_OPENBSD)
2742 // Force a ViewMsg_Resize to be sent, needed to make plugins show up on 2752 // Force a ViewMsg_Resize to be sent, needed to make plugins show up on
2743 // linux. See crbug.com/83941. 2753 // linux. See crbug.com/83941.
2744 if (rwh_view) { 2754 if (rwh_view) {
2745 if (RenderWidgetHost* render_widget_host = rwh_view->GetRenderWidgetHost()) 2755 if (RenderWidgetHost* render_widget_host = rwh_view->GetRenderWidgetHost())
2746 render_widget_host->WasResized(); 2756 render_widget_host->WasResized();
2747 } 2757 }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
2799 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { 2809 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) {
2800 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); 2810 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh);
2801 // Can be NULL during tests. 2811 // Can be NULL during tests.
2802 if (rwh_view) 2812 if (rwh_view)
2803 rwh_view->SetSize(GetView()->GetContainerSize()); 2813 rwh_view->SetSize(GetView()->GetContainerSize());
2804 } 2814 }
2805 2815
2806 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() { 2816 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() {
2807 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); 2817 return static_cast<RenderViewHostImpl*>(GetRenderViewHost());
2808 } 2818 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698