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

Side by Side Diff: src/common/chromeos/dbus/dbus.cc

Issue 2133004: Proxy Constructor for peer proxy. (Closed) Base URL: http://src.chromium.org/git/chromiumos.git
Patch Set: Created 10 years, 7 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 | « src/common/chromeos/dbus/dbus.h ('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 (c) 2009 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium OS 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 "chromeos/dbus/dbus.h" 5 #include "chromeos/dbus/dbus.h"
6 6
7 #include <dbus/dbus.h> 7 #include <dbus/dbus.h>
8 #include <dbus/dbus-glib-bindings.h> 8 #include <dbus/dbus-glib-bindings.h>
9 #include <dbus/dbus-glib-lowlevel.h> 9 #include <dbus/dbus-glib-lowlevel.h>
10 #include <base/logging.h> 10 #include <base/logging.h>
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 name, 118 name,
119 path, 119 path,
120 interface); 120 interface);
121 if (!result) { 121 if (!result) {
122 LOG(ERROR) << "Failed to construct proxy: " << path; 122 LOG(ERROR) << "Failed to construct proxy: " << path;
123 } 123 }
124 } 124 }
125 return result; 125 return result;
126 } 126 }
127 127
128 /* static */
129 Proxy::value_type Proxy::GetGPeerProxy(const BusConnection& connection,
130 const char* path,
131 const char* interface) {
132 value_type result = ::dbus_g_proxy_new_for_peer(connection.object_,
133 path,
134 interface);
135 if (!result)
136 LOG(ERROR) << "Failed to construct peer proxy: " << path;
137
138 return result;
139 }
140
128 bool RegisterExclusiveService(const BusConnection& connection, 141 bool RegisterExclusiveService(const BusConnection& connection,
129 const char* interface_name, 142 const char* interface_name,
130 const char* service_name, 143 const char* service_name,
131 const char* service_path, 144 const char* service_path,
132 GObject* object) { 145 GObject* object) {
133 CHECK(object); 146 CHECK(object);
134 CHECK(interface_name); 147 CHECK(interface_name);
135 CHECK(service_name); 148 CHECK(service_name);
136 // Create a proxy to DBus itself so that we can request to become a 149 // Create a proxy to DBus itself so that we can request to become a
137 // service name owner and then register an object at the related service path. 150 // service name owner and then register an object at the related service path.
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 dbus_g_connection_register_g_object(connection.g_connection(), 202 dbus_g_connection_register_g_object(connection.g_connection(),
190 service_path, 203 service_path,
191 object); 204 object);
192 return true; 205 return true;
193 } 206 }
194 207
195 208
196 209
197 } // namespace dbus 210 } // namespace dbus
198 } // namespace chromeos 211 } // namespace chromeos
OLDNEW
« no previous file with comments | « src/common/chromeos/dbus/dbus.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698