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

Unified Diff: net/base/file_stream.cc

Issue 46303005: Fix chrome upload with content uri (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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: net/base/file_stream.cc
diff --git a/net/base/file_stream.cc b/net/base/file_stream.cc
index fd2eb4af3f93f1e227b820815283c4df326c0600..e69e08a8d2c2f0ea4e0d2439264cbdefaaeb3874 100644
--- a/net/base/file_stream.cc
+++ b/net/base/file_stream.cc
@@ -93,6 +93,34 @@ int FileStream::OpenSync(const base::FilePath& path, int open_flags) {
return context_->OpenSync(path, open_flags_);
}
+#if defined(OS_ANDROID)
+int FileStream::OpenContentUrl(const GURL& content_url, int open_flags,
+ const CompletionCallback& callback) {
+ DCHECK(content_url.SchemeIsContent());
+ if (IsOpen()) {
+ DLOG(FATAL) << "Content URL is already open!";
+ return ERR_UNEXPECTED;
+ }
+
+ open_flags_ = open_flags;
+ DCHECK(is_async());
+ context_->OpenContentUrlAsync(content_url, open_flags, callback);
+ return ERR_IO_PENDING;
+}
+
+int FileStream::OpenContentUrlSync(const GURL& content_url, int open_flags) {
+ DCHECK(content_url.SchemeIsContent());
+ if (IsOpen()) {
+ DLOG(FATAL) << "Content URL is already open!";
+ return ERR_UNEXPECTED;
+ }
+
+ open_flags_ = open_flags;
+ DCHECK(!is_async());
+ return context_->OpenContentUrlSync(content_url, open_flags_);
+}
+#endif
+
int FileStream::Close(const CompletionCallback& callback) {
DCHECK(is_async());
context_->CloseAsync(callback);

Powered by Google App Engine
This is Rietveld 408576698