| OLD | NEW |
| 1 // Copyright (c) 2011 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 // 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 different 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 |
| 11 // provides a simple default implementation of Module::Get(). | 11 // provides a simple default implementation of Module::Get(). |
| 12 // | 12 // |
| 13 // A notable exception where the default ppp_entrypoints will not work is | 13 // A notable exception where the default ppp_entrypoints will not work is |
| 14 // when implementing "internal plugins" that are statically linked into the | 14 // when implementing "internal plugins" that are statically linked into the |
| 15 // browser. In this case, the process may actually have multiple Modules | 15 // browser. In this case, the process may actually have multiple Modules |
| 16 // loaded at once making a traditional "singleton" unworkable. To get around | 16 // loaded at once making a traditional "singleton" unworkable. To get around |
| 17 // this, the users of ppapi need to get creative about how to properly | 17 // this, the users of ppapi need to get creative about how to properly |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |