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

Side by Side Diff: chrome/browser/extensions/api/feedback_private/log_source_resource.cc

Issue 2840103002: Add new API function: feedbackPrivate.readLogSource (Closed)
Patch Set: Refactor passing of params from API into Log Source Created 3 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 unified diff | Download patch
OLDNEW
(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/log_source_resource.h"
6
7 #include "base/lazy_instance.h"
8
9 namespace extensions {
10
11 // For managing API resources of type LogSourceResource.
12 static base::LazyInstance<BrowserContextKeyedAPIFactory<
13 ApiResourceManager<LogSourceResource>>>::DestructorAtExit
tbarzic 2017/06/06 20:27:26 Can this be leaky instead? (see https://cs.chromiu
Simon Que 2017/06/06 22:29:15 It doesn't work, results in a crash. DestructorAt
14 g_log_source_resource_factory = LAZY_INSTANCE_INITIALIZER;
15
16 // static
17 template <>
18 BrowserContextKeyedAPIFactory<ApiResourceManager<LogSourceResource>>*
19 ApiResourceManager<LogSourceResource>::GetFactoryInstance() {
20 return g_log_source_resource_factory.Pointer();
21 }
22
23 LogSourceResource::LogSourceResource(
24 const std::string& extension_id,
25 std::unique_ptr<system_logs::SingleLogSource> source,
26 base::Closure unregister_callback)
27 : ApiResource(extension_id),
28 source_(source.release()),
29 unregister_runner_(unregister_callback) {}
30
31 LogSourceResource::~LogSourceResource() {}
32
33 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698