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

Side by Side Diff: chrome/browser/chromeos/drive/change_list_loader.cc

Issue 14292002: drive: Minor cleanup around ChangeListLoader::LoadFromServerIfNeeded() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
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/drive/change_list_loader.h" 5 #include "chrome/browser/chromeos/drive/change_list_loader.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 639
640 // Sets the refreshing flag, so that the caller does not send refresh requests 640 // Sets the refreshing flag, so that the caller does not send refresh requests
641 // in parallel (see DriveFileSystem::LoadFeedIfNeeded). 641 // in parallel (see DriveFileSystem::LoadFeedIfNeeded).
642 // 642 //
643 // The flag will be unset when loading completes. 643 // The flag will be unset when loading completes.
644 refreshing_ = true; 644 refreshing_ = true;
645 645
646 resource_metadata_->GetLargestChangestamp(callback); 646 resource_metadata_->GetLargestChangestamp(callback);
647 } 647 }
648 648
649
650 void ChangeListLoader::CheckForUpdates(const FileOperationCallback& callback) {
651 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
652 DCHECK(!callback.is_null());
653
654 if (loaded() && !refreshing())
655 LoadFromServerIfNeeded(DirectoryFetchInfo(), callback);
656 }
657
649 void ChangeListLoader::UpdateFromFeed( 658 void ChangeListLoader::UpdateFromFeed(
650 scoped_ptr<google_apis::AboutResource> about_resource, 659 scoped_ptr<google_apis::AboutResource> about_resource,
651 ScopedVector<ChangeList> change_lists, 660 ScopedVector<ChangeList> change_lists,
652 bool is_delta_feed, 661 bool is_delta_feed,
653 const base::Closure& update_finished_callback) { 662 const base::Closure& update_finished_callback) {
654 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 663 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
655 DCHECK(!update_finished_callback.is_null()); 664 DCHECK(!update_finished_callback.is_null());
656 DVLOG(1) << "Updating directory with a feed"; 665 DVLOG(1) << "Updating directory with a feed";
657 666
658 change_list_processor_.reset(new ChangeListProcessor(resource_metadata_)); 667 change_list_processor_.reset(new ChangeListProcessor(resource_metadata_));
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 for (size_t i = 0; i < callbacks.size(); ++i) { 834 for (size_t i = 0; i < callbacks.size(); ++i) {
826 base::MessageLoopProxy::current()->PostTask( 835 base::MessageLoopProxy::current()->PostTask(
827 FROM_HERE, 836 FROM_HERE,
828 base::Bind(callbacks[i], error)); 837 base::Bind(callbacks[i], error));
829 } 838 }
830 pending_load_callback_.erase(it); 839 pending_load_callback_.erase(it);
831 } 840 }
832 } 841 }
833 842
834 } // namespace drive 843 } // namespace drive
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698