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

Unified Diff: chrome/browser/extensions/api/feedback_private/single_log_source_factory.cc

Issue 2840103002: Add new API function: feedbackPrivate.readLogSource (Closed)
Patch Set: Add comments to SingleLogSourceFactory; Add new histogram enum Created 3 years, 7 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: chrome/browser/extensions/api/feedback_private/single_log_source_factory.cc
diff --git a/chrome/browser/extensions/api/feedback_private/single_log_source_factory.cc b/chrome/browser/extensions/api/feedback_private/single_log_source_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5e0ffb7e7a6ade61f28a33c5b2ac1f9ccab4785a
--- /dev/null
+++ b/chrome/browser/extensions/api/feedback_private/single_log_source_factory.cc
@@ -0,0 +1,30 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/extensions/api/feedback_private/single_log_source_factory.h"
+
+namespace extensions {
+
+namespace {
+
+const SingleLogSourceFactory::CreateCallback* g_callback = nullptr;
+
+} // namespace
+
+// static
+system_logs::SingleLogSource* SingleLogSourceFactory::CreateSingleLogSource(
+ system_logs::SingleLogSource::SupportedSource type) {
+ if (g_callback)
+ return g_callback->Run(type);
+
+ return new system_logs::SingleLogSource(type);
+}
+
+// static
+void SingleLogSourceFactory::InitForTesting(
+ const SingleLogSourceFactory::CreateCallback* callback) {
+ g_callback = callback;
+}
+
+} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698