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

Side by Side Diff: dbus/bus.cc

Issue 10198034: Add more allow-wait suppressions on cros. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: 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 | « chrome/browser/chromeos/gdata/gdata_file_system.cc ('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) 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 // TODO(satorux): 5 // TODO(satorux):
6 // - Handle "disconnected" signal. 6 // - Handle "disconnected" signal.
7 7
8 #include "dbus/bus.h" 8 #include "dbus/bus.h"
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 } 361 }
362 362
363 void Bus::ShutdownOnDBusThreadAndBlock() { 363 void Bus::ShutdownOnDBusThreadAndBlock() {
364 AssertOnOriginThread(); 364 AssertOnOriginThread();
365 DCHECK(dbus_thread_message_loop_proxy_.get()); 365 DCHECK(dbus_thread_message_loop_proxy_.get());
366 366
367 PostTaskToDBusThread(FROM_HERE, base::Bind( 367 PostTaskToDBusThread(FROM_HERE, base::Bind(
368 &Bus::ShutdownOnDBusThreadAndBlockInternal, 368 &Bus::ShutdownOnDBusThreadAndBlockInternal,
369 this)); 369 this));
370 370
371 // http://crbug.com/125222
372 base::ThreadRestrictions::ScopedAllowWait allow_wait;
373
371 // Wait until the shutdown is complete on the D-Bus thread. 374 // Wait until the shutdown is complete on the D-Bus thread.
372 // The shutdown should not hang, but set timeout just in case. 375 // The shutdown should not hang, but set timeout just in case.
373 const int kTimeoutSecs = 3; 376 const int kTimeoutSecs = 3;
374 const base::TimeDelta timeout(base::TimeDelta::FromSeconds(kTimeoutSecs)); 377 const base::TimeDelta timeout(base::TimeDelta::FromSeconds(kTimeoutSecs));
375 const bool signaled = on_shutdown_.TimedWait(timeout); 378 const bool signaled = on_shutdown_.TimedWait(timeout);
376 LOG_IF(ERROR, !signaled) << "Failed to shutdown the bus"; 379 LOG_IF(ERROR, !signaled) << "Failed to shutdown the bus";
377 } 380 }
378 381
379 void Bus::RequestOwnership(const std::string& service_name, 382 void Bus::RequestOwnership(const std::string& service_name,
380 OnOwnershipCallback on_ownership_callback) { 383 OnOwnershipCallback on_ownership_callback) {
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 } 830 }
828 831
829 void Bus::OnDispatchStatusChangedThunk(DBusConnection* connection, 832 void Bus::OnDispatchStatusChangedThunk(DBusConnection* connection,
830 DBusDispatchStatus status, 833 DBusDispatchStatus status,
831 void* data) { 834 void* data) {
832 Bus* self = static_cast<Bus*>(data); 835 Bus* self = static_cast<Bus*>(data);
833 return self->OnDispatchStatusChanged(connection, status); 836 return self->OnDispatchStatusChanged(connection, status);
834 } 837 }
835 838
836 } // namespace dbus 839 } // namespace dbus
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_file_system.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698