| 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::~Results() = default; |
| 35 } | |
| 36 | 33 |
| 37 UpdateManifest::~UpdateManifest() {} | 34 UpdateManifest::UpdateManifest() = default; |
| 35 |
| 36 UpdateManifest::~UpdateManifest() = default; |
| 38 | 37 |
| 39 void UpdateManifest::ParseError(const char* details, ...) { | 38 void UpdateManifest::ParseError(const char* details, ...) { |
| 40 va_list args; | 39 va_list args; |
| 41 va_start(args, details); | 40 va_start(args, details); |
| 42 | 41 |
| 43 if (errors_.length() > 0) { | 42 if (errors_.length() > 0) { |
| 44 // TODO(asargent) make a platform abstracted newline? | 43 // TODO(asargent) make a platform abstracted newline? |
| 45 errors_ += "\r\n"; | 44 errors_ += "\r\n"; |
| 46 } | 45 } |
| 47 base::StringAppendV(&errors_, details, args); | 46 base::StringAppendV(&errors_, details, args); |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 std::string error; | 277 std::string error; |
| 279 if (!ParseSingleAppTag(apps[i], gupdate_ns, ¤t, &error)) { | 278 if (!ParseSingleAppTag(apps[i], gupdate_ns, ¤t, &error)) { |
| 280 ParseError("%s", error.c_str()); | 279 ParseError("%s", error.c_str()); |
| 281 } else { | 280 } else { |
| 282 results_.list.push_back(current); | 281 results_.list.push_back(current); |
| 283 } | 282 } |
| 284 } | 283 } |
| 285 | 284 |
| 286 return true; | 285 return true; |
| 287 } | 286 } |
| OLD | NEW |