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

Side by Side Diff: chrome/browser/profiles/profile_impl.cc

Issue 9111035: Profiles: Add a size check to ProfileImpl to make sure it no longer grows. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 11 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
OLDNEW
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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 #endif 142 #endif
143 143
144 using base::Time; 144 using base::Time;
145 using base::TimeDelta; 145 using base::TimeDelta;
146 using content::BrowserThread; 146 using content::BrowserThread;
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 // Constrict us to a very specific platform and architecture to make sure
153 // ifdefs don't cause problems with the check.
154 #if defined(OS_LINUX) && defined(TOOLKIT_GTK) && defined(ARCH_CPU_X86_64)
155 // Make sure that the ProfileImpl doesn't grow. We're currently trying to drive
156 // the number of services that are included in ProfileImpl (instead of using
157 // ProfileKeyedServiceFactory) to zero.
158 //
159 // If you don't know about this effort, please read:
160 // https://sites.google.com/a/chromium.org/dev/developers/design-documents/pro file-architecture
161 //
162 // REVIEWERS: Do not let anyone increment this. We need to drive the number of
163 // raw accessed services down to zero. DO NOT LET PEOPLE REGRESS THIS UNLESS
164 // THE PATCH ITSELF IS MAKING PROGRESS ON PKSF REFACTORING.
165 COMPILE_ASSERT(sizeof(ProfileImpl) == 656u, profile_impl_size_unexpected);
Miranda Callahan 2012/01/06 15:34:57 Should we instead assert sizeof(ProfileImpl) <= 65
Elliot Glaysher 2012/01/06 18:23:58 I'm not crazy about this, but I changed it. Using
166 #endif
167
152 // Delay, in milliseconds, before we explicitly create the SessionService. 168 // Delay, in milliseconds, before we explicitly create the SessionService.
153 static const int kCreateSessionServiceDelayMS = 500; 169 static const int kCreateSessionServiceDelayMS = 500;
154 170
155 // Helper method needed because PostTask cannot currently take a Callback 171 // Helper method needed because PostTask cannot currently take a Callback
156 // function with non-void return type. 172 // function with non-void return type.
157 // TODO(jhawkins): Remove once IgnoreReturn is fixed. 173 // TODO(jhawkins): Remove once IgnoreReturn is fixed.
158 void CreateDirectoryNoResult(const FilePath& path) { 174 void CreateDirectoryNoResult(const FilePath& path) {
159 file_util::CreateDirectory(path); 175 file_util::CreateDirectory(path);
160 } 176 }
161 177
(...skipping 1490 matching lines...) Expand 10 before | Expand all | Expand 10 after
1652 FilePath* cache_path, 1668 FilePath* cache_path,
1653 int* max_size) { 1669 int* max_size) {
1654 DCHECK(cache_path); 1670 DCHECK(cache_path);
1655 DCHECK(max_size); 1671 DCHECK(max_size);
1656 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); 1672 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir));
1657 if (!path.empty()) 1673 if (!path.empty())
1658 *cache_path = path; 1674 *cache_path = path;
1659 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : 1675 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) :
1660 prefs_->GetInteger(prefs::kDiskCacheSize); 1676 prefs_->GetInteger(prefs::kDiskCacheSize);
1661 } 1677 }
OLDNEW
« chrome/browser/profiles/profile_impl.h ('K') | « chrome/browser/profiles/profile_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698