Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1298)

Side by Side Diff: components/update_client/update_response.h

Issue 2700733002: Mechanical refactoring of the parser and ActionUpdateCheck (Closed)
Patch Set: . Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_UPDATE_CLIENT_UPDATE_RESPONSE_H_ 5 #ifndef COMPONENTS_UPDATE_CLIENT_UPDATE_RESPONSE_H_
6 #define COMPONENTS_UPDATE_CLIENT_UPDATE_RESPONSE_H_ 6 #define COMPONENTS_UPDATE_CLIENT_UPDATE_RESPONSE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 std::string browser_min_version; 88 std::string browser_min_version;
89 std::vector<Package> packages; 89 std::vector<Package> packages;
90 }; 90 };
91 91
92 Result(); 92 Result();
93 Result(const Result& other); 93 Result(const Result& other);
94 ~Result(); 94 ~Result();
95 95
96 std::string extension_id; 96 std::string extension_id;
97 97
98 // The updatecheck response status.
99 std::string status;
100
98 // The list of fallback urls, for full and diff updates respectively. 101 // The list of fallback urls, for full and diff updates respectively.
99 // These urls are base urls; they don't include the filename. 102 // These urls are base urls; they don't include the filename.
100 std::vector<GURL> crx_urls; 103 std::vector<GURL> crx_urls;
101 std::vector<GURL> crx_diffurls; 104 std::vector<GURL> crx_diffurls;
102 105
103 Manifest manifest; 106 Manifest manifest;
104 107
105 // The server has instructed the client to set its [key] to [value] for each 108 // The server has instructed the client to set its [key] to [value] for each
106 // key-value pair in this string. 109 // key-value pair in this string.
107 std::map<std::string, std::string> cohort_attrs; 110 std::map<std::string, std::string> cohort_attrs;
(...skipping 15 matching lines...) Expand all
123 // This will be >= 0, or kNoDaystart if the <daystart> tag was not present. 126 // This will be >= 0, or kNoDaystart if the <daystart> tag was not present.
124 int daystart_elapsed_days; 127 int daystart_elapsed_days;
125 std::vector<Result> list; 128 std::vector<Result> list;
126 }; 129 };
127 130
128 UpdateResponse(); 131 UpdateResponse();
129 ~UpdateResponse(); 132 ~UpdateResponse();
130 133
131 // Parses an update response xml string into Result data. Returns a bool 134 // Parses an update response xml string into Result data. Returns a bool
132 // indicating success or failure. On success, the results are available by 135 // indicating success or failure. On success, the results are available by
133 // calling results(). The details for any failures are available by calling 136 // calling results(). In case of success, only results corresponding to
134 // errors(). 137 // the update check status |ok| or |noupdate| are included.
138 // The details for any failures are available by calling errors().
135 bool Parse(const std::string& manifest_xml); 139 bool Parse(const std::string& manifest_xml);
136 140
137 const Results& results() const { return results_; } 141 const Results& results() const { return results_; }
138 const std::string& errors() const { return errors_; } 142 const std::string& errors() const { return errors_; }
139 143
140 private: 144 private:
141 Results results_; 145 Results results_;
142 std::string errors_; 146 std::string errors_;
143 147
144 // Adds parse error details to |errors_| string. 148 // Adds parse error details to |errors_| string.
145 void ParseError(const char* details, ...); 149 void ParseError(const char* details, ...);
146 150
147 DISALLOW_COPY_AND_ASSIGN(UpdateResponse); 151 DISALLOW_COPY_AND_ASSIGN(UpdateResponse);
148 }; 152 };
149 153
150 } // namespace update_client 154 } // namespace update_client
151 155
152 #endif // COMPONENTS_UPDATE_CLIENT_UPDATE_RESPONSE_H_ 156 #endif // COMPONENTS_UPDATE_CLIENT_UPDATE_RESPONSE_H_
OLDNEW
« no previous file with comments | « components/update_client/update_client_unittest.cc ('k') | components/update_client/update_response.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698