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

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 11368019: Add support for external out-of-process PPAPI plugins in the browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month 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 "chrome/browser/chrome_content_browser_client.h" 5 #include "chrome/browser/chrome_content_browser_client.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 22 matching lines...) Expand all
33 #include "chrome/browser/extensions/extension_process_manager.h" 33 #include "chrome/browser/extensions/extension_process_manager.h"
34 #include "chrome/browser/extensions/extension_service.h" 34 #include "chrome/browser/extensions/extension_service.h"
35 #include "chrome/browser/extensions/extension_system.h" 35 #include "chrome/browser/extensions/extension_system.h"
36 #include "chrome/browser/extensions/extension_web_ui.h" 36 #include "chrome/browser/extensions/extension_web_ui.h"
37 #include "chrome/browser/extensions/extension_webkit_preferences.h" 37 #include "chrome/browser/extensions/extension_webkit_preferences.h"
38 #include "chrome/browser/extensions/message_handler.h" 38 #include "chrome/browser/extensions/message_handler.h"
39 #include "chrome/browser/geolocation/chrome_access_token_store.h" 39 #include "chrome/browser/geolocation/chrome_access_token_store.h"
40 #include "chrome/browser/google/google_util.h" 40 #include "chrome/browser/google/google_util.h"
41 #include "chrome/browser/infobars/infobar_tab_helper.h" 41 #include "chrome/browser/infobars/infobar_tab_helper.h"
42 #include "chrome/browser/media/media_internals.h" 42 #include "chrome/browser/media/media_internals.h"
43 #include "chrome/browser/nacl_host/nacl_process_host.h"
43 #include "chrome/browser/net/chrome_net_log.h" 44 #include "chrome/browser/net/chrome_net_log.h"
44 #include "chrome/browser/notifications/desktop_notification_service.h" 45 #include "chrome/browser/notifications/desktop_notification_service.h"
45 #include "chrome/browser/notifications/desktop_notification_service_factory.h" 46 #include "chrome/browser/notifications/desktop_notification_service_factory.h"
46 #include "chrome/browser/pepper_gtalk_message_filter.h" 47 #include "chrome/browser/pepper_gtalk_message_filter.h"
47 #include "chrome/browser/platform_util.h" 48 #include "chrome/browser/platform_util.h"
48 #include "chrome/browser/prefs/pref_service.h" 49 #include "chrome/browser/prefs/pref_service.h"
49 #include "chrome/browser/prefs/scoped_user_pref_update.h" 50 #include "chrome/browser/prefs/scoped_user_pref_update.h"
50 #include "chrome/browser/prerender/prerender_manager.h" 51 #include "chrome/browser/prerender/prerender_manager.h"
51 #include "chrome/browser/prerender/prerender_manager_factory.h" 52 #include "chrome/browser/prerender/prerender_manager_factory.h"
52 #include "chrome/browser/prerender/prerender_message_filter.h" 53 #include "chrome/browser/prerender/prerender_message_filter.h"
(...skipping 29 matching lines...) Expand all
82 #include "chrome/common/extensions/extension_set.h" 83 #include "chrome/common/extensions/extension_set.h"
83 #include "chrome/common/extensions/permissions/socket_permission.h" 84 #include "chrome/common/extensions/permissions/socket_permission.h"
84 #include "chrome/common/logging_chrome.h" 85 #include "chrome/common/logging_chrome.h"
85 #include "chrome/common/pref_names.h" 86 #include "chrome/common/pref_names.h"
86 #include "chrome/common/render_messages.h" 87 #include "chrome/common/render_messages.h"
87 #include "chrome/common/url_constants.h" 88 #include "chrome/common/url_constants.h"
88 #include "content/public/browser/browser_child_process_host.h" 89 #include "content/public/browser/browser_child_process_host.h"
89 #include "content/public/browser/browser_main_parts.h" 90 #include "content/public/browser/browser_main_parts.h"
90 #include "content/public/browser/browser_ppapi_host.h" 91 #include "content/public/browser/browser_ppapi_host.h"
91 #include "content/public/browser/browser_url_handler.h" 92 #include "content/public/browser/browser_url_handler.h"
93 #include "content/public/browser/child_process_data.h"
92 #include "content/public/browser/child_process_security_policy.h" 94 #include "content/public/browser/child_process_security_policy.h"
93 #include "content/public/browser/compositor_util.h" 95 #include "content/public/browser/compositor_util.h"
94 #include "content/public/browser/render_process_host.h" 96 #include "content/public/browser/render_process_host.h"
95 #include "content/public/browser/render_view_host.h" 97 #include "content/public/browser/render_view_host.h"
96 #include "content/public/browser/resource_context.h" 98 #include "content/public/browser/resource_context.h"
97 #include "content/public/browser/site_instance.h" 99 #include "content/public/browser/site_instance.h"
98 #include "content/public/browser/web_contents.h" 100 #include "content/public/browser/web_contents.h"
99 #include "content/public/browser/web_contents_view.h" 101 #include "content/public/browser/web_contents_view.h"
100 #include "content/public/common/child_process_host.h" 102 #include "content/public/common/child_process_host.h"
101 #include "content/public/common/content_descriptors.h" 103 #include "content/public/common/content_descriptors.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 #if defined(OS_ANDROID) 142 #if defined(OS_ANDROID)
141 #include "ui/base/ui_base_paths.h" 143 #include "ui/base/ui_base_paths.h"
142 #endif 144 #endif
143 145
144 #if defined(USE_NSS) 146 #if defined(USE_NSS)
145 #include "chrome/browser/ui/crypto_module_password_dialog.h" 147 #include "chrome/browser/ui/crypto_module_password_dialog.h"
146 #endif 148 #endif
147 149
148 using base::FileDescriptor; 150 using base::FileDescriptor;
149 using content::AccessTokenStore; 151 using content::AccessTokenStore;
152 using content::BrowserChildProcessHostIterator;
150 using content::BrowserThread; 153 using content::BrowserThread;
151 using content::BrowserURLHandler; 154 using content::BrowserURLHandler;
152 using content::ChildProcessSecurityPolicy; 155 using content::ChildProcessSecurityPolicy;
153 using content::FileDescriptorInfo; 156 using content::FileDescriptorInfo;
154 using content::QuotaPermissionContext; 157 using content::QuotaPermissionContext;
155 using content::RenderViewHost; 158 using content::RenderViewHost;
156 using content::SiteInstance; 159 using content::SiteInstance;
157 using content::WebContents; 160 using content::WebContents;
158 using extensions::APIPermission; 161 using extensions::APIPermission;
159 using extensions::Extension; 162 using extensions::Extension;
(...skipping 1545 matching lines...) Expand 10 before | Expand all | Expand 10 after
1705 return l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME); 1708 return l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME);
1706 } 1709 }
1707 1710
1708 void ChromeContentBrowserClient::DidCreatePpapiPlugin( 1711 void ChromeContentBrowserClient::DidCreatePpapiPlugin(
1709 content::BrowserPpapiHost* browser_host) { 1712 content::BrowserPpapiHost* browser_host) {
1710 browser_host->GetPpapiHost()->AddHostFactoryFilter( 1713 browser_host->GetPpapiHost()->AddHostFactoryFilter(
1711 scoped_ptr<ppapi::host::HostFactory>( 1714 scoped_ptr<ppapi::host::HostFactory>(
1712 new ChromeBrowserPepperHostFactory(browser_host))); 1715 new ChromeBrowserPepperHostFactory(browser_host)));
1713 } 1716 }
1714 1717
1718 content::BrowserPpapiHost*
1719 ChromeContentBrowserClient::GetExternalBrowserPpapiHost(
1720 int plugin_process_id) {
1721 BrowserChildProcessHostIterator iter(content::PROCESS_TYPE_NACL_LOADER);
1722 while (!iter.Done()) {
1723 NaClProcessHost* host = static_cast<NaClProcessHost*>(iter.GetDelegate());
1724 if (host->process() &&
1725 host->process()->GetData().id == plugin_process_id) {
1726 // Found the plugin.
1727 return host->browser_ppapi_host();
1728 }
1729 ++iter;
1730 }
1731 return NULL;
1732 }
1733
1715 bool ChromeContentBrowserClient::AllowPepperSocketAPI( 1734 bool ChromeContentBrowserClient::AllowPepperSocketAPI(
1716 content::BrowserContext* browser_context, 1735 content::BrowserContext* browser_context,
1717 const GURL& url, 1736 const GURL& url,
1718 const content::SocketPermissionRequest& params) { 1737 const content::SocketPermissionRequest& params) {
1719 if (!url.is_valid()) 1738 if (!url.is_valid())
1720 return false; 1739 return false;
1721 1740
1722 std::string host = url.host(); 1741 std::string host = url.host();
1723 if (url.SchemeIs(kExtensionScheme) && allowed_socket_origins_.count(host)) 1742 if (url.SchemeIs(kExtensionScheme) && allowed_socket_origins_.count(host))
1724 return true; 1743 return true;
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
1886 partition_id = extension->id(); 1905 partition_id = extension->id();
1887 } 1906 }
1888 1907
1889 // Enforce that IsValidStoragePartitionId() implementation stays in sync. 1908 // Enforce that IsValidStoragePartitionId() implementation stays in sync.
1890 DCHECK(IsValidStoragePartitionId(browser_context, partition_id)); 1909 DCHECK(IsValidStoragePartitionId(browser_context, partition_id));
1891 return partition_id; 1910 return partition_id;
1892 } 1911 }
1893 1912
1894 1913
1895 } // namespace chrome 1914 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | chrome/browser/nacl_host/nacl_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698