| 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_GDATA_GDATA_FILES_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILES_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILES_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILES_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 // Removes the entry from resource map. | 372 // Removes the entry from resource map. |
| 373 void RemoveEntryFromResourceMap(GDataEntry* entry); | 373 void RemoveEntryFromResourceMap(GDataEntry* entry); |
| 374 | 374 |
| 375 // Searches for |file_path| triggering callback. | 375 // Searches for |file_path| triggering callback. |
| 376 void FindEntryByPath(const FilePath& file_path, | 376 void FindEntryByPath(const FilePath& file_path, |
| 377 const FindEntryCallback& callback); | 377 const FindEntryCallback& callback); |
| 378 | 378 |
| 379 // Returns the GDataEntry* with the corresponding |resource_id|. | 379 // Returns the GDataEntry* with the corresponding |resource_id|. |
| 380 GDataEntry* GetEntryByResourceId(const std::string& resource_id); | 380 GDataEntry* GetEntryByResourceId(const std::string& resource_id); |
| 381 | 381 |
| 382 // Replaces file entry with the same resource id as |fresh_file| with its |
| 383 // fresh value |fresh_file|. |
| 384 void RefreshFile(scoped_ptr<GDataFile> fresh_file); |
| 385 |
| 382 // Serializes/Parses to/from string via proto classes. | 386 // Serializes/Parses to/from string via proto classes. |
| 383 void SerializeToString(std::string* serialized_proto) const; | 387 void SerializeToString(std::string* serialized_proto) const; |
| 384 bool ParseFromString(const std::string& serialized_proto); | 388 bool ParseFromString(const std::string& serialized_proto); |
| 385 | 389 |
| 386 // Converts to/from proto. | 390 // Converts to/from proto. |
| 387 void FromProto(const GDataRootDirectoryProto& proto); | 391 void FromProto(const GDataRootDirectoryProto& proto); |
| 388 void ToProto(GDataRootDirectoryProto* proto) const; | 392 void ToProto(GDataRootDirectoryProto* proto) const; |
| 389 | 393 |
| 390 private: | 394 private: |
| 391 // Used in |FindEntryByPath| if the path that is being searched for is | 395 // Used in |FindEntryByPath| if the path that is being searched for is |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 base::Time last_serialized_; | 428 base::Time last_serialized_; |
| 425 int largest_changestamp_; | 429 int largest_changestamp_; |
| 426 size_t serialized_size_; | 430 size_t serialized_size_; |
| 427 | 431 |
| 428 DISALLOW_COPY_AND_ASSIGN(GDataRootDirectory); | 432 DISALLOW_COPY_AND_ASSIGN(GDataRootDirectory); |
| 429 }; | 433 }; |
| 430 | 434 |
| 431 } // namespace gdata | 435 } // namespace gdata |
| 432 | 436 |
| 433 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILES_H_ | 437 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILES_H_ |
| OLD | NEW |