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

Side by Side Diff: chrome/browser/chromeos/gdata/gdata_file_system.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 | « base/threading/thread_restrictions.h ('k') | dbus/bus.cc » ('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 "chrome/browser/chromeos/gdata/gdata_file_system.h" 5 #include "chrome/browser/chromeos/gdata/gdata_file_system.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <sys/stat.h> 8 #include <sys/stat.h>
9 9
10 #include <set> 10 #include <set>
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after
925 925
926 GDataFileSystem::~GDataFileSystem() { 926 GDataFileSystem::~GDataFileSystem() {
927 // This should be called from UI thread, from GDataSystemService shutdown. 927 // This should be called from UI thread, from GDataSystemService shutdown.
928 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 928 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
929 929
930 pref_registrar_.reset(NULL); 930 pref_registrar_.reset(NULL);
931 931
932 // ui_weak_ptr_factory_ must be deleted on UI thread. 932 // ui_weak_ptr_factory_ must be deleted on UI thread.
933 ui_weak_ptr_factory_.reset(); 933 ui_weak_ptr_factory_.reset();
934 934
935 // We should wait if there is any pending tasks posted to the worker 935 {
936 // thread pool. on_io_completed_ won't be signaled iff |num_pending_tasks_| 936 // http://crbug.com/125220
937 // is greater that 0. 937 base::ThreadRestrictions::ScopedAllowWait allow_wait;
938 // We don't have to lock with |num_pending_tasks_lock_| here, since number of 938 // We should wait if there is any pending tasks posted to the worker
939 // pending tasks can only decrease at this point (Number of pending class can 939 // thread pool. on_io_completed_ won't be signaled iff |num_pending_tasks_|
940 // be increased only on UI and IO thread. We are on UI thread, and there will 940 // is greater that 0.
941 // be no more tasks run on IO thread. 941 // We don't have to lock with |num_pending_tasks_lock_| here, since number
942 on_io_completed_->Wait(); 942 // of pending tasks can only decrease at this point (Number of pending class
943 // can be increased only on UI and IO thread. We are on UI thread, and there
944 // will be no more tasks run on IO thread.
945 on_io_completed_->Wait();
946 }
943 947
944 // Now that we are sure that there are no more pending tasks bound to this on 948 // Now that we are sure that there are no more pending tasks bound to this on
945 // other threads, we are safe to destroy the data members. 949 // other threads, we are safe to destroy the data members.
946 950
947 // Cancel all the in-flight operations. 951 // Cancel all the in-flight operations.
948 // This asynchronously cancels the URL fetch operations. 952 // This asynchronously cancels the URL fetch operations.
949 documents_service_->CancelAll(); 953 documents_service_->CancelAll();
950 documents_service_.reset(); 954 documents_service_.reset();
951 955
952 // Lock to let root destroy cache map and resource map. 956 // Lock to let root destroy cache map and resource map.
(...skipping 3630 matching lines...) Expand 10 before | Expand all | Expand 10 after
4583 pref_registrar_->Init(profile_->GetPrefs()); 4587 pref_registrar_->Init(profile_->GetPrefs());
4584 pref_registrar_->Add(prefs::kDisableGDataHostedFiles, this); 4588 pref_registrar_->Add(prefs::kDisableGDataHostedFiles, this);
4585 } 4589 }
4586 4590
4587 void SetFreeDiskSpaceGetterForTesting(FreeDiskSpaceGetterInterface* getter) { 4591 void SetFreeDiskSpaceGetterForTesting(FreeDiskSpaceGetterInterface* getter) {
4588 delete global_free_disk_getter_for_testing; // Safe to delete NULL; 4592 delete global_free_disk_getter_for_testing; // Safe to delete NULL;
4589 global_free_disk_getter_for_testing = getter; 4593 global_free_disk_getter_for_testing = getter;
4590 } 4594 }
4591 4595
4592 } // namespace gdata 4596 } // namespace gdata
OLDNEW
« no previous file with comments | « base/threading/thread_restrictions.h ('k') | dbus/bus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698