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

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

Issue 189333004: Move more file_util functions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/webstore_installer.h" 5 #include "chrome/browser/extensions/webstore_installer.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 // filename and when the download starts writing to it (think concurrently 110 // filename and when the download starts writing to it (think concurrently
111 // running sharded browser tests installing the same test file, for 111 // running sharded browser tests installing the same test file, for
112 // instance). 112 // instance).
113 std::string random_number = 113 std::string random_number =
114 base::Uint64ToString(base::RandGenerator(kuint16max)); 114 base::Uint64ToString(base::RandGenerator(kuint16max));
115 115
116 base::FilePath file = 116 base::FilePath file =
117 download_directory.AppendASCII(id + "_" + random_number + ".crx"); 117 download_directory.AppendASCII(id + "_" + random_number + ".crx");
118 118
119 int uniquifier = 119 int uniquifier =
120 file_util::GetUniquePathNumber(file, base::FilePath::StringType()); 120 base::GetUniquePathNumber(file, base::FilePath::StringType());
121 if (uniquifier > 0) { 121 if (uniquifier > 0) {
122 file = file.InsertBeforeExtensionASCII( 122 file = file.InsertBeforeExtensionASCII(
123 base::StringPrintf(" (%d)", uniquifier)); 123 base::StringPrintf(" (%d)", uniquifier));
124 } 124 }
125 125
126 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, 126 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
127 base::Bind(callback, file)); 127 base::Bind(callback, file));
128 } 128 }
129 129
130 bool UseSeparateWebstoreDownloadDirectory() { 130 bool UseSeparateWebstoreDownloadDirectory() {
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 1, 658 1,
659 kMaxSizeKb, 659 kMaxSizeKb,
660 kNumBuckets); 660 kNumBuckets);
661 } 661 }
662 UMA_HISTOGRAM_BOOLEAN( 662 UMA_HISTOGRAM_BOOLEAN(
663 "Extensions.WebstoreDownload.InterruptTotalSizeUnknown", 663 "Extensions.WebstoreDownload.InterruptTotalSizeUnknown",
664 total_bytes <= 0); 664 total_bytes <= 0);
665 } 665 }
666 666
667 } // namespace extensions 667 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/external_pref_loader.cc ('k') | chrome/browser/media_galleries/media_folder_finder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698