Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/extensions/api/feedback_private/single_log_source_facto ry.h" | |
| 6 | |
| 7 namespace extensions { | |
| 8 | |
| 9 namespace { | |
| 10 | |
| 11 using system_logs::SingleLogSource; | |
| 12 | |
| 13 const SingleLogSourceFactory::CreateCallback* g_callback = nullptr; | |
| 14 | |
| 15 } // namespace | |
| 16 | |
| 17 // static | |
| 18 std::unique_ptr<SingleLogSource> SingleLogSourceFactory::CreateSingleLogSource( | |
| 19 SingleLogSource::SupportedSource type) { | |
| 20 return std::unique_ptr<SingleLogSource>( | |
| 21 g_callback ? g_callback->Run(type) : new SingleLogSource(type)); | |
|
tbarzic
2017/06/01 19:23:46
use MakeUnique instead of new
Simon Que
2017/06/01 21:49:10
Done.
| |
| 22 } | |
| 23 | |
| 24 // static | |
| 25 void SingleLogSourceFactory::InitForTesting( | |
| 26 const SingleLogSourceFactory::CreateCallback* callback) { | |
| 27 g_callback = callback; | |
| 28 } | |
| 29 | |
| 30 } // namespace extensions | |
| OLD | NEW |