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

Unified Diff: android_webview/native/android_stream_reader_url_request_job.h

Issue 11147021: [Android] Make AndroidStreamReaderURLRequestJob to start loading asynchronously. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
« no previous file with comments | « no previous file | android_webview/native/android_stream_reader_url_request_job.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/native/android_stream_reader_url_request_job.h
diff --git a/android_webview/native/android_stream_reader_url_request_job.h b/android_webview/native/android_stream_reader_url_request_job.h
index 2e465725b55a4f1db6d3706a9dc395cc1a150838..e29acd86e90045dfcb2265d78d2d80fc217e9c53 100644
--- a/android_webview/native/android_stream_reader_url_request_job.h
+++ b/android_webview/native/android_stream_reader_url_request_job.h
@@ -7,6 +7,7 @@
#include "base/android/scoped_java_ref.h"
#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
#include "base/threading/non_thread_safe.h"
#include "net/http/http_byte_range.h"
#include "net/url_request/url_request_job.h"
@@ -43,7 +44,7 @@ class AndroidStreamReaderURLRequestJob : public net::URLRequestJob {
virtual ~Delegate() {}
};
- explicit AndroidStreamReaderURLRequestJob(
+ AndroidStreamReaderURLRequestJob(
net::URLRequest* request,
net::NetworkDelegate* network_delegate,
scoped_ptr<Delegate> delegate);
@@ -68,10 +69,13 @@ class AndroidStreamReaderURLRequestJob : public net::URLRequestJob {
// Skip to the first byte of the requested read range.
bool SkipToRequestedRange(JNIEnv* env);
+ void StartAsync();
+
net::HttpByteRange byte_range_;
scoped_ptr<Delegate> delegate_;
base::android::ScopedJavaGlobalRef<jobject> stream_;
base::android::ScopedJavaGlobalRef<jbyteArray> buffer_;
+ base::WeakPtrFactory<AndroidStreamReaderURLRequestJob> weak_factory_;
joth 2012/10/15 17:01:46 net::URLRequestJob is refcounted, so it feels like
mnaganov (inactive) 2012/10/15 17:18:25 I was following the practice that the majority of
mkosiba (inactive) 2012/10/15 17:24:03 hmm.. all of the other URLRequestJob impls use a w
DISALLOW_COPY_AND_ASSIGN(AndroidStreamReaderURLRequestJob);
};
« no previous file with comments | « no previous file | android_webview/native/android_stream_reader_url_request_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698