| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_ANDROID_ANDROID_STREAM_READER_URL_REQUEST_JOB_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_ANDROID_STREAM_READER_URL_REQUEST_JOB_H_ |
| 6 #define CHROME_BROWSER_ANDROID_ANDROID_STREAM_READER_URL_REQUEST_JOB_H_ | 6 #define CHROME_BROWSER_ANDROID_ANDROID_STREAM_READER_URL_REQUEST_JOB_H_ |
| 7 | 7 |
| 8 #include "base/android/scoped_java_ref.h" | 8 #include "base/android/scoped_java_ref.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/threading/non_thread_safe.h" | 10 #include "base/threading/non_thread_safe.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 virtual bool GetCharset( | 37 virtual bool GetCharset( |
| 38 JNIEnv* env, | 38 JNIEnv* env, |
| 39 net::URLRequest* request, | 39 net::URLRequest* request, |
| 40 jobject stream, | 40 jobject stream, |
| 41 std::string* charset) = 0; | 41 std::string* charset) = 0; |
| 42 | 42 |
| 43 virtual ~Delegate() {} | 43 virtual ~Delegate() {} |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 explicit AndroidStreamReaderURLRequestJob(net::URLRequest* request, | 46 explicit AndroidStreamReaderURLRequestJob( |
| 47 scoped_ptr<Delegate> delegate); | 47 net::URLRequest* request, |
| 48 net::NetworkDelegate* network_delegate, |
| 49 scoped_ptr<Delegate> delegate); |
| 48 | 50 |
| 49 // Register JNI methods. | 51 // Register JNI methods. |
| 50 static bool InitJNIBindings(JNIEnv* env); | 52 static bool InitJNIBindings(JNIEnv* env); |
| 51 | 53 |
| 52 // URLRequestJob: | 54 // URLRequestJob: |
| 53 virtual void Start() OVERRIDE; | 55 virtual void Start() OVERRIDE; |
| 54 virtual bool ReadRawData(net::IOBuffer* buf, | 56 virtual bool ReadRawData(net::IOBuffer* buf, |
| 55 int buf_size, | 57 int buf_size, |
| 56 int* bytes_read) OVERRIDE; | 58 int* bytes_read) OVERRIDE; |
| 57 virtual void SetExtraRequestHeaders( | 59 virtual void SetExtraRequestHeaders( |
| (...skipping 13 matching lines...) Expand all Loading... |
| 71 | 73 |
| 72 net::HttpByteRange byte_range_; | 74 net::HttpByteRange byte_range_; |
| 73 scoped_ptr<Delegate> delegate_; | 75 scoped_ptr<Delegate> delegate_; |
| 74 base::android::ScopedJavaGlobalRef<jobject> stream_; | 76 base::android::ScopedJavaGlobalRef<jobject> stream_; |
| 75 base::android::ScopedJavaGlobalRef<jbyteArray> buffer_; | 77 base::android::ScopedJavaGlobalRef<jbyteArray> buffer_; |
| 76 | 78 |
| 77 DISALLOW_COPY_AND_ASSIGN(AndroidStreamReaderURLRequestJob); | 79 DISALLOW_COPY_AND_ASSIGN(AndroidStreamReaderURLRequestJob); |
| 78 }; | 80 }; |
| 79 | 81 |
| 80 #endif // CHROME_BROWSER_ANDROID_ANDROID_STREAM_READER_URL_REQUEST_JOB_H_ | 82 #endif // CHROME_BROWSER_ANDROID_ANDROID_STREAM_READER_URL_REQUEST_JOB_H_ |
| OLD | NEW |