OLD | NEW |
1 | 1 |
2 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 | 5 |
6 #ifndef DBUS_BUS_H_ | 6 #ifndef DBUS_BUS_H_ |
7 #define DBUS_BUS_H_ | 7 #define DBUS_BUS_H_ |
8 #pragma once | 8 #pragma once |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 | 361 |
362 // Check whether the current thread is on the origin thread (the thread | 362 // Check whether the current thread is on the origin thread (the thread |
363 // that created the bus). If not, DCHECK will fail. | 363 // that created the bus). If not, DCHECK will fail. |
364 virtual void AssertOnOriginThread(); | 364 virtual void AssertOnOriginThread(); |
365 | 365 |
366 // Check whether the current thread is on the D-Bus thread. If not, | 366 // Check whether the current thread is on the D-Bus thread. If not, |
367 // DCHECK will fail. If the D-Bus thread is not supplied, it calls | 367 // DCHECK will fail. If the D-Bus thread is not supplied, it calls |
368 // AssertOnOriginThread(). | 368 // AssertOnOriginThread(). |
369 virtual void AssertOnDBusThread(); | 369 virtual void AssertOnDBusThread(); |
370 | 370 |
| 371 protected: |
| 372 // This is protected, so we can define sub classes. |
| 373 virtual ~Bus(); |
| 374 |
371 private: | 375 private: |
372 friend class base::RefCountedThreadSafe<Bus>; | 376 friend class base::RefCountedThreadSafe<Bus>; |
373 virtual ~Bus(); | |
374 | 377 |
375 // Helper function used for Shutdown(). | 378 // Helper function used for Shutdown(). |
376 void ShutdownInternal(OnShutdownCallback callback); | 379 void ShutdownInternal(OnShutdownCallback callback); |
377 | 380 |
378 // Processes the all incoming data to the connection, if any. | 381 // Processes the all incoming data to the connection, if any. |
379 // | 382 // |
380 // BLOCKING CALL. | 383 // BLOCKING CALL. |
381 void ProcessAllIncomingDataIfAny(); | 384 void ProcessAllIncomingDataIfAny(); |
382 | 385 |
383 // Called when a watch object is added. Used to start monitoring the | 386 // Called when a watch object is added. Used to start monitoring the |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 // OnAddTimeout()/OnRemoveTimeou() are balanced. | 454 // OnAddTimeout()/OnRemoveTimeou() are balanced. |
452 int num_pending_watches_; | 455 int num_pending_watches_; |
453 int num_pending_timeouts_; | 456 int num_pending_timeouts_; |
454 | 457 |
455 DISALLOW_COPY_AND_ASSIGN(Bus); | 458 DISALLOW_COPY_AND_ASSIGN(Bus); |
456 }; | 459 }; |
457 | 460 |
458 } // namespace dbus | 461 } // namespace dbus |
459 | 462 |
460 #endif // DBUS_BUS_H_ | 463 #endif // DBUS_BUS_H_ |
OLD | NEW |