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 XWALK_RUNTIME_BROWSER_ANDROID_INTERCEPTED_REQUEST_DATA_IMPL_H_
6 #define XWALK_RUNTIME_BROWSER_ANDROID_INTERCEPTED_REQUEST_DATA_IMPL_H_
8 #include "xwalk/runtime/browser/android/intercepted_request_data.h"
12 #include "base/android/scoped_java_ref.h"
13 #include "base/compiler_specific.h"
14 #include "base/memory/scoped_ptr.h"
20 class InterceptedRequestDataImpl : public InterceptedRequestData {
22 explicit InterceptedRequestDataImpl(
23 const base::android::JavaRef<jobject>& obj);
24 virtual ~InterceptedRequestDataImpl();
26 virtual scoped_ptr<InputStream> GetInputStream(JNIEnv* env) const;
27 virtual bool GetMimeType(JNIEnv* env, std::string* mime_type) const;
28 virtual bool GetCharset(JNIEnv* env, std::string* charset) const;
29 virtual bool GetPackageName(JNIEnv* env, std::string* name) const;
31 net::URLRequestJob* CreateJobFor(
32 net::URLRequest* request,
33 net::NetworkDelegate* network_delegate) const override;
36 base::android::ScopedJavaGlobalRef<jobject> java_object_;
38 DISALLOW_COPY_AND_ASSIGN(InterceptedRequestDataImpl);
41 bool RegisterInterceptedRequestData(JNIEnv* env);
45 #endif // XWALK_RUNTIME_BROWSER_ANDROID_INTERCEPTED_REQUEST_DATA_IMPL_H_