OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/profiles/profile_impl.h" | 5 #include "chrome/browser/profiles/profile_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/environment.h" | 10 #include "base/environment.h" |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 using content::DownloadManager; | 147 using content::DownloadManager; |
148 using content::UserMetricsAction; | 148 using content::UserMetricsAction; |
149 | 149 |
150 namespace { | 150 namespace { |
151 | 151 |
152 // Delay, in milliseconds, before we explicitly create the SessionService. | 152 // Delay, in milliseconds, before we explicitly create the SessionService. |
153 static const int kCreateSessionServiceDelayMS = 500; | 153 static const int kCreateSessionServiceDelayMS = 500; |
154 | 154 |
155 // Helper method needed because PostTask cannot currently take a Callback | 155 // Helper method needed because PostTask cannot currently take a Callback |
156 // function with non-void return type. | 156 // function with non-void return type. |
157 // TODO(jhawkins): Remove once IgnoreReturn is fixed. | 157 // TODO(jhawkins): Remove once IgnoreResult is fixed. |
158 void CreateDirectoryNoResult(const FilePath& path) { | 158 void CreateDirectoryNoResult(const FilePath& path) { |
159 file_util::CreateDirectory(path); | 159 file_util::CreateDirectory(path); |
160 } | 160 } |
161 | 161 |
162 FilePath GetCachePath(const FilePath& base) { | 162 FilePath GetCachePath(const FilePath& base) { |
163 return base.Append(chrome::kCacheDirname); | 163 return base.Append(chrome::kCacheDirname); |
164 } | 164 } |
165 | 165 |
166 FilePath GetMediaCachePath(const FilePath& base) { | 166 FilePath GetMediaCachePath(const FilePath& base) { |
167 return base.Append(chrome::kMediaCacheDirname); | 167 return base.Append(chrome::kMediaCacheDirname); |
(...skipping 1484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1652 FilePath* cache_path, | 1652 FilePath* cache_path, |
1653 int* max_size) { | 1653 int* max_size) { |
1654 DCHECK(cache_path); | 1654 DCHECK(cache_path); |
1655 DCHECK(max_size); | 1655 DCHECK(max_size); |
1656 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); | 1656 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); |
1657 if (!path.empty()) | 1657 if (!path.empty()) |
1658 *cache_path = path; | 1658 *cache_path = path; |
1659 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : | 1659 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : |
1660 prefs_->GetInteger(prefs::kDiskCacheSize); | 1660 prefs_->GetInteger(prefs::kDiskCacheSize); |
1661 } | 1661 } |
OLD | NEW |