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

Unified Diff: extensions/browser/api/api_resource_manager.h

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 side-by-side diff with in-line comments
Download patch
Index: extensions/browser/api/api_resource_manager.h
diff --git a/extensions/browser/api/api_resource_manager.h b/extensions/browser/api/api_resource_manager.h
index e90cb33c302b61ac2e715945a2901d5633d05235..29040d0421224298894dae44da2e67097084342b 100644
--- a/extensions/browser/api/api_resource_manager.h
+++ b/extensions/browser/api/api_resource_manager.h
@@ -10,6 +10,7 @@
#include "base/containers/hash_tables.h"
#include "base/memory/linked_ptr.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
#include "base/scoped_observer.h"
#include "base/threading/non_thread_safe.h"
#include "components/keyed_service/core/keyed_service.h"
@@ -119,13 +120,12 @@ class ApiResourceManager : public BrowserContextKeyedAPI,
process_manager_observer_.Add(ProcessManager::Get(context));
}
// For Testing.
- static ApiResourceManager<T, TestThreadTraits<T> >*
+ static scoped_ptr<ApiResourceManager<T, TestThreadTraits<T>>>
CreateApiResourceManagerForTest(content::BrowserContext* context,
content::BrowserThread::ID thread_id) {
TestThreadTraits<T>::thread_id_ = thread_id;
- ApiResourceManager<T, TestThreadTraits<T> >* manager =
- new ApiResourceManager<T, TestThreadTraits<T> >(context);
- return manager;
+ return make_scoped_ptr(
+ new ApiResourceManager<T, TestThreadTraits<T>>(context));
}
virtual ~ApiResourceManager() {

Powered by Google App Engine
This is Rietveld 408576698