| OLD | NEW |
| 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 "chrome/browser/chromeos/drive/directory_loader.h" | 5 #include "chrome/browser/chromeos/drive/directory_loader.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 return; | 345 return; |
| 346 } | 346 } |
| 347 | 347 |
| 348 DCHECK(about_resource); | 348 DCHECK(about_resource); |
| 349 | 349 |
| 350 // Check the current status of local metadata, and start loading if needed. | 350 // Check the current status of local metadata, and start loading if needed. |
| 351 google_apis::AboutResource* about_resource_ptr = about_resource.get(); | 351 google_apis::AboutResource* about_resource_ptr = about_resource.get(); |
| 352 ResourceEntry* entry = new ResourceEntry; | 352 ResourceEntry* entry = new ResourceEntry; |
| 353 int64* local_changestamp = new int64; | 353 int64* local_changestamp = new int64; |
| 354 base::PostTaskAndReplyWithResult( | 354 base::PostTaskAndReplyWithResult( |
| 355 blocking_task_runner_, | 355 blocking_task_runner_.get(), |
| 356 FROM_HERE, | 356 FROM_HERE, |
| 357 base::Bind(&CheckLocalState, | 357 base::Bind(&CheckLocalState, |
| 358 resource_metadata_, | 358 resource_metadata_, |
| 359 *about_resource_ptr, | 359 *about_resource_ptr, |
| 360 local_id, | 360 local_id, |
| 361 entry, | 361 entry, |
| 362 local_changestamp), | 362 local_changestamp), |
| 363 base::Bind(&DirectoryLoader::ReadDirectoryAfterCheckLocalState, | 363 base::Bind(&DirectoryLoader::ReadDirectoryAfterCheckLocalState, |
| 364 weak_ptr_factory_.GetWeakPtr(), | 364 weak_ptr_factory_.GetWeakPtr(), |
| 365 base::Passed(&about_resource), | 365 base::Passed(&about_resource), |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 // Also notify the observers. | 564 // Also notify the observers. |
| 565 if (error == FILE_ERROR_OK && !directory_path->empty()) { | 565 if (error == FILE_ERROR_OK && !directory_path->empty()) { |
| 566 FOR_EACH_OBSERVER(ChangeListLoaderObserver, | 566 FOR_EACH_OBSERVER(ChangeListLoaderObserver, |
| 567 observers_, | 567 observers_, |
| 568 OnDirectoryReloaded(*directory_path)); | 568 OnDirectoryReloaded(*directory_path)); |
| 569 } | 569 } |
| 570 } | 570 } |
| 571 | 571 |
| 572 } // namespace internal | 572 } // namespace internal |
| 573 } // namespace drive | 573 } // namespace drive |
| OLD | NEW |