| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "chrome/browser/extensions/api/feedback_private/log_source_resource.h" | 5 #include "chrome/browser/extensions/api/feedback_private/log_source_resource.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 | 8 |
| 9 namespace extensions { | 9 namespace extensions { |
| 10 | 10 |
| 11 // For managing API resources of type LogSourceResource. | 11 // For managing API resources of type LogSourceResource. |
| 12 static base::LazyInstance<BrowserContextKeyedAPIFactory< | 12 static base::LazyInstance<BrowserContextKeyedAPIFactory< |
| 13 ApiResourceManager<LogSourceResource>>>::DestructorAtExit | 13 ApiResourceManager<LogSourceResource>>>::DestructorAtExit |
| 14 g_log_source_resource_factory = LAZY_INSTANCE_INITIALIZER; | 14 g_log_source_resource_factory = LAZY_INSTANCE_INITIALIZER; |
| 15 | 15 |
| 16 // static | 16 // static |
| 17 template <> | 17 template <> |
| 18 BrowserContextKeyedAPIFactory<ApiResourceManager<LogSourceResource>>* | 18 BrowserContextKeyedAPIFactory<ApiResourceManager<LogSourceResource>>* |
| 19 ApiResourceManager<LogSourceResource>::GetFactoryInstance() { | 19 ApiResourceManager<LogSourceResource>::GetFactoryInstance() { |
| 20 return g_log_source_resource_factory.Pointer(); | 20 return g_log_source_resource_factory.Pointer(); |
| 21 } | 21 } |
| 22 | 22 |
| 23 LogSourceResource::LogSourceResource( | 23 LogSourceResource::LogSourceResource( |
| 24 const std::string& extension_id, | 24 const std::string& extension_id, |
| 25 std::unique_ptr<system_logs::SingleLogSource> source, | 25 std::unique_ptr<system_logs::SystemLogsSource> source, |
| 26 base::Closure unregister_callback) | 26 base::Closure unregister_callback) |
| 27 : ApiResource(extension_id), | 27 : ApiResource(extension_id), |
| 28 source_(source.release()), | 28 source_(source.release()), |
| 29 unregister_runner_(unregister_callback) {} | 29 unregister_runner_(unregister_callback) {} |
| 30 | 30 |
| 31 LogSourceResource::~LogSourceResource() {} | 31 LogSourceResource::~LogSourceResource() {} |
| 32 | 32 |
| 33 } // namespace extensions | 33 } // namespace extensions |
| OLD | NEW |