| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/extensions/extension_updater.h" | 5 #include "chrome/browser/extensions/extension_updater.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/file_version_info.h" | 9 #include "base/file_version_info.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 // Parse each of the <app> tags. | 459 // Parse each of the <app> tags. |
| 460 ScopedVector<ParseResult> tmp_results; | 460 ScopedVector<ParseResult> tmp_results; |
| 461 std::vector<xmlNode*> apps = GetChildren(root, gupdate_ns, "app"); | 461 std::vector<xmlNode*> apps = GetChildren(root, gupdate_ns, "app"); |
| 462 for (unsigned int i = 0; i < apps.size(); i++) { | 462 for (unsigned int i = 0; i < apps.size(); i++) { |
| 463 ParseResult* current = new ParseResult(); | 463 ParseResult* current = new ParseResult(); |
| 464 tmp_results.push_back(current); | 464 tmp_results.push_back(current); |
| 465 if (!ParseHelper::ParseSingleAppTag(apps[i], gupdate_ns, current)) { | 465 if (!ParseHelper::ParseSingleAppTag(apps[i], gupdate_ns, current)) { |
| 466 return false; | 466 return false; |
| 467 } | 467 } |
| 468 } | 468 } |
| 469 tmp_results.release(results); | 469 results->insert(results->end(), tmp_results.begin(), tmp_results.end()); |
| 470 tmp_results.get().clear(); |
| 470 | 471 |
| 471 return true; | 472 return true; |
| 472 } | 473 } |
| 473 | 474 |
| 474 std::vector<int> ExtensionUpdater::DetermineUpdates( | 475 std::vector<int> ExtensionUpdater::DetermineUpdates( |
| 475 const ParseResultList& possible_updates) { | 476 const ParseResultList& possible_updates) { |
| 476 | 477 |
| 477 std::vector<int> result; | 478 std::vector<int> result; |
| 478 | 479 |
| 479 // This will only get set if one of possible_updates specifies | 480 // This will only get set if one of possible_updates specifies |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 } | 552 } |
| 552 } else { | 553 } else { |
| 553 extension_fetcher_.reset( | 554 extension_fetcher_.reset( |
| 554 URLFetcher::Create(kExtensionFetcherId, url, URLFetcher::GET, this)); | 555 URLFetcher::Create(kExtensionFetcherId, url, URLFetcher::GET, this)); |
| 555 extension_fetcher_->set_request_context( | 556 extension_fetcher_->set_request_context( |
| 556 Profile::GetDefaultRequestContext()); | 557 Profile::GetDefaultRequestContext()); |
| 557 extension_fetcher_->Start(); | 558 extension_fetcher_->Start(); |
| 558 current_extension_fetch_ = ExtensionFetch(id, url); | 559 current_extension_fetch_ = ExtensionFetch(id, url); |
| 559 } | 560 } |
| 560 } | 561 } |
| OLD | NEW |