| 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 EXTENSIONS_COMMON_UPDATE_MANIFEST_H_ | 5 #ifndef EXTENSIONS_COMMON_UPDATE_MANIFEST_H_ |
| 6 #define EXTENSIONS_COMMON_UPDATE_MANIFEST_H_ | 6 #define EXTENSIONS_COMMON_UPDATE_MANIFEST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 // | 33 // |
| 34 // The "appid" attribute of the <app> tag refers to the unique id of the | 34 // The "appid" attribute of the <app> tag refers to the unique id of the |
| 35 // extension. The "codebase" attribute of the <updatecheck> tag is the url to | 35 // extension. The "codebase" attribute of the <updatecheck> tag is the url to |
| 36 // fetch the updated crx file, and the "prodversionmin" attribute refers to | 36 // fetch the updated crx file, and the "prodversionmin" attribute refers to |
| 37 // the minimum version of the chrome browser that the update applies to. | 37 // the minimum version of the chrome browser that the update applies to. |
| 38 | 38 |
| 39 // The diff data members correspond to the differential update package, if | 39 // The diff data members correspond to the differential update package, if |
| 40 // a differential update is specified in the response. | 40 // a differential update is specified in the response. |
| 41 | 41 |
| 42 // The result of parsing one <app> tag in an xml update check manifest. | 42 // The result of parsing one <app> tag in an xml update check manifest. |
| 43 // TODO(crbug.com/692120): consider removing struct Result and Results and |
| 44 // using the corresponding mojo type instead. This would also remove the |
| 45 // need for the Mojo struct traits that are currently defined / used to |
| 46 // cart these Result/Results structs over Mojo IPC. |
| 43 struct Result { | 47 struct Result { |
| 44 Result(); | 48 Result(); |
| 45 Result(const Result& other); | 49 Result(const Result& other); |
| 46 ~Result(); | 50 ~Result(); |
| 47 | 51 |
| 48 std::string extension_id; | 52 std::string extension_id; |
| 49 std::string version; | 53 std::string version; |
| 50 std::string browser_min_version; | 54 std::string browser_min_version; |
| 51 | 55 |
| 52 // Attributes for the full update. | 56 // Attributes for the full update. |
| 53 GURL crx_url; | 57 GURL crx_url; |
| 54 std::string package_hash; | 58 std::string package_hash; |
| 55 int size; | 59 int size; |
| 56 std::string package_fingerprint; | 60 std::string package_fingerprint; |
| 57 | 61 |
| 58 // Attributes for the differential update. | 62 // Attributes for the differential update. |
| 59 GURL diff_crx_url; | 63 GURL diff_crx_url; |
| 60 std::string diff_package_hash; | 64 std::string diff_package_hash; |
| 61 int diff_size; | 65 int diff_size; |
| 62 }; | 66 }; |
| 63 | 67 |
| 64 static const int kNoDaystart = -1; | 68 static const int kNoDaystart = -1; |
| 65 struct Results { | 69 struct Results { |
| 66 Results(); | 70 Results(); |
| 71 Results(const Results& other); |
| 72 Results& operator=(const Results& other); |
| 67 ~Results(); | 73 ~Results(); |
| 68 | 74 |
| 69 std::vector<Result> list; | 75 std::vector<Result> list; |
| 70 // This will be >= 0, or kNoDaystart if the <daystart> tag was not present. | 76 // This will be >= 0, or kNoDaystart if the <daystart> tag was not present. |
| 71 int daystart_elapsed_seconds; | 77 int daystart_elapsed_seconds; |
| 72 }; | 78 }; |
| 73 | 79 |
| 74 UpdateManifest(); | 80 UpdateManifest(); |
| 75 ~UpdateManifest(); | 81 ~UpdateManifest(); |
| 76 | 82 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 87 Results results_; | 93 Results results_; |
| 88 std::string errors_; | 94 std::string errors_; |
| 89 | 95 |
| 90 // Helper function that adds parse error details to our errors_ string. | 96 // Helper function that adds parse error details to our errors_ string. |
| 91 void ParseError(const char* details, ...); | 97 void ParseError(const char* details, ...); |
| 92 | 98 |
| 93 DISALLOW_COPY_AND_ASSIGN(UpdateManifest); | 99 DISALLOW_COPY_AND_ASSIGN(UpdateManifest); |
| 94 }; | 100 }; |
| 95 | 101 |
| 96 #endif // EXTENSIONS_COMMON_UPDATE_MANIFEST_H_ | 102 #endif // EXTENSIONS_COMMON_UPDATE_MANIFEST_H_ |
| OLD | NEW |