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

Side by Side Diff: drm-tool.cc

Issue 6854002: Merge monitor_reconfigure into powerd. (Closed) Base URL: ssh://gitrw.chromium.org:9222/power_manager.git@master
Patch Set: Address first round of reviews, fixing the tests still a TODO. Created 9 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 | Annotate | Revision Log
« no previous file with comments | « SConstruct ('k') | monitor_reconfigure.h » ('j') | powerd.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium OS 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 <gdk/gdk.h>
6 #include <gflags/gflags.h>
7 #include <glib.h>
8 #include <inttypes.h>
9
10 #include <cstdio>
11
12 #include "base/logging.h"
13 #include "base/scoped_ptr.h"
tfarina 2011/04/14 02:36:05 I don't see any uses of scoped_ptr here.
marcheu 2011/04/14 02:52:10 Done.
14 #include "base/string_util.h"
tfarina 2011/04/14 02:36:05 Why do you need this include?
marcheu 2011/04/14 02:52:10 Removed.
15 #include "power_manager/udev_listener.h"
16
17 // drm-tool: A simple tool to monitor drm hotplug events with udev.
18
19 class DrmCallback : public power_manager::UdevCallback {
20 public:
21 void Run(GIOChannel* source, GIOCondition condition) {
22 (void) source;
tfarina 2011/04/14 02:36:05 hum? If it's to please the compiler, maybe /* sour
marcheu 2011/04/14 02:52:10 Done.
23 (void) condition;
24 printf("Udev drm callback\n");
tfarina 2011/04/14 02:36:05 Could you use some other macro from logging.h inst
marcheu 2011/04/14 02:52:10 Hmm, but other *tool.cc files use printf.
25 }
26 };
27
28 int main(int argc, char* argv[]) {
tfarina 2011/04/14 02:36:05 I'd change this to char** argv (just personal pref
marcheu 2011/04/14 02:52:10 All of chrome OS (including other tools) uses int
29 google::ParseCommandLineFlags(&argc, &argv, true);
30 DrmCallback callback;
31 power_manager::UdevListener drm_listener(&callback, "drm");
32 if (!drm_listener.Init())
33 LOG(WARNING) << "Cannot initialize drm listener";
34 GMainLoop* loop = g_main_loop_new(NULL, false);
35 g_main_loop_run(loop);
36 return 0;
37 }
38
tfarina 2011/04/14 02:36:05 remove this blank line.
marcheu 2011/04/14 02:52:10 Done.
OLDNEW
« no previous file with comments | « SConstruct ('k') | monitor_reconfigure.h » ('j') | powerd.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698