| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2008 The Native Client Authors. All rights reserved. | 2 * Copyright 2008 The Native Client Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can | 3 * Use of this source code is governed by a BSD-style license that can |
| 4 * be found in the LICENSE file. | 4 * be found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 | 7 |
| 8 // NPAPI Scriptable handle implementation. | 8 // NPAPI Scriptable handle implementation. |
| 9 | 9 |
| 10 #include "native_client/src/trusted/plugin/srpc/scriptable_handle.h" | 10 #include "native_client/src/trusted/plugin/scriptable_handle.h" |
| 11 | 11 |
| 12 #include <stdio.h> | 12 #include <stdio.h> |
| 13 #include <string.h> | 13 #include <string.h> |
| 14 | 14 |
| 15 #include <set> | 15 #include <set> |
| 16 | 16 |
| 17 #include "native_client/src/include/checked_cast.h" | 17 #include "native_client/src/include/checked_cast.h" |
| 18 #include "native_client/src/include/portability.h" | 18 #include "native_client/src/include/portability.h" |
| 19 #include "native_client/src/trusted/plugin/srpc/browser_interface.h" | |
| 20 #include "native_client/src/trusted/plugin/srpc/socket_address.h" | |
| 21 #include "native_client/src/trusted/plugin/srpc/utility.h" | |
| 22 #include "native_client/src/shared/srpc/nacl_srpc.h" | 19 #include "native_client/src/shared/srpc/nacl_srpc.h" |
| 20 #include "native_client/src/trusted/plugin/browser_interface.h" |
| 21 #include "native_client/src/trusted/plugin/socket_address.h" |
| 22 #include "native_client/src/trusted/plugin/utility.h" |
| 23 | 23 |
| 24 | 24 |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 // For security we keep track of the set of scriptable handles that were | 27 // For security we keep track of the set of scriptable handles that were |
| 28 // created. | 28 // created. |
| 29 | 29 |
| 30 std::set<const plugin::ScriptableHandle*>* g_ValidHandles = 0; | 30 std::set<const plugin::ScriptableHandle*>* g_ValidHandles = 0; |
| 31 | 31 |
| 32 } // namespace | 32 } // namespace |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 } | 76 } |
| 77 size_t count = | 77 size_t count = |
| 78 g_ValidHandles->count(static_cast<const ScriptableHandle*>(handle)); | 78 g_ValidHandles->count(static_cast<const ScriptableHandle*>(handle)); |
| 79 PLUGIN_PRINTF(("ScriptableHandle::is_valid(%p, count %"NACL_PRIuS")\n", | 79 PLUGIN_PRINTF(("ScriptableHandle::is_valid(%p, count %"NACL_PRIuS")\n", |
| 80 static_cast<void*>(const_cast<ScriptableHandle*>(handle)), | 80 static_cast<void*>(const_cast<ScriptableHandle*>(handle)), |
| 81 count)); | 81 count)); |
| 82 return 0 != count; | 82 return 0 != count; |
| 83 } | 83 } |
| 84 | 84 |
| 85 } // namespace plugin | 85 } // namespace plugin |
| OLD | NEW |