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

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

Issue 1049873005: [chrome/browser/chromeos/] favor DCHECK_CURRENTLY_ON for better logs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « chrome/browser/chromeos/system_logs/debug_daemon_log_source.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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/chromeos/system_logs/device_event_log_source.h" 5 #include "chrome/browser/chromeos/system_logs/device_event_log_source.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "components/device_event_log/device_event_log.h" 8 #include "components/device_event_log/device_event_log.h"
9 #include "content/public/browser/browser_thread.h" 9 #include "content/public/browser/browser_thread.h"
10 10
11 namespace system_logs { 11 namespace system_logs {
12 12
13 const char kNetworkEventLogEntry[] = "network_event_log"; 13 const char kNetworkEventLogEntry[] = "network_event_log";
14 const char kDeviceEventLogEntry[] = "device_event_log"; 14 const char kDeviceEventLogEntry[] = "device_event_log";
15 15
16 DeviceEventLogSource::DeviceEventLogSource() : SystemLogsSource("DeviceEvent") { 16 DeviceEventLogSource::DeviceEventLogSource() : SystemLogsSource("DeviceEvent") {
17 } 17 }
18 18
19 DeviceEventLogSource::~DeviceEventLogSource() { 19 DeviceEventLogSource::~DeviceEventLogSource() {
20 } 20 }
21 21
22 void DeviceEventLogSource::Fetch(const SysLogsSourceCallback& callback) { 22 void DeviceEventLogSource::Fetch(const SysLogsSourceCallback& callback) {
23 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 23 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
24 DCHECK(!callback.is_null()); 24 DCHECK(!callback.is_null());
25 25
26 scoped_ptr<SystemLogsResponse> response(new SystemLogsResponse); 26 scoped_ptr<SystemLogsResponse> response(new SystemLogsResponse);
27 const int kMaxDeviceEventsForAboutSystem = 400; 27 const int kMaxDeviceEventsForAboutSystem = 400;
28 (*response)[kNetworkEventLogEntry] = device_event_log::GetAsString( 28 (*response)[kNetworkEventLogEntry] = device_event_log::GetAsString(
29 device_event_log::OLDEST_FIRST, "time,file,level", "network", 29 device_event_log::OLDEST_FIRST, "time,file,level", "network",
30 device_event_log::kDefaultLogLevel, kMaxDeviceEventsForAboutSystem); 30 device_event_log::kDefaultLogLevel, kMaxDeviceEventsForAboutSystem);
31 (*response)[kDeviceEventLogEntry] = device_event_log::GetAsString( 31 (*response)[kDeviceEventLogEntry] = device_event_log::GetAsString(
32 device_event_log::OLDEST_FIRST, "time,file,type,level", "non-network", 32 device_event_log::OLDEST_FIRST, "time,file,type,level", "non-network",
33 device_event_log::LOG_LEVEL_DEBUG, kMaxDeviceEventsForAboutSystem); 33 device_event_log::LOG_LEVEL_DEBUG, kMaxDeviceEventsForAboutSystem);
34 callback.Run(response.get()); 34 callback.Run(response.get());
35 } 35 }
36 36
37 } // namespace system_logs 37 } // namespace system_logs
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/system_logs/debug_daemon_log_source.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698