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

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 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after
1705 return l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME); 1707 return l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME);
1706 } 1708 }
1707 1709
1708 void ChromeContentBrowserClient::DidCreatePpapiPlugin( 1710 void ChromeContentBrowserClient::DidCreatePpapiPlugin(
1709 content::BrowserPpapiHost* browser_host) { 1711 content::BrowserPpapiHost* browser_host) {
1710 browser_host->GetPpapiHost()->AddHostFactoryFilter( 1712 browser_host->GetPpapiHost()->AddHostFactoryFilter(
1711 scoped_ptr<ppapi::host::HostFactory>( 1713 scoped_ptr<ppapi::host::HostFactory>(
1712 new ChromeBrowserPepperHostFactory(browser_host))); 1714 new ChromeBrowserPepperHostFactory(browser_host)));
1713 } 1715 }
1714 1716
1717 content::BrowserPpapiHost*
1718 ChromeContentBrowserClient::GetExternalBrowserPpapiHost(
1719 int plugin_process_id) {
1720 for (NaClProcessHostIterator iter; !iter.Done(); ++iter) {
1721 if (iter->process() &&
1722 iter->process()->GetData().id == plugin_process_id) {
1723 // Found the plugin.
1724 return iter->browser_ppapi_host();
1725 }
1726 }
1727
1728 return NULL;
1729 }
1730
1715 bool ChromeContentBrowserClient::AllowPepperSocketAPI( 1731 bool ChromeContentBrowserClient::AllowPepperSocketAPI(
1716 content::BrowserContext* browser_context, 1732 content::BrowserContext* browser_context,
1717 const GURL& url, 1733 const GURL& url,
1718 const content::SocketPermissionRequest& params) { 1734 const content::SocketPermissionRequest& params) {
1719 if (!url.is_valid()) 1735 if (!url.is_valid())
1720 return false; 1736 return false;
1721 1737
1722 std::string host = url.host(); 1738 std::string host = url.host();
1723 if (url.SchemeIs(kExtensionScheme) && allowed_socket_origins_.count(host)) 1739 if (url.SchemeIs(kExtensionScheme) && allowed_socket_origins_.count(host))
1724 return true; 1740 return true;
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
1886 partition_id = extension->id(); 1902 partition_id = extension->id();
1887 } 1903 }
1888 1904
1889 // Enforce that IsValidStoragePartitionId() implementation stays in sync. 1905 // Enforce that IsValidStoragePartitionId() implementation stays in sync.
1890 DCHECK(IsValidStoragePartitionId(browser_context, partition_id)); 1906 DCHECK(IsValidStoragePartitionId(browser_context, partition_id));
1891 return partition_id; 1907 return partition_id;
1892 } 1908 }
1893 1909
1894 1910
1895 } // namespace chrome 1911 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698