| 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 "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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |