diff options
author | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-08 14:00:11 +0000 |
---|---|---|
committer | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-08 14:00:11 +0000 |
commit | 4bf6afd4a6c3c6c506a2b846b4ebf0c2c3f27805 (patch) | |
tree | 0293e2a7dbe89dfd0fb111cd9f0ecaee73d14155 /chrome/test | |
parent | 2dd1eb91fa07a6ec9a708093525834d7eab5a95e (diff) | |
download | chromium_src-4bf6afd4a6c3c6c506a2b846b4ebf0c2c3f27805.zip chromium_src-4bf6afd4a6c3c6c506a2b846b4ebf0c2c3f27805.tar.gz chromium_src-4bf6afd4a6c3c6c506a2b846b4ebf0c2c3f27805.tar.bz2 |
Committing change 255087 for Roger:
TBR=amit
http://codereview.chromium.org/255087
Adding a unique runtime Id to Profile objects, that can be used as the key
of the ProfileSiteInstanceMap type. This is used to make sure that Profile
objects can correctly share site information when one profile is derived
from another.
BUG=0
TEST=See unit tests
Review URL: http://codereview.chromium.org/261012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28390 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r-- | chrome/test/testing_profile.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/chrome/test/testing_profile.h b/chrome/test/testing_profile.h index 14c31443..5fd855a 100644 --- a/chrome/test/testing_profile.h +++ b/chrome/test/testing_profile.h @@ -57,6 +57,10 @@ class TestingProfile : public Profile { // ownership of |theme_provider|. void UseThemeProvider(BrowserThemeProvider* theme_provider); + virtual ProfileId GetRuntimeId() { + return reinterpret_cast<ProfileId>(this); + } + virtual FilePath GetPath() { return path_; } @@ -221,4 +225,20 @@ class TestingProfile : public Profile { bool last_session_exited_cleanly_; }; +// A profile that derives from another profile. This does not actually +// override anything except the GetRuntimeId() in order to test sharing of +// site information. +class DerivedTestingProfile : public TestingProfile { + public: + DerivedTestingProfile(Profile* profile) : original_profile_(profile) { + } + + virtual ProfileId GetRuntimeId() { + return original_profile_->GetRuntimeId(); + } + + protected: + Profile* original_profile_; +}; + #endif // CHROME_TEST_TESTING_PROFILE_H_ |