OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chromeos/dbus/introspectable_client.h" | 5 #include "chromeos/dbus/introspectable_client.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 } // namespace | 28 } // namespace |
29 | 29 |
30 namespace chromeos { | 30 namespace chromeos { |
31 | 31 |
32 // The IntrospectableClient implementation used in production. | 32 // The IntrospectableClient implementation used in production. |
33 class IntrospectableClientImpl : public IntrospectableClient { | 33 class IntrospectableClientImpl : public IntrospectableClient { |
34 public: | 34 public: |
35 explicit IntrospectableClientImpl(dbus::Bus* bus) | 35 explicit IntrospectableClientImpl(dbus::Bus* bus) |
36 : bus_(bus), | 36 : bus_(bus), |
37 weak_ptr_factory_(this) { | 37 weak_ptr_factory_(this) { |
38 DVLOG(1) << "Creating IntrospectableClientImpl"; | |
39 } | 38 } |
40 | 39 |
41 virtual ~IntrospectableClientImpl() { | 40 virtual ~IntrospectableClientImpl() { |
42 } | 41 } |
43 | 42 |
44 // IntrospectableClient override. | 43 // IntrospectableClient override. |
45 virtual void Introspect(const std::string& service_name, | 44 virtual void Introspect(const std::string& service_name, |
46 const dbus::ObjectPath& object_path, | 45 const dbus::ObjectPath& object_path, |
47 const IntrospectCallback& callback) OVERRIDE { | 46 const IntrospectCallback& callback) OVERRIDE { |
48 dbus::MethodCall method_call(kIntrospectableInterface, kIntrospect); | 47 dbus::MethodCall method_call(kIntrospectableInterface, kIntrospect); |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 IntrospectableClient* IntrospectableClient::Create( | 147 IntrospectableClient* IntrospectableClient::Create( |
149 DBusClientImplementationType type, | 148 DBusClientImplementationType type, |
150 dbus::Bus* bus) { | 149 dbus::Bus* bus) { |
151 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) | 150 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) |
152 return new IntrospectableClientImpl(bus); | 151 return new IntrospectableClientImpl(bus); |
153 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); | 152 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); |
154 return new IntrospectableClientStubImpl(); | 153 return new IntrospectableClientStubImpl(); |
155 } | 154 } |
156 | 155 |
157 } // namespace chromeos | 156 } // namespace chromeos |
OLD | NEW |