diff options
author | msw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-10 22:56:01 +0000 |
---|---|---|
committer | msw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-10 22:56:01 +0000 |
commit | dff69fd38aa755ecd8ddd9348fbade0827d780ad (patch) | |
tree | 425ce1ad91ce5c174baaf4127b3e127c93b46648 /chrome/browser/chrome_to_mobile_service_factory.cc | |
parent | 1a23d36a9ffa591b56a2fc0826b92d19904bfa34 (diff) | |
download | chromium_src-dff69fd38aa755ecd8ddd9348fbade0827d780ad.zip chromium_src-dff69fd38aa755ecd8ddd9348fbade0827d780ad.tar.gz chromium_src-dff69fd38aa755ecd8ddd9348fbade0827d780ad.tar.bz2 |
Improve Chrome To Mobile shapshot file handling.
Nix the ScopedTempDir previously used for snapshots.
Nix ChromeToMobileService::Init, restore logic to ctor.
Create each snapshot temp file in a blocking pool task.
Track the set of temp files to ensure deletion later.
Post sequenced tasks to submit and delete the snapshot.
Delete snapshots on bubble close or service destruction.
Use a WeakPtrFactory instead of a RefCounted* base class.
BUG=102709,121003,122135
TEST=No user-facing changes to Chrome To Mobile.
Review URL: http://codereview.chromium.org/9959132
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131664 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chrome_to_mobile_service_factory.cc')
-rw-r--r-- | chrome/browser/chrome_to_mobile_service_factory.cc | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/chrome/browser/chrome_to_mobile_service_factory.cc b/chrome/browser/chrome_to_mobile_service_factory.cc index 9cd082e..e669003 100644 --- a/chrome/browser/chrome_to_mobile_service_factory.cc +++ b/chrome/browser/chrome_to_mobile_service_factory.cc @@ -15,28 +15,24 @@ ChromeToMobileServiceFactory* ChromeToMobileServiceFactory::GetInstance() { } // static -scoped_refptr<ChromeToMobileService> -ChromeToMobileServiceFactory::GetForProfile(Profile* profile) { +ChromeToMobileService* ChromeToMobileServiceFactory::GetForProfile( + Profile* profile) { return static_cast<ChromeToMobileService*>( - GetInstance()->GetServiceForProfile(profile, true).get()); + GetInstance()->GetServiceForProfile(profile, true)); } -scoped_refptr<RefcountedProfileKeyedService> -ChromeToMobileServiceFactory::BuildServiceInstanceFor(Profile* profile) const { +ProfileKeyedService* ChromeToMobileServiceFactory::BuildServiceInstanceFor( + Profile* profile) const { // Ensure that the service is not instantiated or used if it is disabled. if (!ChromeToMobileService::IsChromeToMobileEnabled()) return NULL; - scoped_refptr<ChromeToMobileService> service = - new ChromeToMobileService(profile); - service->Init(); - return service; + return new ChromeToMobileService(profile); } ChromeToMobileServiceFactory::ChromeToMobileServiceFactory() - : RefcountedProfileKeyedServiceFactory( - "ChromeToMobileService", - ProfileDependencyManager::GetInstance()) { + : ProfileKeyedServiceFactory("ChromeToMobileService", + ProfileDependencyManager::GetInstance()) { DependsOn(TokenServiceFactory::GetInstance()); DependsOn(CookieSettings::Factory::GetInstance()); } |