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

Side by Side Diff: chrome/browser/extensions/extension_service.cc

Issue 7978009: Split ppapi::PluginList from PepperPluginRegistry so that DRT could load pepper plugins. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 3 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/extensions/extension_service.h" 5 #include "chrome/browser/extensions/extension_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 #include "chrome/common/url_constants.h" 76 #include "chrome/common/url_constants.h"
77 #include "content/browser/browser_thread.h" 77 #include "content/browser/browser_thread.h"
78 #include "content/browser/debugger/devtools_manager.h" 78 #include "content/browser/debugger/devtools_manager.h"
79 #include "content/browser/plugin_process_host.h" 79 #include "content/browser/plugin_process_host.h"
80 #include "content/browser/plugin_service.h" 80 #include "content/browser/plugin_service.h"
81 #include "content/browser/renderer_host/render_process_host.h" 81 #include "content/browser/renderer_host/render_process_host.h"
82 #include "content/browser/user_metrics.h" 82 #include "content/browser/user_metrics.h"
83 #include "content/common/content_notification_types.h" 83 #include "content/common/content_notification_types.h"
84 #include "content/common/json_value_serializer.h" 84 #include "content/common/json_value_serializer.h"
85 #include "content/common/notification_service.h" 85 #include "content/common/notification_service.h"
86 #include "content/common/pepper_plugin_registry.h"
87 #include "googleurl/src/gurl.h" 86 #include "googleurl/src/gurl.h"
88 #include "net/base/registry_controlled_domain.h" 87 #include "net/base/registry_controlled_domain.h"
89 #include "webkit/database/database_tracker.h" 88 #include "webkit/database/database_tracker.h"
90 #include "webkit/database/database_util.h" 89 #include "webkit/database/database_util.h"
91 #include "webkit/plugins/npapi/plugin_list.h" 90 #include "webkit/plugins/npapi/plugin_list.h"
91 #include "webkit/plugins/ppapi/ppapi_plugin_info.h"
92 92
93 #if defined(OS_CHROMEOS) 93 #if defined(OS_CHROMEOS)
94 #include "chrome/browser/chromeos/cros/cros_library.h" 94 #include "chrome/browser/chromeos/cros/cros_library.h"
95 #include "chrome/browser/chromeos/extensions/file_browser_event_router.h" 95 #include "chrome/browser/chromeos/extensions/file_browser_event_router.h"
96 #include "chrome/browser/chromeos/extensions/input_method_event_router.h" 96 #include "chrome/browser/chromeos/extensions/input_method_event_router.h"
97 #include "chrome/browser/chromeos/extensions/media_player_event_router.h" 97 #include "chrome/browser/chromeos/extensions/media_player_event_router.h"
98 #include "chrome/browser/chromeos/input_method/input_method_manager.h" 98 #include "chrome/browser/chromeos/input_method/input_method_manager.h"
99 #include "chrome/browser/extensions/extension_input_ime_api.h" 99 #include "chrome/browser/extensions/extension_input_ime_api.h"
100 #include "webkit/fileapi/file_system_context.h" 100 #include "webkit/fileapi/file_system_context.h"
101 #include "webkit/fileapi/file_system_mount_point_provider.h" 101 #include "webkit/fileapi/file_system_mount_point_provider.h"
(...skipping 2729 matching lines...) Expand 10 before | Expand all | Expand 10 after
2831 nacl_module_list_.push_front(info); 2831 nacl_module_list_.push_front(info);
2832 } 2832 }
2833 2833
2834 void ExtensionService::UnregisterNaClModule(const GURL& url) { 2834 void ExtensionService::UnregisterNaClModule(const GURL& url) {
2835 NaClModuleInfoList::iterator iter = FindNaClModule(url); 2835 NaClModuleInfoList::iterator iter = FindNaClModule(url);
2836 DCHECK(iter != nacl_module_list_.end()); 2836 DCHECK(iter != nacl_module_list_.end());
2837 nacl_module_list_.erase(iter); 2837 nacl_module_list_.erase(iter);
2838 } 2838 }
2839 2839
2840 void ExtensionService::UpdatePluginListWithNaClModules() { 2840 void ExtensionService::UpdatePluginListWithNaClModules() {
2841 /*
2841 // An extension has been added which has a nacl_module component, which means 2842 // An extension has been added which has a nacl_module component, which means
2842 // there is a MIME type that module wants to handle, so we need to add that 2843 // there is a MIME type that module wants to handle, so we need to add that
2843 // MIME type to plugins which handle NaCl modules in order to allow the 2844 // MIME type to plugins which handle NaCl modules in order to allow the
2844 // individual modules to handle these types. 2845 // individual modules to handle these types.
2845 const PepperPluginInfo* pepper_info = NULL; 2846 const webkit::ppapi::PluginInfo* pepper_info = NULL;
2846 std::vector<PepperPluginInfo> plugins; 2847 std::vector<webkit::ppapi::PluginInfo> plugins;
2847 PepperPluginRegistry::ComputeList(&plugins); 2848 webkit::ppapi::PluginRegistry::ComputeList(&plugins);
2848 2849
2849 // Search the entire plugin list for plugins that handle the NaCl MIME type. 2850 // Search the entire plugin list for plugins that handle the NaCl MIME type.
2850 // There can be multiple plugins like this, for instance the internal NaCl 2851 // There can be multiple plugins like this, for instance the internal NaCl
2851 // plugin and a plugin registered by --register-pepper-plugins during tests. 2852 // plugin and a plugin registered by --register-pepper-plugins during tests.
2852 for (size_t i = 0; i < plugins.size(); ++i) { 2853 for (size_t i = 0; i < plugins.size(); ++i) {
2853 pepper_info = &plugins[i]; 2854 pepper_info = &plugins[i];
2854 CHECK(pepper_info); 2855 CHECK(pepper_info);
2855 std::vector<webkit::WebPluginMimeType>::const_iterator mime_iter; 2856 std::vector<webkit::WebPluginMimeType>::const_iterator mime_iter;
2856 // Check each MIME type the plugins handle for the NaCl MIME type. 2857 // Check each MIME type the plugins handle for the NaCl MIME type.
2857 for (mime_iter = pepper_info->mime_types.begin(); 2858 for (mime_iter = pepper_info->mime_types.begin();
(...skipping 20 matching lines...) Expand all
2878 info.mime_types.push_back(mime_type_info); 2879 info.mime_types.push_back(mime_type_info);
2879 } 2880 }
2880 2881
2881 webkit::npapi::PluginList::Singleton()->RefreshPlugins(); 2882 webkit::npapi::PluginList::Singleton()->RefreshPlugins();
2882 webkit::npapi::PluginList::Singleton()->RegisterInternalPlugin(info); 2883 webkit::npapi::PluginList::Singleton()->RegisterInternalPlugin(info);
2883 // This plugin has been modified, no need to check the rest of its 2884 // This plugin has been modified, no need to check the rest of its
2884 // types, but continue checking other plugins. 2885 // types, but continue checking other plugins.
2885 break; 2886 break;
2886 } 2887 }
2887 } 2888 }
2888 } 2889 }*/
2889 } 2890 }
2890 2891
2891 ExtensionService::NaClModuleInfoList::iterator 2892 ExtensionService::NaClModuleInfoList::iterator
2892 ExtensionService::FindNaClModule(const GURL& url) { 2893 ExtensionService::FindNaClModule(const GURL& url) {
2893 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); 2894 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin();
2894 iter != nacl_module_list_.end(); ++iter) { 2895 iter != nacl_module_list_.end(); ++iter) {
2895 if (iter->url == url) 2896 if (iter->url == url)
2896 return iter; 2897 return iter;
2897 } 2898 }
2898 return nacl_module_list_.end(); 2899 return nacl_module_list_.end();
2899 } 2900 }
OLDNEW
« no previous file with comments | « chrome/browser/component_updater/pepper_flash_component_installer.cc ('k') | chrome/common/chrome_content_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698