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

Side by Side Diff: chrome/browser/extensions/updater/local_extension_cache.cc

Issue 448853002: Move StringToLowerASCII to base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
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 "chrome/browser/extensions/updater/local_extension_cache.h" 5 #include "chrome/browser/extensions/updater/local_extension_cache.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/files/file_enumerator.h" 9 #include "base/files/file_enumerator.h"
10 #include "base/sequenced_task_runner.h" 10 #include "base/sequenced_task_runner.h"
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 if (EndsWith(basename, kCRXFileExtension, false /* case-sensitive */)) { 298 if (EndsWith(basename, kCRXFileExtension, false /* case-sensitive */)) {
299 size_t n = basename.find('-'); 299 size_t n = basename.find('-');
300 if (n != std::string::npos && n + 1 < basename.size() - 4) { 300 if (n != std::string::npos && n + 1 < basename.size() - 4) {
301 id = basename.substr(0, n); 301 id = basename.substr(0, n);
302 // Size of |version| = total size - "<id>" - "-" - ".crx" 302 // Size of |version| = total size - "<id>" - "-" - ".crx"
303 version = basename.substr(n + 1, basename.size() - 5 - id.size()); 303 version = basename.substr(n + 1, basename.size() - 5 - id.size());
304 } 304 }
305 } 305 }
306 306
307 // Enforce a lower-case id. 307 // Enforce a lower-case id.
308 id = StringToLowerASCII(id); 308 id = base::StringToLowerASCII(id);
309 if (!extensions::Extension::IdIsValid(id)) { 309 if (!extensions::Extension::IdIsValid(id)) {
310 LOG(ERROR) << "Bad extension id in cache: " << id; 310 LOG(ERROR) << "Bad extension id in cache: " << id;
311 id.clear(); 311 id.clear();
312 } 312 }
313 313
314 if (!Version(version).IsValid()) { 314 if (!Version(version).IsValid()) {
315 LOG(ERROR) << "Bad extension version in cache: " << version; 315 LOG(ERROR) << "Bad extension version in cache: " << version;
316 version.clear(); 316 version.clear();
317 } 317 }
318 318
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 484
485 LocalExtensionCache::CacheItemInfo::CacheItemInfo( 485 LocalExtensionCache::CacheItemInfo::CacheItemInfo(
486 const std::string& version, 486 const std::string& version,
487 const base::Time& last_used, 487 const base::Time& last_used,
488 uint64 size, 488 uint64 size,
489 const base::FilePath& file_path) 489 const base::FilePath& file_path)
490 : version(version), last_used(last_used), size(size), file_path(file_path) { 490 : version(version), last_used(last_used), size(size), file_path(file_path) {
491 } 491 }
492 492
493 } // namespace extensions 493 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/external_registry_loader_win.cc ('k') | chrome/browser/file_select_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698