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

Side by Side Diff: chrome/browser/chromeos/dbus/blocking_method_caller.h

Issue 9838085: Move files inside chrome/browser/chromeos/dbus to chromeos/dbus (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_CHROMEOS_DBUS_BLOCKING_METHOD_CALLER_H_
6 #define CHROME_BROWSER_CHROMEOS_DBUS_BLOCKING_METHOD_CALLER_H_
7 #pragma once
8
9 #include "base/callback.h"
10 #include "base/synchronization/waitable_event.h"
11
12 namespace dbus {
13
14 class Bus;
15 class ObjectProxy;
16 class MethodCall;
17 class Response;
18
19 } // namespace dbus
20
21 namespace chromeos {
22
23 // A utility class to call D-Bus methods in a synchronous (blocking) way.
24 // Note: Blocking the thread until it returns is not a good idea in most cases.
25 // Avoid using this class as hard as you can.
26 class BlockingMethodCaller {
27 public:
28 BlockingMethodCaller(dbus::Bus* bus, dbus::ObjectProxy* proxy);
29 virtual ~BlockingMethodCaller();
30
31 // Calls the method and blocks until it returns.
32 // The caller is responsible to delete the returned object.
33 dbus::Response* CallMethodAndBlock(dbus::MethodCall* method_call);
34
35 private:
36 dbus::Bus* bus_;
37 dbus::ObjectProxy* proxy_;
38 base::WaitableEvent on_blocking_method_call_;
39
40 DISALLOW_COPY_AND_ASSIGN(BlockingMethodCaller);
41 };
42
43 } // namespace chromeos
44
45 #endif // CHROME_BROWSER_CHROMEOS_DBUS_BLOCKING_METHOD_CALLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/cryptohome/async_method_caller.cc ('k') | chrome/browser/chromeos/dbus/blocking_method_caller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698