| OLD | NEW | 
|---|
| 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 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_RESOURCE_METADATA_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_RESOURCE_METADATA_H_ | 
| 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_RESOURCE_METADATA_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_RESOURCE_METADATA_H_ | 
| 7 | 7 | 
| 8 #include <map> | 8 #include <map> | 
| 9 #include <set> | 9 #include <set> | 
| 10 #include <string> | 10 #include <string> | 
| 11 #include <vector> | 11 #include <vector> | 
| 12 | 12 | 
| 13 #include "base/callback_forward.h" | 13 #include "base/callback_forward.h" | 
| 14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" | 
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" | 
| 16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" | 
| 17 #include "base/time.h" | 17 #include "base/time.h" | 
| 18 #include "chrome/browser/chromeos/drive/file_errors.h" | 18 #include "chrome/browser/chromeos/drive/file_errors.h" | 
| 19 #include "chrome/browser/chromeos/drive/resource_metadata_storage.h" |  | 
| 20 | 19 | 
| 21 namespace base { | 20 namespace base { | 
| 22 class SequencedTaskRunner; | 21 class SequencedTaskRunner; | 
| 23 } | 22 } | 
| 24 | 23 | 
| 25 namespace drive { | 24 namespace drive { | 
| 26 | 25 | 
| 27 class ResourceEntry; | 26 class ResourceEntry; | 
| 28 class ResourceMetadataStorage; | 27 class ResourceMetadataStorage; | 
| 29 | 28 | 
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 110   ~EntryInfoPairResult(); | 109   ~EntryInfoPairResult(); | 
| 111 | 110 | 
| 112   EntryInfoResult first; | 111   EntryInfoResult first; | 
| 113   EntryInfoResult second;  // Only filled if the first entry is found. | 112   EntryInfoResult second;  // Only filled if the first entry is found. | 
| 114 }; | 113 }; | 
| 115 | 114 | 
| 116 // Used to receive the result from GetEntryInfoPairCallback(). | 115 // Used to receive the result from GetEntryInfoPairCallback(). | 
| 117 typedef base::Callback<void(scoped_ptr<EntryInfoPairResult> pair_result)> | 116 typedef base::Callback<void(scoped_ptr<EntryInfoPairResult> pair_result)> | 
| 118     GetEntryInfoPairCallback; | 117     GetEntryInfoPairCallback; | 
| 119 | 118 | 
|  | 119 typedef base::Callback<void(const ResourceEntry& entry)> IterateCallback; | 
|  | 120 | 
| 120 namespace internal { | 121 namespace internal { | 
| 121 | 122 | 
| 122 // Storage for Drive Metadata. | 123 // Storage for Drive Metadata. | 
| 123 // All methods must be run with |blocking_task_runner| unless otherwise noted. | 124 // All methods must be run with |blocking_task_runner| unless otherwise noted. | 
| 124 class ResourceMetadata { | 125 class ResourceMetadata { | 
| 125  public: | 126  public: | 
| 126   // |root_resource_id| is the resource id for the root directory. | 127   // |root_resource_id| is the resource id for the root directory. | 
| 127   // Must be called on the UI thread. | 128   // Must be called on the UI thread. | 
| 128   ResourceMetadata( | 129   ResourceMetadata( | 
| 129       const base::FilePath& data_directory_path, | 130       const base::FilePath& data_directory_path, | 
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 370   // invalidate its weak pointers before other members are destroyed. | 371   // invalidate its weak pointers before other members are destroyed. | 
| 371   base::WeakPtrFactory<ResourceMetadata> weak_ptr_factory_; | 372   base::WeakPtrFactory<ResourceMetadata> weak_ptr_factory_; | 
| 372 | 373 | 
| 373   DISALLOW_COPY_AND_ASSIGN(ResourceMetadata); | 374   DISALLOW_COPY_AND_ASSIGN(ResourceMetadata); | 
| 374 }; | 375 }; | 
| 375 | 376 | 
| 376 }  // namespace internal | 377 }  // namespace internal | 
| 377 }  // namespace drive | 378 }  // namespace drive | 
| 378 | 379 | 
| 379 #endif  // CHROME_BROWSER_CHROMEOS_DRIVE_RESOURCE_METADATA_H_ | 380 #endif  // CHROME_BROWSER_CHROMEOS_DRIVE_RESOURCE_METADATA_H_ | 
| OLD | NEW | 
|---|