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

Side by Side Diff: chromeos/dbus/cashew_client.cc

Issue 10024054: chromeos: Convert D-Bus client classes' callback arguments to const reference (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 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 | « chromeos/dbus/cashew_client.h ('k') | chromeos/dbus/cros_disks_client.h » ('j') | 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) 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/cashew_client.h" 5 #include "chromeos/dbus/cashew_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "dbus/bus.h" 9 #include "dbus/bus.h"
10 #include "dbus/message.h" 10 #include "dbus/message.h"
(...skipping 23 matching lines...) Expand all
34 cashew::kCashewServiceInterface, 34 cashew::kCashewServiceInterface,
35 cashew::kMonitorDataPlanUpdate, 35 cashew::kMonitorDataPlanUpdate,
36 base::Bind(&CashewClientImpl::OnDataPlansUpdate, 36 base::Bind(&CashewClientImpl::OnDataPlansUpdate,
37 weak_ptr_factory_.GetWeakPtr()), 37 weak_ptr_factory_.GetWeakPtr()),
38 base::Bind(&CashewClientImpl::OnSignalConnected, 38 base::Bind(&CashewClientImpl::OnSignalConnected,
39 weak_ptr_factory_.GetWeakPtr())); 39 weak_ptr_factory_.GetWeakPtr()));
40 } 40 }
41 41
42 // CashewClient override. 42 // CashewClient override.
43 virtual void SetDataPlansUpdateHandler( 43 virtual void SetDataPlansUpdateHandler(
44 DataPlansUpdateHandler handler) OVERRIDE { 44 const DataPlansUpdateHandler& handler) OVERRIDE {
45 data_plans_update_handler_ = handler; 45 data_plans_update_handler_ = handler;
46 } 46 }
47 47
48 // CashewClient override. 48 // CashewClient override.
49 virtual void ResetDataPlansUpdateHandler() OVERRIDE { 49 virtual void ResetDataPlansUpdateHandler() OVERRIDE {
50 data_plans_update_handler_.Reset(); 50 data_plans_update_handler_.Reset();
51 } 51 }
52 52
53 // CashewClient override. 53 // CashewClient override.
54 virtual void RequestDataPlansUpdate() OVERRIDE { 54 virtual void RequestDataPlansUpdate() OVERRIDE {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 94
95 // A stub implementaion of CashewClient. 95 // A stub implementaion of CashewClient.
96 class CashewClientStubImpl : public CashewClient { 96 class CashewClientStubImpl : public CashewClient {
97 public: 97 public:
98 CashewClientStubImpl() {} 98 CashewClientStubImpl() {}
99 99
100 virtual ~CashewClientStubImpl() {} 100 virtual ~CashewClientStubImpl() {}
101 101
102 // CashewClient override. 102 // CashewClient override.
103 virtual void SetDataPlansUpdateHandler( 103 virtual void SetDataPlansUpdateHandler(
104 DataPlansUpdateHandler handler) OVERRIDE {} 104 const DataPlansUpdateHandler& handler) OVERRIDE {}
105 105
106 // CashewClient override. 106 // CashewClient override.
107 virtual void ResetDataPlansUpdateHandler() OVERRIDE {} 107 virtual void ResetDataPlansUpdateHandler() OVERRIDE {}
108 108
109 // CashewClient override. 109 // CashewClient override.
110 virtual void RequestDataPlansUpdate() OVERRIDE {} 110 virtual void RequestDataPlansUpdate() OVERRIDE {}
111 111
112 private: 112 private:
113 DISALLOW_COPY_AND_ASSIGN(CashewClientStubImpl); 113 DISALLOW_COPY_AND_ASSIGN(CashewClientStubImpl);
114 }; 114 };
(...skipping 10 matching lines...) Expand all
125 // static 125 // static
126 CashewClient* CashewClient::Create(DBusClientImplementationType type, 126 CashewClient* CashewClient::Create(DBusClientImplementationType type,
127 dbus::Bus* bus) { 127 dbus::Bus* bus) {
128 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) 128 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION)
129 return new CashewClientImpl(bus); 129 return new CashewClientImpl(bus);
130 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); 130 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type);
131 return new CashewClientStubImpl(); 131 return new CashewClientStubImpl();
132 } 132 }
133 133
134 } // namespace chromeos 134 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/cashew_client.h ('k') | chromeos/dbus/cros_disks_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698