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

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

Issue 9834091: gdata: Fix issue with copying hosted documents out from Docs folder. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 9 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
Index: chrome/browser/chromeos/gdata/gdata_file_system.h
===================================================================
--- chrome/browser/chromeos/gdata/gdata_file_system.h (revision 128786)
+++ chrome/browser/chromeos/gdata/gdata_file_system.h (working copy)
@@ -17,6 +17,7 @@
#include "base/memory/weak_ptr.h"
#include "base/message_loop.h"
#include "base/platform_file.h"
+#include "base/scoped_temp_dir.h"
#include "base/synchronization/lock.h"
#include "chrome/browser/chromeos/gdata/gdata_files.h"
#include "chrome/browser/chromeos/gdata/gdata_operation_registry.h"
@@ -349,6 +350,10 @@
// <user_profile_dir>/GCache/v1/pinned
virtual FilePath GetGDataCachePersistentDirectory() const = 0;
+ // Returns the directory for hosting temporary document JSON files, i.e.
+ // <system_temp_dir>/<unique_temp_dir>
+ virtual FilePath GetGDataTempDocumentDirectory() const = 0;
+
// Returns absolute path of the file if it were cached or to be cached.
virtual FilePath GetCacheFilePath(
const std::string& resource_id,
@@ -426,6 +431,7 @@
virtual FilePath GetGDataTempDownloadFolderPath() const OVERRIDE;
virtual FilePath GetGDataCachePinnedDirectory() const OVERRIDE;
virtual FilePath GetGDataCachePersistentDirectory() const OVERRIDE;
+ virtual FilePath GetGDataTempDocumentDirectory() const OVERRIDE;
virtual FilePath GetCacheFilePath(
const std::string& resource_id,
const std::string& md5,
@@ -585,10 +591,11 @@
base::PlatformFileError *error);
// Creates a temporary JSON file representing a document with |edit_url|
- // and |resource_id| on IO thread pool. Upon completion it will invoke
- // |callback| with the path of the created temporary file on thread
- // represented by |relay_proxy|.
+ // and |resource_id| under |document_dir| on IO thread pool. Upon completion
+ // it will invoke |callback| with the path of the created temporary file on
+ // thread represented by |relay_proxy|.
static void CreateDocumentJsonFileOnIOThreadPool(
+ const FilePath& document_dir,
const GURL& edit_url,
const std::string& resource_id,
const GetFileCallback& callback,
@@ -1155,6 +1162,9 @@
// GDataRootDirectory::CacheSubDirectoryType enum.
std::vector<FilePath> cache_paths_;
+ // Directory for hosting temporary document JSON files.
+ ScopedTempDir temp_document_dir_;
+
scoped_ptr<base::WaitableEvent> on_io_completed_;
// True if cache initialization has started, is in progress or has completed,

Powered by Google App Engine
This is Rietveld 408576698