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

Side by Side Diff: ppapi/cpp/module.cc

Issue 9381010: Convert resources to take an instance key instead of an Instance*. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: USELESS PATCH TITLE Created 8 years, 9 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 | « ppapi/cpp/module.h ('k') | ppapi/cpp/mouse_lock.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) 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 // Note that the single accessor, Module::Get(), is not actually implemented 5 // Note that the single accessor, Module::Get(), is not actually implemented
6 // in this file. This is an intentional hook that allows users of ppapi's 6 // in this file. This is an intentional hook that allows users of ppapi's
7 // C++ wrapper objects to provide difference semantics for how the singleton 7 // C++ wrapper objects to provide difference semantics for how the singleton
8 // object is accessed. 8 // object is accessed.
9 // 9 //
10 // In general, users of ppapi will also link in ppp_entrypoints.cc, which 10 // In general, users of ppapi will also link in ppp_entrypoints.cc, which
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 131
132 // PPP_Messaging implementation ------------------------------------------------ 132 // PPP_Messaging implementation ------------------------------------------------
133 133
134 void Messaging_HandleMessage(PP_Instance pp_instance, PP_Var var) { 134 void Messaging_HandleMessage(PP_Instance pp_instance, PP_Var var) {
135 Module* module_singleton = Module::Get(); 135 Module* module_singleton = Module::Get();
136 if (!module_singleton) 136 if (!module_singleton)
137 return; 137 return;
138 Instance* instance = module_singleton->InstanceForPPInstance(pp_instance); 138 Instance* instance = module_singleton->InstanceForPPInstance(pp_instance);
139 if (!instance) 139 if (!instance)
140 return; 140 return;
141 instance->HandleMessage(Var(Var::PassRef(), var)); 141 instance->HandleMessage(Var(PASS_REF, var));
142 } 142 }
143 143
144 static PPP_Messaging instance_messaging_interface = { 144 static PPP_Messaging instance_messaging_interface = {
145 &Messaging_HandleMessage 145 &Messaging_HandleMessage
146 }; 146 };
147 147
148 // Module ---------------------------------------------------------------------- 148 // Module ----------------------------------------------------------------------
149 149
150 Module::Module() : pp_module_(0), get_browser_interface_(NULL), core_(NULL) { 150 Module::Module() : pp_module_(0), get_browser_interface_(NULL), core_(NULL) {
151 } 151 }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 const PPB_Core* core = reinterpret_cast<const PPB_Core*>(GetBrowserInterface( 210 const PPB_Core* core = reinterpret_cast<const PPB_Core*>(GetBrowserInterface(
211 PPB_CORE_INTERFACE)); 211 PPB_CORE_INTERFACE));
212 if (!core) 212 if (!core)
213 return false; 213 return false;
214 core_ = new Core(core); 214 core_ = new Core(core);
215 215
216 return Init(); 216 return Init();
217 } 217 }
218 218
219 } // namespace pp 219 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/cpp/module.h ('k') | ppapi/cpp/mouse_lock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698