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

Side by Side Diff: chrome/browser/extensions/api/api_resource_manager.h

Issue 140613002: Cleanup: Replace &LazyInstance::Get() with LazyInstance::Pointer(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_EXTENSIONS_API_API_RESOURCE_MANAGER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_API_RESOURCE_MANAGER_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_API_RESOURCE_MANAGER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_API_RESOURCE_MANAGER_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 // In the cc file: 60 // In the cc file:
61 // 61 //
62 // static base::LazyInstance<ProfileKeyedAPIFactory< 62 // static base::LazyInstance<ProfileKeyedAPIFactory<
63 // ApiResourceManager<Resource> > > 63 // ApiResourceManager<Resource> > >
64 // g_factory = LAZY_INSTANCE_INITIALIZER; 64 // g_factory = LAZY_INSTANCE_INITIALIZER;
65 // 65 //
66 // 66 //
67 // template <> 67 // template <>
68 // ProfileKeyedAPIFactory<ApiResourceManager<Resource> >* 68 // ProfileKeyedAPIFactory<ApiResourceManager<Resource> >*
69 // ApiResourceManager<Resource>::GetFactoryInstance() { 69 // ApiResourceManager<Resource>::GetFactoryInstance() {
70 // return &g_factory.Get(); 70 // return g_factory.Pointer();
71 // } 71 // }
72 template <class T> 72 template <class T>
73 class ApiResourceManager : public ProfileKeyedAPI, 73 class ApiResourceManager : public ProfileKeyedAPI,
74 public base::NonThreadSafe, 74 public base::NonThreadSafe,
75 public content::NotificationObserver { 75 public content::NotificationObserver {
76 public: 76 public:
77 explicit ApiResourceManager(Profile* profile) 77 explicit ApiResourceManager(Profile* profile)
78 : thread_id_(T::kThreadId), 78 : thread_id_(T::kThreadId),
79 data_(new ApiResourceData(thread_id_)) { 79 data_(new ApiResourceData(thread_id_)) {
80 registrar_.Add( 80 registrar_.Add(
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 }; 325 };
326 326
327 content::BrowserThread::ID thread_id_; 327 content::BrowserThread::ID thread_id_;
328 content::NotificationRegistrar registrar_; 328 content::NotificationRegistrar registrar_;
329 scoped_refptr<ApiResourceData> data_; 329 scoped_refptr<ApiResourceData> data_;
330 }; 330 };
331 331
332 } // namespace extensions 332 } // namespace extensions
333 333
334 #endif // CHROME_BROWSER_EXTENSIONS_API_API_RESOURCE_MANAGER_H_ 334 #endif // CHROME_BROWSER_EXTENSIONS_API_API_RESOURCE_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/alarms/alarm_manager.cc ('k') | chrome/browser/extensions/api/audio/audio_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698