Chromium Code Reviews| 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 ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_IO_THREAD_CLIENT_IMPL_H_ | 5 #ifndef ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_IO_THREAD_CLIENT_IMPL_H_ |
| 6 #define ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_IO_THREAD_CLIENT_IMPL_H_ | 6 #define ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_IO_THREAD_CLIENT_IMPL_H_ |
| 7 | 7 |
| 8 #include "android_webview/browser/aw_contents_io_thread_client.h" | 8 #include "android_webview/browser/aw_contents_io_thread_client.h" |
| 9 | 9 |
| 10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 40 | 40 |
| 41 // Either |pending_associate| is true or |jclient| holds a non-null | 41 // Either |pending_associate| is true or |jclient| holds a non-null |
| 42 // Java object. | 42 // Java object. |
| 43 AwContentsIoThreadClientImpl(bool pending_associate, | 43 AwContentsIoThreadClientImpl(bool pending_associate, |
| 44 const base::android::JavaRef<jobject>& jclient); | 44 const base::android::JavaRef<jobject>& jclient); |
| 45 ~AwContentsIoThreadClientImpl() override; | 45 ~AwContentsIoThreadClientImpl() override; |
| 46 | 46 |
| 47 // Implementation of AwContentsIoThreadClient. | 47 // Implementation of AwContentsIoThreadClient. |
| 48 bool PendingAssociation() const override; | 48 bool PendingAssociation() const override; |
| 49 CacheMode GetCacheMode() const override; | 49 CacheMode GetCacheMode() const override; |
| 50 scoped_ptr<AwWebResourceResponse> ShouldInterceptRequest( | 50 void ShouldInterceptRequestAsync( |
| 51 const net::URLRequest* request) override; | 51 const net::URLRequest* request, |
| 52 const ShouldInterceptRequestResultCallback callback) override; | |
| 52 bool ShouldBlockContentUrls() const override; | 53 bool ShouldBlockContentUrls() const override; |
| 53 bool ShouldBlockFileUrls() const override; | 54 bool ShouldBlockFileUrls() const override; |
| 54 bool ShouldAcceptThirdPartyCookies() const override; | 55 bool ShouldAcceptThirdPartyCookies() const override; |
| 55 bool ShouldBlockNetworkLoads() const override; | 56 bool ShouldBlockNetworkLoads() const override; |
| 56 void NewDownload(const GURL& url, | 57 void NewDownload(const GURL& url, |
| 57 const std::string& user_agent, | 58 const std::string& user_agent, |
| 58 const std::string& content_disposition, | 59 const std::string& content_disposition, |
| 59 const std::string& mime_type, | 60 const std::string& mime_type, |
| 60 int64 content_length) override; | 61 int64 content_length) override; |
| 61 void NewLoginRequest(const std::string& realm, | 62 void NewLoginRequest(const std::string& realm, |
| 62 const std::string& account, | 63 const std::string& account, |
| 63 const std::string& args) override; | 64 const std::string& args) override; |
| 64 void OnReceivedError(const net::URLRequest* request) override; | 65 void OnReceivedError(const net::URLRequest* request) override; |
| 65 void OnReceivedHttpError( | 66 void OnReceivedHttpError( |
| 66 const net::URLRequest* request, | 67 const net::URLRequest* request, |
| 67 const net::HttpResponseHeaders* response_headers) override; | 68 const net::HttpResponseHeaders* response_headers) override; |
| 68 | 69 |
| 69 private: | 70 private: |
| 70 bool pending_association_; | 71 bool pending_association_; |
| 71 base::android::ScopedJavaGlobalRef<jobject> java_object_; | 72 base::android::ScopedJavaGlobalRef<jobject> java_object_; |
| 73 base::android::ScopedJavaGlobalRef<jobject> bg_thread_client_object_; | |
|
boliu
2015/10/01 19:13:56
Sorry.. just noticed this will prevent AwContents
mnaganov (inactive)
2015/10/01 19:51:04
The lifetime and properties of BackgroundThreadCli
| |
| 72 | 74 |
| 73 DISALLOW_COPY_AND_ASSIGN(AwContentsIoThreadClientImpl); | 75 DISALLOW_COPY_AND_ASSIGN(AwContentsIoThreadClientImpl); |
| 74 }; | 76 }; |
| 75 | 77 |
| 76 // JNI registration method. | 78 // JNI registration method. |
| 77 bool RegisterAwContentsIoThreadClientImpl(JNIEnv* env); | 79 bool RegisterAwContentsIoThreadClientImpl(JNIEnv* env); |
| 78 | 80 |
| 79 } // namespace android_webview | 81 } // namespace android_webview |
| 80 | 82 |
| 81 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_IO_THREAD_CLIENT_IMPL_H_ | 83 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_IO_THREAD_CLIENT_IMPL_H_ |
| OLD | NEW |