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

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

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 years, 3 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_request_job_manager.cc ('k') | ppapi/proxy/plugin_resource_tracker.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) 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 "base/hash.h" 7 #include "base/hash.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/memory/singleton.h" 9 #include "base/memory/singleton.h"
10 #include "ppapi/c/dev/ppb_audio_input_dev.h" 10 #include "ppapi/c/dev/ppb_audio_input_dev.h"
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 #endif 311 #endif
312 } 312 }
313 313
314 InterfaceList::~InterfaceList() { 314 InterfaceList::~InterfaceList() {
315 } 315 }
316 316
317 // static 317 // static
318 InterfaceList* InterfaceList::GetInstance() { 318 InterfaceList* InterfaceList::GetInstance() {
319 // CAUTION: This function is called without the ProxyLock to avoid excessive 319 // CAUTION: This function is called without the ProxyLock to avoid excessive
320 // excessive locking from C++ wrappers. (See also GetBrowserInterface.) 320 // excessive locking from C++ wrappers. (See also GetBrowserInterface.)
321 return Singleton<InterfaceList>::get(); 321 return base::Singleton<InterfaceList>::get();
322 } 322 }
323 323
324 // static 324 // static
325 void InterfaceList::SetProcessGlobalPermissions( 325 void InterfaceList::SetProcessGlobalPermissions(
326 const PpapiPermissions& permissions) { 326 const PpapiPermissions& permissions) {
327 g_process_global_permissions.Get() = permissions; 327 g_process_global_permissions.Get() = permissions;
328 } 328 }
329 329
330 InterfaceProxy::Factory InterfaceList::GetFactoryForID(ApiID id) const { 330 InterfaceProxy::Factory InterfaceList::GetFactoryForID(ApiID id) const {
331 int index = static_cast<int>(id); 331 int index = static_cast<int>(id);
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 408
409 int InterfaceList::HashInterfaceName(const std::string& name) { 409 int InterfaceList::HashInterfaceName(const std::string& name) {
410 uint32 data = base::Hash(name.c_str(), name.size()); 410 uint32 data = base::Hash(name.c_str(), name.size());
411 // Strip off the signed bit because UMA doesn't support negative values, 411 // Strip off the signed bit because UMA doesn't support negative values,
412 // but takes a signed int as input. 412 // but takes a signed int as input.
413 return static_cast<int>(data & 0x7fffffff); 413 return static_cast<int>(data & 0x7fffffff);
414 } 414 }
415 415
416 } // namespace proxy 416 } // namespace proxy
417 } // namespace ppapi 417 } // namespace ppapi
OLDNEW
« no previous file with comments | « net/url_request/url_request_job_manager.cc ('k') | ppapi/proxy/plugin_resource_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698