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

Side by Side Diff: extensions/browser/api/storage/storage_frontend.cc

Issue 1165913002: [Cleanup] Used scoped pointers in KeyedServiceFactory's SetTestingFactory functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/api/storage/storage_frontend.h" 5 #include "extensions/browser/api/storage/storage_frontend.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 }; 58 };
59 59
60 } // namespace 60 } // namespace
61 61
62 // static 62 // static
63 StorageFrontend* StorageFrontend::Get(BrowserContext* context) { 63 StorageFrontend* StorageFrontend::Get(BrowserContext* context) {
64 return BrowserContextKeyedAPIFactory<StorageFrontend>::Get(context); 64 return BrowserContextKeyedAPIFactory<StorageFrontend>::Get(context);
65 } 65 }
66 66
67 // static 67 // static
68 StorageFrontend* StorageFrontend::CreateForTesting( 68 scoped_ptr<StorageFrontend> StorageFrontend::CreateForTesting(
69 const scoped_refptr<SettingsStorageFactory>& storage_factory, 69 const scoped_refptr<SettingsStorageFactory>& storage_factory,
70 BrowserContext* context) { 70 BrowserContext* context) {
71 return new StorageFrontend(storage_factory, context); 71 return make_scoped_ptr(new StorageFrontend(storage_factory, context));
72 } 72 }
73 73
74 StorageFrontend::StorageFrontend(BrowserContext* context) 74 StorageFrontend::StorageFrontend(BrowserContext* context)
75 : browser_context_(context) { 75 : browser_context_(context) {
76 Init(new LeveldbSettingsStorageFactory()); 76 Init(new LeveldbSettingsStorageFactory());
77 } 77 }
78 78
79 StorageFrontend::StorageFrontend( 79 StorageFrontend::StorageFrontend(
80 const scoped_refptr<SettingsStorageFactory>& factory, 80 const scoped_refptr<SettingsStorageFactory>& factory,
81 BrowserContext* context) 81 BrowserContext* context)
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 // static 176 // static
177 BrowserContextKeyedAPIFactory<StorageFrontend>* 177 BrowserContextKeyedAPIFactory<StorageFrontend>*
178 StorageFrontend::GetFactoryInstance() { 178 StorageFrontend::GetFactoryInstance() {
179 return g_factory.Pointer(); 179 return g_factory.Pointer();
180 } 180 }
181 181
182 // static 182 // static
183 const char* StorageFrontend::service_name() { return "StorageFrontend"; } 183 const char* StorageFrontend::service_name() { return "StorageFrontend"; }
184 184
185 } // namespace extensions 185 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698