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

Unified Diff: chrome/browser/services/gcm/chromeos_gcm_app_handler.cc

Issue 409883006: GCM: D-Bus methods for wake-on-packet (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move chromeos-specific code to gcm profile creation Created 6 years, 4 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: chrome/browser/services/gcm/chromeos_gcm_app_handler.cc
diff --git a/chrome/browser/services/gcm/chromeos_gcm_app_handler.cc b/chrome/browser/services/gcm/chromeos_gcm_app_handler.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8177071548607b8986bbe306072336af2fc241e1
--- /dev/null
+++ b/chrome/browser/services/gcm/chromeos_gcm_app_handler.cc
@@ -0,0 +1,40 @@
+// Copyright (c) 2014 The Chromium 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 "chrome/browser/services/gcm/chromeos_gcm_app_handler.h"
+
+#include "base/callback.h"
+#include "base/logging.h"
+#include "chromeos/dbus/dbus_thread_manager.h"
+#include "chromeos/dbus/shill_manager_client.h"
+
+namespace gcm {
+
+ChromeOSGCMAppHandler::ChromeOSGCMAppHandler() {
+}
+
+ChromeOSGCMAppHandler::~ChromeOSGCMAppHandler() {
+}
+
+// static
+void ChromeOSGCMAppHandler::ErrorCallback(
+ const std::string& error_name,
+ const std::string& error) {
+ LOG(ERROR) << "GCM D-Bus method error " << error_name << ": " << error;
+}
+
+void ChromeOSGCMAppHandler::OnConnected(const net::IPEndPoint& ip_endpoint) {
+ const std::string ip_endpoint_string = ip_endpoint.ToString();
+ chromeos::DBusThreadManager::Get()->
+ GetShillManagerClient()->
Daniel Erat 2014/08/21 22:17:37 nit: indent this four spaces beyond the previous l
Luigi Semenzato 2014/08/22 01:08:19 Done.
+ AddWakeOnPacketConnection(
+ ip_endpoint_string,
Daniel Erat 2014/08/21 22:17:37 nit: indent four spaces, not two
Luigi Semenzato 2014/08/22 01:08:19 Done.
+ base::Bind(&base::DoNothing),
+ base::Bind(&ChromeOSGCMAppHandler::ErrorCallback));
+}
+
+void ChromeOSGCMAppHandler::OnDisconnected() {
+}
+
+} // namespace gcm

Powered by Google App Engine
This is Rietveld 408576698