diff options
author | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-06 21:27:15 +0000 |
---|---|---|
committer | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-06 21:27:15 +0000 |
commit | ea12b5be6a1f29f75b3c3a9fc036733800d83316 (patch) | |
tree | 88252134837c6edf073c7eaa22cfb985d6ed8ccb | |
parent | dbbf3aff4122b1e80093e6a8842525b51b5f9073 (diff) | |
download | chromium_src-ea12b5be6a1f29f75b3c3a9fc036733800d83316.zip chromium_src-ea12b5be6a1f29f75b3c3a9fc036733800d83316.tar.gz chromium_src-ea12b5be6a1f29f75b3c3a9fc036733800d83316.tar.bz2 |
Profiles: Add a size check to ProfileImpl to make sure it no longer grows.
We need to prevent regressions where someone will add another service
to ProfileImpl that isn't managed by a ProfileKeyedServiceFactory.
BUG=77155
TEST=compiles on Linux x64
Review URL: http://codereview.chromium.org/9111035
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116743 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/profiles/profile_impl.cc | 18 | ||||
-rw-r--r-- | chrome/browser/profiles/profile_impl.h | 16 |
2 files changed, 32 insertions, 2 deletions
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc index a6408cb..f9a6ffa 100644 --- a/chrome/browser/profiles/profile_impl.cc +++ b/chrome/browser/profiles/profile_impl.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -149,6 +149,22 @@ using content::UserMetricsAction; namespace { +// Constrict us to a very specific platform and architecture to make sure +// ifdefs don't cause problems with the check. +#if defined(OS_LINUX) && defined(TOOLKIT_GTK) && defined(ARCH_CPU_X86_64) +// Make sure that the ProfileImpl doesn't grow. We're currently trying to drive +// the number of services that are included in ProfileImpl (instead of using +// ProfileKeyedServiceFactory) to zero. +// +// If you don't know about this effort, please read: +// https://sites.google.com/a/chromium.org/dev/developers/design-documents/profile-architecture +// +// REVIEWERS: Do not let anyone increment this. We need to drive the number of +// raw accessed services down to zero. DO NOT LET PEOPLE REGRESS THIS UNLESS +// THE PATCH ITSELF IS MAKING PROGRESS ON PKSF REFACTORING. +COMPILE_ASSERT(sizeof(ProfileImpl) <= 656u, profile_impl_size_unexpected); +#endif + // Delay, in milliseconds, before we explicitly create the SessionService. static const int kCreateSessionServiceDelayMS = 500; diff --git a/chrome/browser/profiles/profile_impl.h b/chrome/browser/profiles/profile_impl.h index 2742279..b5619d1 100644 --- a/chrome/browser/profiles/profile_impl.h +++ b/chrome/browser/profiles/profile_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -316,6 +316,20 @@ class ProfileImpl : public Profile, scoped_ptr<ChromeURLDataManager> chrome_url_data_manager_; + // STOP!!!! DO NOT ADD ANY MORE ITEMS HERE!!!! + // + // Instead, make your Service/Manager/whatever object you're hanging off the + // Profile use our new ProfileKeyedServiceFactory system instead. You can + // find the design document here: + // + // https://sites.google.com/a/chromium.org/dev/developers/design-documents/profile-architecture + // + // and you can read the raw headers here: + // + // chrome/browser/profile/profile_keyed_service.h + // chrome/browser/profile/profile_keyed_service_factory.{h,cc} + // chrome/browser/profile/profile_keyed_dependency_manager.{h,cc} + Profile::Delegate* delegate_; chrome_browser_net::Predictor* predictor_; |