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 #include "extensions/common/update_manifest.h" | 5 #include "extensions/common/update_manifest.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
11 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
13 #include "base/strings/stringprintf.h" | 13 #include "base/strings/stringprintf.h" |
14 #include "base/version.h" | 14 #include "base/version.h" |
15 #include "libxml/tree.h" | 15 #include "libxml/tree.h" |
16 #include "third_party/libxml/chromium/libxml_utils.h" | 16 #include "third_party/libxml/chromium/libxml_utils.h" |
17 | 17 |
18 static const char* kExpectedGupdateProtocol = "2.0"; | 18 static const char* kExpectedGupdateProtocol = "2.0"; |
19 static const char* kExpectedGupdateXmlns = | 19 static const char* kExpectedGupdateXmlns = |
20 "http://www.google.com/update2/response"; | 20 "http://www.google.com/update2/response"; |
21 | 21 |
22 UpdateManifest::Result::Result() | 22 UpdateManifest::Result::Result() : size(0), diff_size(0) {} |
23 : size(0), | |
24 diff_size(0) {} | |
25 | 23 |
26 UpdateManifest::Result::Result(const Result& other) = default; | 24 UpdateManifest::Result::Result(const Result& other) = default; |
27 | 25 |
28 UpdateManifest::Result::~Result() {} | 26 UpdateManifest::Result::~Result() = default; |
29 | 27 |
30 UpdateManifest::Results::Results() : daystart_elapsed_seconds(kNoDaystart) {} | 28 UpdateManifest::Results::Results() : daystart_elapsed_seconds(kNoDaystart) {} |
31 | 29 |
32 UpdateManifest::Results::~Results() {} | 30 UpdateManifest::Results::Results(const Results& other) = default; |
33 | 31 |
34 UpdateManifest::UpdateManifest() { | 32 UpdateManifest::Results& UpdateManifest::Results::operator=( |
35 } | 33 const Results& other) = default; |
36 | 34 |
37 UpdateManifest::~UpdateManifest() {} | 35 UpdateManifest::Results::~Results() = default; |
| 36 |
| 37 UpdateManifest::UpdateManifest() = default; |
| 38 |
| 39 UpdateManifest::~UpdateManifest() = default; |
38 | 40 |
39 void UpdateManifest::ParseError(const char* details, ...) { | 41 void UpdateManifest::ParseError(const char* details, ...) { |
40 va_list args; | 42 va_list args; |
41 va_start(args, details); | 43 va_start(args, details); |
42 | 44 |
43 if (errors_.length() > 0) { | 45 if (errors_.length() > 0) { |
44 // TODO(asargent) make a platform abstracted newline? | 46 // TODO(asargent) make a platform abstracted newline? |
45 errors_ += "\r\n"; | 47 errors_ += "\r\n"; |
46 } | 48 } |
47 base::StringAppendV(&errors_, details, args); | 49 base::StringAppendV(&errors_, details, args); |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 std::string error; | 280 std::string error; |
279 if (!ParseSingleAppTag(apps[i], gupdate_ns, ¤t, &error)) { | 281 if (!ParseSingleAppTag(apps[i], gupdate_ns, ¤t, &error)) { |
280 ParseError("%s", error.c_str()); | 282 ParseError("%s", error.c_str()); |
281 } else { | 283 } else { |
282 results_.list.push_back(current); | 284 results_.list.push_back(current); |
283 } | 285 } |
284 } | 286 } |
285 | 287 |
286 return true; | 288 return true; |
287 } | 289 } |
OLD | NEW |