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

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

Issue 160509: Fix memory leak introduced by r22043. (Closed)
Patch Set: remove supression Created 11 years, 4 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
« no previous file with comments | « no previous file | tools/valgrind/memcheck/suppressions.txt » ('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/extensions_service.h" 5 #include "chrome/browser/extensions/extensions_service.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 } 362 }
363 363
364 void ExtensionsService::OnExternalExtensionFound(const std::string& id, 364 void ExtensionsService::OnExternalExtensionFound(const std::string& id,
365 const std::string& version, 365 const std::string& version,
366 const FilePath& path, 366 const FilePath& path,
367 Extension::Location location) { 367 Extension::Location location) {
368 // Before even bothering to unpack, check and see if we already have this 368 // Before even bothering to unpack, check and see if we already have this
369 // version. This is important because these extensions are going to get 369 // version. This is important because these extensions are going to get
370 // installed on every startup. 370 // installed on every startup.
371 Extension* existing = GetExtensionById(id); 371 Extension* existing = GetExtensionById(id);
372 scoped_ptr<Version> other(Version::GetVersionFromString(version));
372 if (existing) { 373 if (existing) {
373 switch (existing->version()->CompareTo( 374 switch (existing->version()->CompareTo(*other)) {
374 *Version::GetVersionFromString(version))) {
375 case -1: // existing version is older, we should upgrade 375 case -1: // existing version is older, we should upgrade
376 break; 376 break;
377 case 0: // existing version is same, do nothing 377 case 0: // existing version is same, do nothing
378 return; 378 return;
379 case 1: // existing version is newer, uh-oh 379 case 1: // existing version is newer, uh-oh
380 LOG(WARNING) << "Found external version of extension " << id 380 LOG(WARNING) << "Found external version of extension " << id
381 << "that is older than current version. Current version " 381 << "that is older than current version. Current version "
382 << "is: " << existing->VersionString() << ". New version " 382 << "is: " << existing->VersionString() << ". New version "
383 << "is: " << version << ". Keeping current version."; 383 << "is: " << version << ". Keeping current version.";
384 return; 384 return;
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 linked_ptr<ExternalExtensionProvider>(test_provider); 581 linked_ptr<ExternalExtensionProvider>(test_provider);
582 } 582 }
583 583
584 void ExtensionsServiceBackend::OnExternalExtensionFound( 584 void ExtensionsServiceBackend::OnExternalExtensionFound(
585 const std::string& id, const Version* version, const FilePath& path, 585 const std::string& id, const Version* version, const FilePath& path,
586 Extension::Location location) { 586 Extension::Location location) {
587 frontend_loop_->PostTask(FROM_HERE, NewRunnableMethod(frontend_, 587 frontend_loop_->PostTask(FROM_HERE, NewRunnableMethod(frontend_,
588 &ExtensionsService::OnExternalExtensionFound, id, version->GetString(), 588 &ExtensionsService::OnExternalExtensionFound, id, version->GetString(),
589 path, location)); 589 path, location));
590 } 590 }
OLDNEW
« no previous file with comments | « no previous file | tools/valgrind/memcheck/suppressions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698