gdata: Add GDataCache::OnCacheCommitted event.

The event will be used to upload dirty files.

BUG=127080
TEST=add expectations to gdata_file_system_unittest.cc

Review URL: https://chromiumcodereview.appspot.com/10556047

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142784 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/chromeos/gdata/gdata_cache.h b/chrome/browser/chromeos/gdata/gdata_cache.h
index 20328552..90d59cd2 100644
--- a/chrome/browser/chromeos/gdata/gdata_cache.h
+++ b/chrome/browser/chromeos/gdata/gdata_cache.h
@@ -103,6 +103,9 @@
     virtual void OnCacheUnpinned(const std::string& resource_id,
                                  const std::string& md5) {}
 
+    // Triggered when a dirty file has been committed (saved) successfully.
+    virtual void OnCacheCommitted(const std::string& resource_id) {}
+
    protected:
     virtual ~Observer() {}
   };
@@ -396,6 +399,12 @@
                   const std::string& md5,
                   const CacheOperationCallback& callback);
 
+  // Runs callback and notifies the observers when file is committed.
+  void OnCommitDirty(base::PlatformFileError* error,
+                     const std::string& resource_id,
+                     const std::string& md5,
+                     const CacheOperationCallback& callback);
+
   // The root directory of the cache (i.e. <user_profile_dir>/GCache/v1).
   const FilePath cache_root_path_;
   // Paths for all subdirectories of GCache, one for each