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

Unified Diff: chrome/browser/chromeos/gdata/gdata_files.h

Issue 10831212: gdata: Add GDataDirectoryService::GetEntryInfoPairByPaths() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/gdata/gdata_files.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/gdata/gdata_files.h
diff --git a/chrome/browser/chromeos/gdata/gdata_files.h b/chrome/browser/chromeos/gdata/gdata_files.h
index 4a5196dbf47e590f360028598340b30678859b43..a2dd72900919b0ee2de62761e4c243546a1d491a 100644
--- a/chrome/browser/chromeos/gdata/gdata_files.h
+++ b/chrome/browser/chromeos/gdata/gdata_files.h
@@ -88,6 +88,30 @@ typedef base::Callback<void(GDataFileError error,
scoped_ptr<GDataEntryProtoVector> entries)>
ReadDirectoryCallback;
+// This is a part of EntryInfoPairResult.
+struct EntryInfoResult {
+ EntryInfoResult();
+ ~EntryInfoResult();
+
+ FilePath path;
+ GDataFileError error;
+ scoped_ptr<GDataEntryProto> proto;
+};
+
+// The result of GetEntryInfoPairCallback(). Used to get a pair of entries
+// in one function call.
+struct EntryInfoPairResult {
+ EntryInfoPairResult();
+ ~EntryInfoPairResult();
+
+ EntryInfoResult first;
+ EntryInfoResult second; // Only filled if the first entry is found.
+};
+
+// Used to receive the result from GetEntryInfoPairCallback().
+typedef base::Callback<void(scoped_ptr<EntryInfoPairResult> pair_result)>
+ GetEntryInfoPairCallback;
+
// Base class for representing files and directories in gdata virtual file
// system.
class GDataEntry {
@@ -429,6 +453,17 @@ class GDataDirectoryService {
void ReadDirectoryByPath(const FilePath& file_path,
const ReadDirectoryCallback& callback);
+ // Similar to GetEntryInfoByPath() but this function finds a pair of
+ // entries by |first_path| and |second_path|. If the entry for
+ // |first_path| is not found, this function does not try to get the
+ // entry of |second_path|.
+ //
+ // Must be called from UI thread. |callback| is run on UI thread.
+ void GetEntryInfoPairByPaths(
+ const FilePath& first_path,
+ const FilePath& second_path,
+ const GetEntryInfoPairCallback& callback);
+
// Replaces file entry with the same resource id as |fresh_file| with its
// fresh value |fresh_file|.
void RefreshFile(scoped_ptr<GDataFile> fresh_file);
@@ -463,6 +498,22 @@ class GDataDirectoryService {
scoped_ptr<GDataEntry> FromProtoString(
const std::string& serialized_proto);
+ // ...
+ void GetEntryInfoPairByPathsAfterGetFirst(
+ const FilePath& first_path,
+ const FilePath& second_path,
+ const GetEntryInfoPairCallback& callback,
+ GDataFileError error,
+ scoped_ptr<GDataEntryProto> entry_proto);
+
+ // ...
+ void GetEntryInfoPairByPathsAfterGetSecond(
+ const FilePath& second_path,
+ const GetEntryInfoPairCallback& callback,
+ scoped_ptr<EntryInfoPairResult> result,
+ GDataFileError error,
+ scoped_ptr<GDataEntryProto> entry_proto);
+
// Private data members.
scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_;
scoped_ptr<ResourceMetadataDB> directory_service_db_;
« no previous file with comments | « no previous file | chrome/browser/chromeos/gdata/gdata_files.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698