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

Unified Diff: webkit/plugins/ppapi/plugin_module.cc

Issue 7189045: Make o.o.p. proxy handle PPP_Instance versions 0.4 and 0.5. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merged Created 9 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/shared_impl/ppp_instance_combined.cc ('k') | webkit/plugins/ppapi/ppapi_plugin_instance.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/plugin_module.cc
diff --git a/webkit/plugins/ppapi/plugin_module.cc b/webkit/plugins/ppapi/plugin_module.cc
index b9df850e5d90b381249ac107a0fae9720514c93e..340d0e440d8879d37862bf7681d71f9703792598 100644
--- a/webkit/plugins/ppapi/plugin_module.cc
+++ b/webkit/plugins/ppapi/plugin_module.cc
@@ -213,21 +213,12 @@ const PPB_Testing_Dev testing_interface = {
&GetLiveObjectsForInstance
};
-// Return the part of the interface name before the ';' separator.
-// If there is no ';', just returns the whole string.
-std::string GetInterfacePrefix(const std::string& interface_string) {
- size_t separator_pos = interface_string.find_first_of(';');
- return interface_string.substr(0, separator_pos);
-}
-
// GetInterface ----------------------------------------------------------------
const void* GetInterface(const char* name) {
// All interfaces should be used on the main thread.
DCHECK(IsMainThread());
- std::string name_prefix(GetInterfacePrefix(name));
-
// Allow custom interface factories first stab at the GetInterface call.
const void* custom_interface =
PpapiInterfaceFactoryManager::GetInstance()->GetInterface(name);
@@ -490,21 +481,14 @@ PluginModule::GetInterfaceFunc PluginModule::GetLocalGetInterfaceFunc() {
PluginInstance* PluginModule::CreateInstance(PluginDelegate* delegate) {
PluginInstance* instance(NULL);
- const void* plugin_instance_if =
- GetPluginInterface(PPP_INSTANCE_INTERFACE_0_5);
- if (plugin_instance_if) {
- instance = new PluginInstance(delegate, this,
- PluginInstance::new_instance_interface<PPP_Instance_0_5>(
- plugin_instance_if));
+ const void* ppp_instance = GetPluginInterface(PPP_INSTANCE_INTERFACE_0_5);
+ if (ppp_instance) {
+ instance = PluginInstance::Create0_5(delegate, this, ppp_instance);
} else {
- // If the current interface is not supported, try retrieving older versions.
- const void* instance_if_0_4 =
- GetPluginInterface(PPP_INSTANCE_INTERFACE_0_4);
- if (instance_if_0_4) {
- instance = new PluginInstance(delegate, this,
- PluginInstance::new_instance_interface<PPP_Instance_0_4>(
- instance_if_0_4));
- }
+ // If the 0.5 interface is not supported, try retrieving 0.4.
+ ppp_instance = GetPluginInterface(PPP_INSTANCE_INTERFACE_0_4);
+ if (ppp_instance)
+ instance = PluginInstance::Create0_4(delegate, this, ppp_instance);
}
if (!instance) {
LOG(WARNING) << "Plugin doesn't support instance interface, failing.";
« no previous file with comments | « ppapi/shared_impl/ppp_instance_combined.cc ('k') | webkit/plugins/ppapi/ppapi_plugin_instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698