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

Side by Side Diff: net/android/content_uri_utils.h

Issue 46303005: Fix chrome upload with content uri (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef NET_ANDROID_CONTENT_URI_UTILS_H_
6 #define NET_ANDROID_CONTENT_URI_UTILS_H_
7
8 #include <jni.h>
9
10 #include "base/basictypes.h"
11 #include "net/base/completion_callback.h"
12 #include "net/base/net_export.h"
13 #include "url/gurl.h"
14
15 namespace base {
16 class TaskRunner;
17 }
18
19 // Utility functions to handle content url on android.
20 namespace net {
21
22 bool RegisterContentUriUtils(JNIEnv* env);
23
24 // Post a task on to the |task_runner| and retrieve the length of a content url
25 // file. When finished, |callback| will be executed.
26 // Returns net::ERR_IO_PENDING since the task runs asynchronously.
27 NET_EXPORT int64 GetContentUrlLength(
28 base::TaskRunner* task_runner,
29 const GURL& content_url,
30 const net::Int64CompletionCallback& callback);
31
32 // Get the length of a content url file synchronously. Returns -1 if the url
33 // is invalid, or the actual file length otherwise.
34 NET_EXPORT int64 GetContentUrlLengthSync(const GURL& content_url);
35
36 // Opens a content url for read and returns the file descriptor to the caller.
37 // Returns -1 if the url is invalid.
38 NET_EXPORT int OpenContentUrlForRead(const GURL& content_url);
39
40 } // namespace net
41
42 #endif // NET_ANDROID_CONTENT_URI_UTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698