| 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 #include <setjmp.h> | 8 #include <setjmp.h> |
| 9 #include <stdio.h> | 9 #include <stdio.h> |
| 10 #include <string.h> | 10 #include <string.h> |
| 11 | 11 |
| 12 #include <map> | 12 #include <map> |
| 13 | 13 |
| 14 #include "native_client/src/trusted/plugin/srpc/browser_interface.h" | 14 #include "native_client/src/trusted/plugin/browser_interface.h" |
| 15 #include "native_client/src/trusted/plugin/srpc/desc_based_handle.h" | 15 #include "native_client/src/trusted/plugin/desc_based_handle.h" |
| 16 #include "native_client/src/trusted/plugin/srpc/portable_handle.h" | 16 #include "native_client/src/trusted/plugin/portable_handle.h" |
| 17 #include "native_client/src/trusted/plugin/srpc/shared_memory.h" | 17 #include "native_client/src/trusted/plugin/scriptable_handle.h" |
| 18 #include "native_client/src/trusted/plugin/srpc/plugin.h" | 18 #include "native_client/src/trusted/plugin/shared_memory.h" |
| 19 #include "native_client/src/trusted/plugin/plugin.h" |
| 19 | 20 |
| 20 #include "native_client/src/trusted/plugin/srpc/scriptable_handle.h" | |
| 21 | 21 |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 bool Map(void* obj, plugin::SrpcParams* params) { | 24 bool Map(void* obj, plugin::SrpcParams* params) { |
| 25 plugin::DescBasedHandle *ptr = | 25 plugin::DescBasedHandle *ptr = |
| 26 reinterpret_cast<plugin::DescBasedHandle*>(obj); | 26 reinterpret_cast<plugin::DescBasedHandle*>(obj); |
| 27 // Create a copy of the wrapper to go on the SharedMemory object. | 27 // Create a copy of the wrapper to go on the SharedMemory object. |
| 28 nacl::DescWrapper* shm_wrapper = | 28 nacl::DescWrapper* shm_wrapper = |
| 29 ptr->plugin()->wrapper_factory()->MakeGeneric(ptr->wrapper()->desc()); | 29 ptr->plugin()->wrapper_factory()->MakeGeneric(ptr->wrapper()->desc()); |
| 30 // Increment the ref count of the contained object. | 30 // Increment the ref count of the contained object. |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 BrowserInterface* DescBasedHandle::browser_interface() const { | 86 BrowserInterface* DescBasedHandle::browser_interface() const { |
| 87 return plugin_->browser_interface(); | 87 return plugin_->browser_interface(); |
| 88 } | 88 } |
| 89 | 89 |
| 90 void DescBasedHandle::LoadMethods() { | 90 void DescBasedHandle::LoadMethods() { |
| 91 // Methods supported by DescBasedHandle. | 91 // Methods supported by DescBasedHandle. |
| 92 AddMethodCall(Map, "map", "", "h"); | 92 AddMethodCall(Map, "map", "", "h"); |
| 93 } | 93 } |
| 94 | 94 |
| 95 } // namespace plugin | 95 } // namespace plugin |
| OLD | NEW |