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

Side by Side Diff: chrome/browser/nacl_host/nacl_browser_delegate_impl.cc

Issue 105553005: Make PepperWebPlugin not use RenderViews. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: review comments Created 7 years 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/nacl_host/nacl_browser_delegate_impl.h" 5 #include "chrome/browser/nacl_host/nacl_browser_delegate_impl.h"
6 6
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/strings/string_split.h" 8 #include "base/strings/string_split.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
11 #include "chrome/browser/component_updater/pnacl/pnacl_component_installer.h" 11 #include "chrome/browser/component_updater/pnacl/pnacl_component_installer.h"
12 #include "chrome/browser/extensions/extension_service.h" 12 #include "chrome/browser/extensions/extension_service.h"
13 #include "chrome/browser/extensions/extension_system.h" 13 #include "chrome/browser/extensions/extension_system.h"
14 #include "chrome/browser/nacl_host/nacl_infobar_delegate.h" 14 #include "chrome/browser/nacl_host/nacl_infobar_delegate.h"
15 #include "chrome/browser/profiles/profile.h" 15 #include "chrome/browser/profiles/profile.h"
16 #include "chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory .h" 16 #include "chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory .h"
17 #include "chrome/common/chrome_paths.h" 17 #include "chrome/common/chrome_paths.h"
18 #include "chrome/common/chrome_paths_internal.h" 18 #include "chrome/common/chrome_paths_internal.h"
19 #include "chrome/common/chrome_version_info.h" 19 #include "chrome/common/chrome_version_info.h"
20 #include "chrome/common/logging_chrome.h" 20 #include "chrome/common/logging_chrome.h"
21 #include "content/public/browser/browser_thread.h" 21 #include "content/public/browser/browser_thread.h"
22 #include "content/public/browser/render_view_host.h" 22 #include "content/public/browser/render_frame_host.h"
23 #include "content/public/browser/site_instance.h" 23 #include "content/public/browser/site_instance.h"
24 #include "extensions/browser/info_map.h" 24 #include "extensions/browser/info_map.h"
25 #include "extensions/browser/process_manager.h" 25 #include "extensions/browser/process_manager.h"
26 #include "extensions/common/constants.h" 26 #include "extensions/common/constants.h"
27 #include "extensions/common/extension.h" 27 #include "extensions/common/extension.h"
28 #include "extensions/common/manifest_handlers/shared_module_info.h" 28 #include "extensions/common/manifest_handlers/shared_module_info.h"
29 #include "extensions/common/url_pattern.h" 29 #include "extensions/common/url_pattern.h"
30 #include "ppapi/c/private/ppb_nacl_private.h" 30 #include "ppapi/c/private/ppb_nacl_private.h"
31 31
32 using extensions::SharedModuleInfo; 32 using extensions::SharedModuleInfo;
(...skipping 18 matching lines...) Expand all
51 const content::BrowserPpapiHost::OnKeepaliveInstanceData& instance_data, 51 const content::BrowserPpapiHost::OnKeepaliveInstanceData& instance_data,
52 const base::FilePath& profile_data_directory) { 52 const base::FilePath& profile_data_directory) {
53 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 53 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
54 54
55 // Only one instance will exist for NaCl embeds, even when more than one 55 // Only one instance will exist for NaCl embeds, even when more than one
56 // embed of the same plugin exists on the same page. 56 // embed of the same plugin exists on the same page.
57 DCHECK(instance_data.size() == 1); 57 DCHECK(instance_data.size() == 1);
58 if (instance_data.size() < 1) 58 if (instance_data.size() < 1)
59 return; 59 return;
60 60
61 content::RenderViewHost* render_view_host = content::RenderViewHost::FromID( 61 content::RenderFrameHost* render_frame_host =
62 instance_data[0].render_process_id, instance_data[0].render_view_id); 62 content::RenderFrameHost::FromID(
63 if (!render_view_host) 63 instance_data[0].render_process_id, instance_data[0].render_frame_id);
64 if (!render_frame_host)
64 return; 65 return;
65 66
66 content::SiteInstance* site_instance = render_view_host->GetSiteInstance(); 67 content::SiteInstance* site_instance = render_frame_host->GetSiteInstance();
67 if (!site_instance) 68 if (!site_instance)
68 return; 69 return;
69 70
70 extensions::ExtensionSystem* extension_system = 71 extensions::ExtensionSystem* extension_system =
71 extensions::ExtensionSystem::GetForBrowserContext( 72 extensions::ExtensionSystem::GetForBrowserContext(
72 site_instance->GetBrowserContext()); 73 site_instance->GetBrowserContext());
73 if (!extension_system) 74 if (!extension_system)
74 return; 75 return;
75 76
76 const ExtensionService* extension_service = 77 const ExtensionService* extension_service =
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 return false; 257 return false;
257 258
258 *file_path = resource_file_path; 259 *file_path = resource_file_path;
259 return true; 260 return true;
260 } 261 }
261 262
262 content::BrowserPpapiHost::OnKeepaliveCallback 263 content::BrowserPpapiHost::OnKeepaliveCallback
263 NaClBrowserDelegateImpl::GetOnKeepaliveCallback() { 264 NaClBrowserDelegateImpl::GetOnKeepaliveCallback() {
264 return base::Bind(&OnKeepalive); 265 return base::Bind(&OnKeepalive);
265 } 266 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698