OLD | NEW |
1 // Copyright (c) 2012 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 #include "ppapi/proxy/interface_list.h" | 5 #include "ppapi/proxy/interface_list.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/hash.h" | 9 #include "base/hash.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 namespace ppapi { | 161 namespace ppapi { |
162 namespace proxy { | 162 namespace proxy { |
163 | 163 |
164 namespace { | 164 namespace { |
165 | 165 |
166 template<typename ProxyClass> | 166 template<typename ProxyClass> |
167 InterfaceProxy* ProxyFactory(Dispatcher* dispatcher) { | 167 InterfaceProxy* ProxyFactory(Dispatcher* dispatcher) { |
168 return new ProxyClass(dispatcher); | 168 return new ProxyClass(dispatcher); |
169 } | 169 } |
170 | 170 |
171 base::LazyInstance<PpapiPermissions> g_process_global_permissions; | 171 base::LazyInstance<PpapiPermissions>::DestructorAtExit |
| 172 g_process_global_permissions; |
172 | 173 |
173 } // namespace | 174 } // namespace |
174 | 175 |
175 InterfaceList::InterfaceList() { | 176 InterfaceList::InterfaceList() { |
176 memset(id_to_factory_, 0, sizeof(id_to_factory_)); | 177 memset(id_to_factory_, 0, sizeof(id_to_factory_)); |
177 | 178 |
178 // Register the API factories for each of the API types. This calls AddProxy | 179 // Register the API factories for each of the API types. This calls AddProxy |
179 // for each InterfaceProxy type we support. | 180 // for each InterfaceProxy type we support. |
180 #define PROXIED_API(api_name) \ | 181 #define PROXIED_API(api_name) \ |
181 AddProxy(PROXY_API_ID(api_name), &PROXY_FACTORY_NAME(api_name)); | 182 AddProxy(PROXY_API_ID(api_name), &PROXY_FACTORY_NAME(api_name)); |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 | 410 |
410 int InterfaceList::HashInterfaceName(const std::string& name) { | 411 int InterfaceList::HashInterfaceName(const std::string& name) { |
411 uint32_t data = base::Hash(name.c_str(), name.size()); | 412 uint32_t data = base::Hash(name.c_str(), name.size()); |
412 // Strip off the signed bit because UMA doesn't support negative values, | 413 // Strip off the signed bit because UMA doesn't support negative values, |
413 // but takes a signed int as input. | 414 // but takes a signed int as input. |
414 return static_cast<int>(data & 0x7fffffff); | 415 return static_cast<int>(data & 0x7fffffff); |
415 } | 416 } |
416 | 417 |
417 } // namespace proxy | 418 } // namespace proxy |
418 } // namespace ppapi | 419 } // namespace ppapi |
OLD | NEW |