| 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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 } | 326 } |
| 327 | 327 |
| 328 // static | 328 // static |
| 329 void InterfaceList::SetProcessGlobalPermissions( | 329 void InterfaceList::SetProcessGlobalPermissions( |
| 330 const PpapiPermissions& permissions) { | 330 const PpapiPermissions& permissions) { |
| 331 g_process_global_permissions.Get() = permissions; | 331 g_process_global_permissions.Get() = permissions; |
| 332 } | 332 } |
| 333 | 333 |
| 334 InterfaceProxy::Factory InterfaceList::GetFactoryForID(ApiID id) const { | 334 InterfaceProxy::Factory InterfaceList::GetFactoryForID(ApiID id) const { |
| 335 int index = static_cast<int>(id); | 335 int index = static_cast<int>(id); |
| 336 COMPILE_ASSERT(API_ID_NONE == 0, none_must_be_zero); | 336 static_assert(API_ID_NONE == 0, "none must be zero"); |
| 337 if (id <= 0 || id >= API_ID_COUNT) | 337 if (id <= 0 || id >= API_ID_COUNT) |
| 338 return NULL; | 338 return NULL; |
| 339 return id_to_factory_[index]; | 339 return id_to_factory_[index]; |
| 340 } | 340 } |
| 341 | 341 |
| 342 const void* InterfaceList::GetInterfaceForPPB(const std::string& name) { | 342 const void* InterfaceList::GetInterfaceForPPB(const std::string& name) { |
| 343 // CAUTION: This function is called without the ProxyLock to avoid excessive | 343 // CAUTION: This function is called without the ProxyLock to avoid excessive |
| 344 // excessive locking from C++ wrappers. (See also GetBrowserInterface.) | 344 // excessive locking from C++ wrappers. (See also GetBrowserInterface.) |
| 345 NameToInterfaceInfoMap::iterator found = | 345 NameToInterfaceInfoMap::iterator found = |
| 346 name_to_browser_info_.find(name); | 346 name_to_browser_info_.find(name); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 | 412 |
| 413 int InterfaceList::HashInterfaceName(const std::string& name) { | 413 int InterfaceList::HashInterfaceName(const std::string& name) { |
| 414 uint32 data = base::Hash(name.c_str(), name.size()); | 414 uint32 data = base::Hash(name.c_str(), name.size()); |
| 415 // Strip off the signed bit because UMA doesn't support negative values, | 415 // Strip off the signed bit because UMA doesn't support negative values, |
| 416 // but takes a signed int as input. | 416 // but takes a signed int as input. |
| 417 return static_cast<int>(data & 0x7fffffff); | 417 return static_cast<int>(data & 0x7fffffff); |
| 418 } | 418 } |
| 419 | 419 |
| 420 } // namespace proxy | 420 } // namespace proxy |
| 421 } // namespace ppapi | 421 } // namespace ppapi |
| OLD | NEW |