| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Copyright (c) 2012 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 // Manifest interface class. | |
| 8 | |
| 9 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_MANIFEST_H_ | |
| 10 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_MANIFEST_H_ | |
| 11 | |
| 12 #include <map> | |
| 13 #include <set> | |
| 14 #include <string> | |
| 15 | |
| 16 #include "native_client/src/include/nacl_macros.h" | |
| 17 #include "native_client/src/include/nacl_string.h" | |
| 18 #include "third_party/jsoncpp/source/include/json/value.h" | |
| 19 | |
| 20 struct PP_PNaClOptions; | |
| 21 | |
| 22 namespace pp { | |
| 23 class URLUtil_Dev; | |
| 24 } // namespace pp | |
| 25 | |
| 26 namespace plugin { | |
| 27 | |
| 28 class ErrorInfo; | |
| 29 | |
| 30 class Manifest { | |
| 31 public: | |
| 32 Manifest() { } | |
| 33 virtual ~Manifest() { } | |
| 34 | |
| 35 // A convention in the interfaces below regarding permit_extension_url: | |
| 36 // Some manifests (e.g., the pnacl coordinator manifest) need to access | |
| 37 // resources from an extension origin distinct from the plugin's origin | |
| 38 // (e.g., the pnacl coordinator needs to load llc, ld, and some libraries). | |
| 39 // This out-parameter is true if this manifest lookup confers access to | |
| 40 // a resource in the extension origin. | |
| 41 | |
| 42 // Gets the full program URL for the current sandbox ISA from the | |
| 43 // manifest file. Fills in |pnacl_options| if the program requires | |
| 44 // PNaCl translation. | |
| 45 virtual bool GetProgramURL(nacl::string* full_url, | |
| 46 PP_PNaClOptions* pnacl_options, | |
| 47 bool* uses_nonsfi_mode, | |
| 48 ErrorInfo* error_info) const = 0; | |
| 49 | |
| 50 // Resolves a key from the "files" section to a fully resolved URL, | |
| 51 // i.e., relative URL values are fully expanded relative to the | |
| 52 // manifest's URL. Fills in |pnacl_options| if | |
| 53 // the resolved key requires a pnacl translation step to obtain | |
| 54 // the final requested resource. | |
| 55 virtual bool ResolveKey(const nacl::string& key, | |
| 56 nacl::string* full_url, | |
| 57 PP_PNaClOptions* pnacl_options) const = 0; | |
| 58 | |
| 59 protected: | |
| 60 NACL_DISALLOW_COPY_AND_ASSIGN(Manifest); | |
| 61 }; | |
| 62 | |
| 63 | |
| 64 } // namespace plugin | |
| 65 | |
| 66 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_MANIFEST_H_ | |
| OLD | NEW |