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

Unified Diff: components/cronet/android/wrapped_channel_upload_element_reader.h

Issue 442803002: Remove explicit JNI references by adding UrlRequest.readFromUploadChannel callback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove spurious space. Created 6 years, 4 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: components/cronet/android/wrapped_channel_upload_element_reader.h
diff --git a/components/cronet/android/wrapped_channel_upload_element_reader.h b/components/cronet/android/wrapped_channel_upload_element_reader.h
index 27e7a03c81b8923f0129944d5bc39e34f29bd233..c438f6fb0912d47c92bf67789a38db04147b3414 100644
--- a/components/cronet/android/wrapped_channel_upload_element_reader.h
+++ b/components/cronet/android/wrapped_channel_upload_element_reader.h
@@ -5,10 +5,9 @@
#ifndef COMPONENTS_CRONET_ANDROID_WRAPPED_CHANNEL_UPLOAD_ELEMENT_READER_H_
#define COMPONENTS_CRONET_ANDROID_WRAPPED_CHANNEL_UPLOAD_ELEMENT_READER_H_
-#include <jni.h>
-
#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "components/cronet/android/url_request_peer.h"
#include "net/base/completion_callback.h"
#include "net/base/upload_element_reader.h"
@@ -18,15 +17,15 @@ class IOBuffer;
namespace cronet {
-bool WrappedChannelRegisterJni(JNIEnv* env);
-
// An UploadElementReader implementation for
// java.nio.channels.ReadableByteChannel.
// |channel_| should outlive this class because this class does not take the
// ownership of the data.
class WrappedChannelElementReader : public net::UploadElementReader {
public:
- WrappedChannelElementReader(JNIEnv* env, jobject channel, uint64 length);
+ WrappedChannelElementReader(
+ scoped_refptr<URLRequestPeer::URLRequestPeerDelegate> delegate,
+ uint64 length);
virtual ~WrappedChannelElementReader();
// UploadElementReader overrides:
@@ -41,7 +40,7 @@ class WrappedChannelElementReader : public net::UploadElementReader {
private:
const uint64 length_;
uint64 offset_;
- jobject channel_;
+ scoped_refptr<URLRequestPeer::URLRequestPeerDelegate> delegate_;
DISALLOW_COPY_AND_ASSIGN(WrappedChannelElementReader);
};
« no previous file with comments | « components/cronet/android/url_request_peer.cc ('k') | components/cronet/android/wrapped_channel_upload_element_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698