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

Side by Side Diff: chrome/browser/extensions/extension_updater.cc

Issue 149479: Fix leaks in ExtensionUpdater unit tests... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_updater_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_updater_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698