| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/file_system/search_operation.h" | 5 #include "chrome/browser/chromeos/drive/file_system/search_operation.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 new std::vector<SearchResultInfo>); | 130 new std::vector<SearchResultInfo>); |
| 131 if (resource_list->entries().empty()) { | 131 if (resource_list->entries().empty()) { |
| 132 // Short cut. If the resource entry is empty, we don't need to refresh | 132 // Short cut. If the resource entry is empty, we don't need to refresh |
| 133 // the resource metadata. | 133 // the resource metadata. |
| 134 callback.Run(FILE_ERROR_OK, next_url, result.Pass()); | 134 callback.Run(FILE_ERROR_OK, next_url, result.Pass()); |
| 135 return; | 135 return; |
| 136 } | 136 } |
| 137 | 137 |
| 138 std::vector<SearchResultInfo>* result_ptr = result.get(); | 138 std::vector<SearchResultInfo>* result_ptr = result.get(); |
| 139 base::PostTaskAndReplyWithResult( | 139 base::PostTaskAndReplyWithResult( |
| 140 blocking_task_runner_, | 140 blocking_task_runner_.get(), |
| 141 FROM_HERE, | 141 FROM_HERE, |
| 142 base::Bind(&RefreshEntriesOnBlockingPool, | 142 base::Bind(&RefreshEntriesOnBlockingPool, |
| 143 metadata_, | 143 metadata_, |
| 144 base::Passed(&resource_list), | 144 base::Passed(&resource_list), |
| 145 result_ptr), | 145 result_ptr), |
| 146 base::Bind(&SearchOperation::SearchAfterRefreshEntry, | 146 base::Bind(&SearchOperation::SearchAfterRefreshEntry, |
| 147 weak_ptr_factory_.GetWeakPtr(), | 147 weak_ptr_factory_.GetWeakPtr(), |
| 148 callback, | 148 callback, |
| 149 next_url, | 149 next_url, |
| 150 base::Passed(&result))); | 150 base::Passed(&result))); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 162 if (error != FILE_ERROR_OK) { | 162 if (error != FILE_ERROR_OK) { |
| 163 callback.Run(error, GURL(), scoped_ptr<std::vector<SearchResultInfo> >()); | 163 callback.Run(error, GURL(), scoped_ptr<std::vector<SearchResultInfo> >()); |
| 164 return; | 164 return; |
| 165 } | 165 } |
| 166 | 166 |
| 167 callback.Run(error, next_url, result.Pass()); | 167 callback.Run(error, next_url, result.Pass()); |
| 168 } | 168 } |
| 169 | 169 |
| 170 } // namespace file_system | 170 } // namespace file_system |
| 171 } // namespace drive | 171 } // namespace drive |
| OLD | NEW |