Save errno for logging before potentially overwriting it.
[chromium-blink-merge.git] / android_webview / native / intercepted_request_data_impl.h
blob457bda94b56d4c2c887a7c85eec020db4a10291e
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
3 // found in the LICENSE file.
5 #ifndef ANDROID_WEBVIEW_NATIVE_INTERCEPTED_REQUEST_DATA_IMPL_H_
6 #define ANDROID_WEBVIEW_NATIVE_INTERCEPTED_REQUEST_DATA_IMPL_H_
8 #include "android_webview/browser/intercepted_request_data.h"
9 #include "base/android/scoped_java_ref.h"
10 #include "base/compiler_specific.h"
11 #include "base/memory/scoped_ptr.h"
13 namespace android_webview {
15 class InputStream;
17 class InterceptedRequestDataImpl : public InterceptedRequestData {
18 public:
19 // It is expected that |obj| is an instance of the Java-side
20 // org.chromium.android_webview.InterceptedRequestData class.
21 InterceptedRequestDataImpl(const base::android::JavaRef<jobject>& obj);
22 virtual ~InterceptedRequestDataImpl();
24 virtual scoped_ptr<InputStream> GetInputStream(JNIEnv* env) const;
25 virtual bool GetMimeType(JNIEnv* env, std::string* mime_type) const;
26 virtual bool GetCharset(JNIEnv* env, std::string* charset) const;
28 virtual net::URLRequestJob* CreateJobFor(
29 net::URLRequest* request,
30 net::NetworkDelegate* network_delegate) const OVERRIDE;
32 private:
33 base::android::ScopedJavaGlobalRef<jobject> java_object_;
35 DISALLOW_COPY_AND_ASSIGN(InterceptedRequestDataImpl);
38 bool RegisterInterceptedRequestData(JNIEnv* env);
40 } // namespace android_webview
42 #endif // ANDROID_WEBVIEW_NATIVE_INTERCEPTED_REQUEST_DATA_IMPL_H_