| OLD | NEW |
| 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 // 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 // Module ---------------------------------------------------------------------- | 137 // Module ---------------------------------------------------------------------- |
| 138 | 138 |
| 139 Module::Module() : pp_module_(0), get_browser_interface_(NULL), core_(NULL) { | 139 Module::Module() : pp_module_(0), get_browser_interface_(NULL), core_(NULL) { |
| 140 } | 140 } |
| 141 | 141 |
| 142 Module::~Module() { | 142 Module::~Module() { |
| 143 delete core_; | 143 delete core_; |
| 144 core_ = NULL; | 144 core_ = NULL; |
| 145 } | 145 } |
| 146 | 146 |
| 147 bool Module::Init() { |
| 148 return true; |
| 149 } |
| 150 |
| 147 const void* Module::GetPluginInterface(const char* interface_name) { | 151 const void* Module::GetPluginInterface(const char* interface_name) { |
| 148 if (strcmp(interface_name, PPP_INSTANCE_INTERFACE) == 0) | 152 if (strcmp(interface_name, PPP_INSTANCE_INTERFACE) == 0) |
| 149 return &instance_interface; | 153 return &instance_interface; |
| 150 | 154 |
| 151 // Now see if anything was dynamically registered. | 155 // Now see if anything was dynamically registered. |
| 152 InterfaceMap::const_iterator found = additional_interfaces_.find( | 156 InterfaceMap::const_iterator found = additional_interfaces_.find( |
| 153 std::string(interface_name)); | 157 std::string(interface_name)); |
| 154 if (found != additional_interfaces_.end()) | 158 if (found != additional_interfaces_.end()) |
| 155 return found->second; | 159 return found->second; |
| 156 | 160 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 const PPB_Core* core = reinterpret_cast<const PPB_Core*>(GetBrowserInterface( | 195 const PPB_Core* core = reinterpret_cast<const PPB_Core*>(GetBrowserInterface( |
| 192 PPB_CORE_INTERFACE)); | 196 PPB_CORE_INTERFACE)); |
| 193 if (!core) | 197 if (!core) |
| 194 return false; | 198 return false; |
| 195 core_ = new Core(core); | 199 core_ = new Core(core); |
| 196 | 200 |
| 197 return Init(); | 201 return Init(); |
| 198 } | 202 } |
| 199 | 203 |
| 200 } // namespace pp | 204 } // namespace pp |
| OLD | NEW |