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

Side by Side Diff: ppapi/proxy/interface_list.cc

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again Created 3 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
« no previous file with comments | « net/url_request/url_fetcher_core.cc ('k') | ppapi/shared_impl/ppapi_globals.cc » ('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) 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
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
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
OLDNEW
« no previous file with comments | « net/url_request/url_fetcher_core.cc ('k') | ppapi/shared_impl/ppapi_globals.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698