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

Side by Side Diff: chrome/browser/chromeos/system_logs/device_event_log_source.cc

Issue 773703002: Generalize network_event_log -> device_event_log (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase + feedback Created 6 years 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 2014 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/chromeos/system_logs/device_event_log_source.h"
6
7 #include "base/message_loop/message_loop.h"
8 #include "chromeos/device_event_log.h"
9 #include "content/public/browser/browser_thread.h"
10
11 namespace system_logs {
12
13 const char kNetworkEventLogEntry[] = "network_event_log";
14 const char kDeviceEventLogEntry[] = "device_event_log";
15
16 DeviceEventLogSource::DeviceEventLogSource() : SystemLogsSource("DeviceEvent") {
17 }
18
19 DeviceEventLogSource::~DeviceEventLogSource() {
20 }
21
22 void DeviceEventLogSource::Fetch(const SysLogsSourceCallback& callback) {
23 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
24 DCHECK(!callback.is_null());
25
26 scoped_ptr<SystemLogsResponse> response(new SystemLogsResponse);
27 const int kMaxDeviceEventsForAboutSystem = 400;
28 (*response)[kNetworkEventLogEntry] = chromeos::device_event_log::GetAsString(
29 chromeos::device_event_log::OLDEST_FIRST, "time,file,level",
30 chromeos::device_event_log::LOG_TYPE_NETWORK,
31 chromeos::device_event_log::kDefaultLogLevel,
32 kMaxDeviceEventsForAboutSystem);
33 (*response)[kDeviceEventLogEntry] = chromeos::device_event_log::GetAsString(
34 chromeos::device_event_log::OLDEST_FIRST, "time,file,type,level",
35 chromeos::device_event_log::LOG_TYPE_NON_NETWORK,
36 chromeos::device_event_log::LOG_LEVEL_DEBUG,
37 kMaxDeviceEventsForAboutSystem);
38 callback.Run(response.get());
39 }
40
41 } // namespace system_logs
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698