| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 3 * Use of this source code is governed by a BSD-style license that can be | |
| 4 * found in the LICENSE file. | |
| 5 */ | |
| 6 | |
| 7 // OBSOLETE -- this class provides support for passing NaClDescs between | |
| 8 // plugin instances. This support only exists in SRPC-mode plugins. | |
| 9 // TODO(polina): remove when SRPC descriptor passing is removed. | |
| 10 | |
| 11 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_DESC_BASED_HANDLE_H_ | |
| 12 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_DESC_BASED_HANDLE_H_ | |
| 13 | |
| 14 #include <stdio.h> | |
| 15 #include <map> | |
| 16 | |
| 17 #include "native_client/src/include/nacl_macros.h" | |
| 18 #include "native_client/src/include/nacl_scoped_ptr.h" | |
| 19 #include "native_client/src/trusted/desc/nacl_desc_wrapper.h" | |
| 20 #include "native_client/src/trusted/plugin/utility.h" | |
| 21 | |
| 22 struct NaClDesc; | |
| 23 | |
| 24 namespace nacl { | |
| 25 class DescWrapper; | |
| 26 } // namespace nacl | |
| 27 | |
| 28 namespace plugin { | |
| 29 | |
| 30 // DescBasedHandles are used to convey NaClDesc objects through JavaScript. | |
| 31 class DescBasedHandle { | |
| 32 public: | |
| 33 // Creates a new DescBasedHandle using the specified plugin and wrapper. | |
| 34 // Returns NULL if either plugin or wrapper is NULL. | |
| 35 static DescBasedHandle* New(nacl::DescWrapper* wrapper); | |
| 36 ~DescBasedHandle(); | |
| 37 | |
| 38 // Because the factory ensured that wrapper was not NULL, dereferencing it | |
| 39 // here is always safe. | |
| 40 NaClDesc* desc() const { return wrapper_->desc(); } | |
| 41 | |
| 42 private: | |
| 43 NACL_DISALLOW_COPY_AND_ASSIGN(DescBasedHandle); | |
| 44 explicit DescBasedHandle(nacl::DescWrapper* wrapper); | |
| 45 nacl::scoped_ptr<nacl::DescWrapper> wrapper_; | |
| 46 }; | |
| 47 | |
| 48 } // namespace plugin | |
| 49 | |
| 50 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_DESC_BASED_HANDLE_H_ | |
| OLD | NEW |