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

Side by Side Diff: webkit/glue/plugins/pepper_plugin_module.cc

Issue 2072010: Update Chrome to use the new int64-typedefed module, instance, and resources ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 7 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
« no previous file with comments | « webkit/glue/plugins/pepper_plugin_module.h ('k') | webkit/glue/plugins/pepper_resource.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "webkit/glue/plugins/pepper_plugin_module.h" 5 #include "webkit/glue/plugins/pepper_plugin_module.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/scoped_ptr.h" 10 #include "base/scoped_ptr.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 // FIXME(brettw) do uniquifying of the plugin here like the NPAPI one. 115 // FIXME(brettw) do uniquifying of the plugin here like the NPAPI one.
116 116
117 scoped_refptr<PluginModule> lib(new PluginModule(filename)); 117 scoped_refptr<PluginModule> lib(new PluginModule(filename));
118 if (!lib->Load()) 118 if (!lib->Load())
119 lib = NULL; 119 lib = NULL;
120 return lib; 120 return lib;
121 } 121 }
122 122
123 // static 123 // static
124 PluginModule* PluginModule::FromPPModule(PP_Module module) { 124 PluginModule* PluginModule::FromPPModule(PP_Module module) {
125 PluginModule* lib = reinterpret_cast<PluginModule*>(module.id); 125 PluginModule* lib = reinterpret_cast<PluginModule*>(module);
126 if (GetLivePluginSet()->find(lib) == GetLivePluginSet()->end()) 126 if (GetLivePluginSet()->find(lib) == GetLivePluginSet()->end())
127 return NULL; // Invalid plugin. 127 return NULL; // Invalid plugin.
128 return lib; 128 return lib;
129 } 129 }
130 130
131 bool PluginModule::Load() { 131 bool PluginModule::Load() {
132 if (initialized_) 132 if (initialized_)
133 return true; 133 return true;
134 initialized_ = true; 134 initialized_ = true;
135 135
(...skipping 23 matching lines...) Expand all
159 int retval = initialize_module(GetPPModule(), &GetInterface); 159 int retval = initialize_module(GetPPModule(), &GetInterface);
160 if (retval != 0) { 160 if (retval != 0) {
161 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; 161 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval;
162 return false; 162 return false;
163 } 163 }
164 164
165 return true; 165 return true;
166 } 166 }
167 167
168 PP_Module PluginModule::GetPPModule() const { 168 PP_Module PluginModule::GetPPModule() const {
169 PP_Module ret; 169 return reinterpret_cast<intptr_t>(this);
170 ret.id = reinterpret_cast<intptr_t>(this);
171 return ret;
172 } 170 }
173 171
174 PluginInstance* PluginModule::CreateInstance(PluginDelegate* delegate) { 172 PluginInstance* PluginModule::CreateInstance(PluginDelegate* delegate) {
175 const PPP_Instance* plugin_instance_interface = 173 const PPP_Instance* plugin_instance_interface =
176 reinterpret_cast<const PPP_Instance*>(GetPluginInterface( 174 reinterpret_cast<const PPP_Instance*>(GetPluginInterface(
177 PPP_INSTANCE_INTERFACE)); 175 PPP_INSTANCE_INTERFACE));
178 if (!plugin_instance_interface) { 176 if (!plugin_instance_interface) {
179 LOG(WARNING) << "Plugin doesn't support instance interface, failing."; 177 LOG(WARNING) << "Plugin doesn't support instance interface, failing.";
180 return NULL; 178 return NULL;
181 } 179 }
(...skipping 15 matching lines...) Expand all
197 195
198 void PluginModule::InstanceCreated(PluginInstance* instance) { 196 void PluginModule::InstanceCreated(PluginInstance* instance) {
199 instances_.insert(instance); 197 instances_.insert(instance);
200 } 198 }
201 199
202 void PluginModule::InstanceDeleted(PluginInstance* instance) { 200 void PluginModule::InstanceDeleted(PluginInstance* instance) {
203 instances_.erase(instance); 201 instances_.erase(instance);
204 } 202 }
205 203
206 } // namespace pepper 204 } // namespace pepper
OLDNEW
« no previous file with comments | « webkit/glue/plugins/pepper_plugin_module.h ('k') | webkit/glue/plugins/pepper_resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698