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

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

Issue 100573002: Move directory creation functions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 102
103 #if defined(OS_CHROMEOS) 103 #if defined(OS_CHROMEOS)
104 // Do not use drive for extension downloads. 104 // Do not use drive for extension downloads.
105 if (drive::util::IsUnderDriveMountPoint(directory)) 105 if (drive::util::IsUnderDriveMountPoint(directory))
106 directory = DownloadPrefs::GetDefaultDownloadDirectory(); 106 directory = DownloadPrefs::GetDefaultDownloadDirectory();
107 #endif 107 #endif
108 108
109 // Ensure the download directory exists. TODO(asargent) - make this use 109 // Ensure the download directory exists. TODO(asargent) - make this use
110 // common code from the downloads system. 110 // common code from the downloads system.
111 if (!base::DirectoryExists(directory)) { 111 if (!base::DirectoryExists(directory)) {
112 if (!file_util::CreateDirectory(directory)) { 112 if (!base::CreateDirectory(directory)) {
113 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, 113 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
114 base::Bind(callback, base::FilePath())); 114 base::Bind(callback, base::FilePath()));
115 return; 115 return;
116 } 116 }
117 } 117 }
118 118
119 // This is to help avoid a race condition between when we generate this 119 // This is to help avoid a race condition between when we generate this
120 // filename and when the download starts writing to it (think concurrently 120 // filename and when the download starts writing to it (think concurrently
121 // running sharded browser tests installing the same test file, for 121 // running sharded browser tests installing the same test file, for
122 // instance). 122 // instance).
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 1, 655 1,
656 kMaxSizeKb, 656 kMaxSizeKb,
657 kNumBuckets); 657 kNumBuckets);
658 } 658 }
659 UMA_HISTOGRAM_BOOLEAN( 659 UMA_HISTOGRAM_BOOLEAN(
660 "Extensions.WebstoreDownload.InterruptTotalSizeUnknown", 660 "Extensions.WebstoreDownload.InterruptTotalSizeUnknown",
661 total_bytes <= 0); 661 total_bytes <= 0);
662 } 662 }
663 663
664 } // namespace extensions 664 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/test_extension_prefs.cc ('k') | chrome/browser/first_run/first_run.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698