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

Unified Diff: trunk/src/net/base/file_stream_context.cc

Issue 65043023: Revert 235752 "Fix chrome upload with content uri" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 1 month 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: trunk/src/net/base/file_stream_context.cc
===================================================================
--- trunk/src/net/base/file_stream_context.cc (revision 235758)
+++ trunk/src/net/base/file_stream_context.cc (working copy)
@@ -11,10 +11,6 @@
#include "net/base/file_stream_net_log_parameters.h"
#include "net/base/net_errors.h"
-#if defined(OS_ANDROID)
-#include "base/android/content_uri_utils.h"
-#endif
-
namespace {
void CallInt64ToInt(const net::CompletionCallback& callback, int64 result) {
@@ -197,24 +193,13 @@
FileStream::Context::OpenResult FileStream::Context::OpenFileImpl(
const base::FilePath& path, int open_flags) {
- base::PlatformFile file;
-#if defined(OS_ANDROID)
- if (path.IsContentUri()) {
- // Check that only Read flags are set.
- DCHECK_EQ(open_flags & ~base::PLATFORM_FILE_ASYNC,
- base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ);
- file = base::OpenContentUriForRead(path);
- } else {
-#endif // defined(OS_ANDROID)
- // FileStream::Context actually closes the file asynchronously,
- // independently from FileStream's destructor. It can cause problems for
- // users wanting to delete the file right after FileStream deletion. Thus
- // we are always adding SHARE_DELETE flag to accommodate such use case.
- open_flags |= base::PLATFORM_FILE_SHARE_DELETE;
- file = base::CreatePlatformFile(path, open_flags, NULL, NULL);
-#if defined(OS_ANDROID)
- }
-#endif // defined(OS_ANDROID)
+ // FileStream::Context actually closes the file asynchronously, independently
+ // from FileStream's destructor. It can cause problems for users wanting to
+ // delete the file right after FileStream deletion. Thus we are always
+ // adding SHARE_DELETE flag to accommodate such use case.
+ open_flags |= base::PLATFORM_FILE_SHARE_DELETE;
+ base::PlatformFile file =
+ base::CreatePlatformFile(path, open_flags, NULL, NULL);
if (file == base::kInvalidPlatformFileValue)
return OpenResult(file, IOResult::FromOSError(GetLastErrno()));
« no previous file with comments | « trunk/src/content/browser/child_process_security_policy_impl.cc ('k') | trunk/src/net/base/file_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698