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

Unified 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: Second version with nits. 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 side-by-side diff with in-line comments
Download patch
Index: drm-tool.cc
diff --git a/drm-tool.cc b/drm-tool.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f065aeb7a7fea19b3ee1722d4a13c4fad9464423
--- /dev/null
+++ b/drm-tool.cc
@@ -0,0 +1,38 @@
+// Copyright (c) 2011 The Chromium OS 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 <gdk/gdk.h>
+#include <gflags/gflags.h>
+#include <glib.h>
+#include <inttypes.h>
+
+#include <cstdio>
+
+#include "base/logging.h"
+#include "base/scoped_ptr.h"
+#include "base/string_util.h"
+#include "power_manager/udev_listener.h"
+
+// drm-tool: A simple tool to monitor drm hotplug events with udev.
+
+class DrmCallBack : public power_manager::UdevCallBack {
Daniel Erat 2011/04/13 23:33:26 nit: i think that i've typically seen this written
marcheu 2011/04/14 02:23:55 Done.
+ public:
+ void CallBack(GIOChannel* source, GIOCondition condition) {
+ (void) source;
+ (void) condition;
+ printf("Udev drm callback\n");
+ }
+};
+
+int main(int argc, char* argv[]) {
+ google::ParseCommandLineFlags(&argc, &argv, true);
+ DrmCallBack callback;
+ power_manager::UdevListener drm_listener(&callback, "drm");
+ if (!drm_listener.Init())
+ LOG(WARNING) << "Cannot initialize drm listener";
+ GMainLoop* loop = g_main_loop_new(NULL, false);
+ g_main_loop_run(loop);
+ return 0;
+}
+

Powered by Google App Engine
This is Rietveld 408576698