OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 // Manifest processing for JSON manifests. | 7 // Manifest processing for JSON manifests. |
8 | 8 |
9 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_JSON_MANIFEST_H_ | 9 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_JSON_MANIFEST_H_ |
10 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_JSON_MANIFEST_H_ | 10 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_JSON_MANIFEST_H_ |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 namespace plugin { | 25 namespace plugin { |
26 | 26 |
27 class ErrorInfo; | 27 class ErrorInfo; |
28 class PnaclOptions; | 28 class PnaclOptions; |
29 | 29 |
30 class JsonManifest : public Manifest { | 30 class JsonManifest : public Manifest { |
31 public: | 31 public: |
32 JsonManifest(const pp::URLUtil_Dev* url_util, | 32 JsonManifest(const pp::URLUtil_Dev* url_util, |
33 const nacl::string& manifest_base_url, | 33 const nacl::string& manifest_base_url, |
34 const nacl::string& sandbox_isa, | 34 const nacl::string& sandbox_isa) |
35 bool prefer_portable) | |
36 : url_util_(url_util), | 35 : url_util_(url_util), |
37 manifest_base_url_(manifest_base_url), | 36 manifest_base_url_(manifest_base_url), |
38 sandbox_isa_(sandbox_isa), | 37 sandbox_isa_(sandbox_isa), |
39 prefer_portable_(prefer_portable), | |
40 dictionary_(Json::nullValue) { } | 38 dictionary_(Json::nullValue) { } |
41 virtual ~JsonManifest() { } | 39 virtual ~JsonManifest() { } |
42 | 40 |
43 // Initialize the manifest object for use by later lookups. The return | 41 // Initialize the manifest object for use by later lookups. The return |
44 // value is true if the manifest parses correctly and matches the schema. | 42 // value is true if the manifest parses correctly and matches the schema. |
45 bool Init(const nacl::string& json, ErrorInfo* error_info); | 43 bool Init(const nacl::string& json, ErrorInfo* error_info); |
46 | 44 |
47 // Gets the full program URL for the current sandbox ISA from the | 45 // Gets the full program URL for the current sandbox ISA from the |
48 // manifest file. | 46 // manifest file. |
49 virtual bool GetProgramURL(nacl::string* full_url, | 47 virtual bool GetProgramURL(nacl::string* full_url, |
(...skipping 24 matching lines...) Expand all Loading... |
74 NACL_DISALLOW_COPY_AND_ASSIGN(JsonManifest); | 72 NACL_DISALLOW_COPY_AND_ASSIGN(JsonManifest); |
75 | 73 |
76 // Checks that |dictionary_| is a valid manifest, according to the schema. | 74 // Checks that |dictionary_| is a valid manifest, according to the schema. |
77 // Returns true on success, and sets |error_info| to a detailed message | 75 // Returns true on success, and sets |error_info| to a detailed message |
78 // if not. | 76 // if not. |
79 bool MatchesSchema(ErrorInfo* error_info); | 77 bool MatchesSchema(ErrorInfo* error_info); |
80 | 78 |
81 const pp::URLUtil_Dev* url_util_; | 79 const pp::URLUtil_Dev* url_util_; |
82 nacl::string manifest_base_url_; | 80 nacl::string manifest_base_url_; |
83 nacl::string sandbox_isa_; | 81 nacl::string sandbox_isa_; |
84 // Determines whether portable programs are chosen in manifest files over | |
85 // native programs. | |
86 bool prefer_portable_; | |
87 | 82 |
88 Json::Value dictionary_; | 83 Json::Value dictionary_; |
89 }; | 84 }; |
90 | 85 |
91 | 86 |
92 } // namespace plugin | 87 } // namespace plugin |
93 | 88 |
94 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_JSON_MANIFEST_H_ | 89 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_JSON_MANIFEST_H_ |
OLD | NEW |