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

Side by Side Diff: components/drive/directory_loader.cc

Issue 1815363002: Add RetainedRef uses where needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/drive/directory_loader.h" 5 #include "components/drive/directory_loader.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 } 134 }
135 135
136 DCHECK(file_list); 136 DCHECK(file_list);
137 scoped_ptr<ChangeList> change_list(new ChangeList(*file_list)); 137 scoped_ptr<ChangeList> change_list(new ChangeList(*file_list));
138 GURL next_url = file_list->next_link(); 138 GURL next_url = file_list->next_link();
139 139
140 ResourceEntryVector* entries = new ResourceEntryVector; 140 ResourceEntryVector* entries = new ResourceEntryVector;
141 loader_->loader_controller_->ScheduleRun(base::Bind( 141 loader_->loader_controller_->ScheduleRun(base::Bind(
142 base::IgnoreResult( 142 base::IgnoreResult(
143 &base::PostTaskAndReplyWithResult<FileError, FileError>), 143 &base::PostTaskAndReplyWithResult<FileError, FileError>),
144 loader_->blocking_task_runner_, 144 base::RetainedRef(loader_->blocking_task_runner_), FROM_HERE,
145 FROM_HERE,
146 base::Bind(&ChangeListProcessor::RefreshDirectory, 145 base::Bind(&ChangeListProcessor::RefreshDirectory,
147 loader_->resource_metadata_, 146 loader_->resource_metadata_, directory_fetch_info_,
148 directory_fetch_info_, 147 base::Passed(&change_list), entries),
149 base::Passed(&change_list),
150 entries),
151 base::Bind(&FeedFetcher::OnDirectoryRefreshed, 148 base::Bind(&FeedFetcher::OnDirectoryRefreshed,
152 weak_ptr_factory_.GetWeakPtr(), 149 weak_ptr_factory_.GetWeakPtr(), callback, next_url,
153 callback,
154 next_url,
155 base::Owned(entries)))); 150 base::Owned(entries))));
156 } 151 }
157 152
158 void OnDirectoryRefreshed( 153 void OnDirectoryRefreshed(
159 const FileOperationCallback& callback, 154 const FileOperationCallback& callback,
160 const GURL& next_url, 155 const GURL& next_url,
161 const std::vector<ResourceEntry>* refreshed_entries, 156 const std::vector<ResourceEntry>* refreshed_entries,
162 FileError error) { 157 FileError error) {
163 DCHECK(thread_checker_.CalledOnValidThread()); 158 DCHECK(thread_checker_.CalledOnValidThread());
164 DCHECK(!callback.is_null()); 159 DCHECK(!callback.is_null());
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 // Also notify the observers. 561 // Also notify the observers.
567 if (error == FILE_ERROR_OK && !directory_path->empty()) { 562 if (error == FILE_ERROR_OK && !directory_path->empty()) {
568 FOR_EACH_OBSERVER(ChangeListLoaderObserver, 563 FOR_EACH_OBSERVER(ChangeListLoaderObserver,
569 observers_, 564 observers_,
570 OnDirectoryReloaded(*directory_path)); 565 OnDirectoryReloaded(*directory_path));
571 } 566 }
572 } 567 }
573 568
574 } // namespace internal 569 } // namespace internal
575 } // namespace drive 570 } // namespace drive
OLDNEW
« no previous file with comments | « components/drive/change_list_loader.cc ('k') | components/drive/file_system/search_operation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698