| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef COMPONENTS_NACL_RENDERER_JSON_MANIFEST_H | 5 #ifndef COMPONENTS_NACL_RENDERER_JSON_MANIFEST_H |
| 6 #define COMPONENTS_NACL_RENDERER_JSON_MANIFEST_H | 6 #define COMPONENTS_NACL_RENDERER_JSON_MANIFEST_H |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> |
| 10 | 11 |
| 11 #include "ppapi/c/pp_array_output.h" | 12 #include "ppapi/c/pp_array_output.h" |
| 12 #include "ppapi/c/private/ppb_nacl_private.h" | 13 #include "ppapi/c/private/ppb_nacl_private.h" |
| 13 #include "third_party/jsoncpp/source/include/json/value.h" | 14 #include "third_party/jsoncpp/source/include/json/value.h" |
| 14 | 15 |
| 15 namespace nacl { | 16 namespace nacl { |
| 16 class JsonManifest; | 17 class JsonManifest; |
| 17 class NexeLoadManager; | 18 class NexeLoadManager; |
| 18 | 19 |
| 19 class JsonManifest { | 20 class JsonManifest { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 32 // true if the manifest parses correctly and matches the schema. | 33 // true if the manifest parses correctly and matches the schema. |
| 33 bool Init(const std::string& json_manifest, ErrorInfo* error_info); | 34 bool Init(const std::string& json_manifest, ErrorInfo* error_info); |
| 34 | 35 |
| 35 // Gets the full program URL for the current sandbox ISA from the | 36 // Gets the full program URL for the current sandbox ISA from the |
| 36 // manifest file. | 37 // manifest file. |
| 37 bool GetProgramURL(std::string* full_url, | 38 bool GetProgramURL(std::string* full_url, |
| 38 PP_PNaClOptions* pnacl_options, | 39 PP_PNaClOptions* pnacl_options, |
| 39 bool* uses_nonsfi_mode, | 40 bool* uses_nonsfi_mode, |
| 40 ErrorInfo* error_info) const; | 41 ErrorInfo* error_info) const; |
| 41 | 42 |
| 43 // Gets all the URLs and their keys in the "files" section. |
| 44 void GetFiles( |
| 45 std::vector<std::pair<std::string, std::string> >* out_files) const; |
| 46 |
| 42 // Resolves a key from the "files" section to a fully resolved URL, | 47 // Resolves a key from the "files" section to a fully resolved URL, |
| 43 // i.e., relative URL values are fully expanded relative to the | 48 // i.e., relative URL values are fully expanded relative to the |
| 44 // manifest's URL (via ResolveURL). | 49 // manifest's URL (via ResolveURL). |
| 45 // If there was an error, details are reported via error_info. | 50 // If there was an error, details are reported via error_info. |
| 46 bool ResolveKey(const std::string& key, | 51 bool ResolveKey(const std::string& key, |
| 47 std::string* full_url, | 52 std::string* full_url, |
| 48 PP_PNaClOptions* pnacl_options) const; | 53 PP_PNaClOptions* pnacl_options) const; |
| 49 | 54 |
| 50 private: | 55 private: |
| 51 bool MatchesSchema(ErrorInfo* error_info); | 56 bool MatchesSchema(ErrorInfo* error_info); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 65 bool nonsfi_enabled_; | 70 bool nonsfi_enabled_; |
| 66 bool pnacl_debug_; | 71 bool pnacl_debug_; |
| 67 | 72 |
| 68 // The dictionary of manifest information parsed in Init(). | 73 // The dictionary of manifest information parsed in Init(). |
| 69 Json::Value dictionary_; | 74 Json::Value dictionary_; |
| 70 }; | 75 }; |
| 71 | 76 |
| 72 } // namespace nacl | 77 } // namespace nacl |
| 73 | 78 |
| 74 #endif // COMPONENTS_NACL_RENDERER_JSON_MANIFEST_H | 79 #endif // COMPONENTS_NACL_RENDERER_JSON_MANIFEST_H |
| OLD | NEW |