| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_CLIENT_BRIDGE_H_ | 5 #ifndef ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_CLIENT_BRIDGE_H_ |
| 6 #define ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_CLIENT_BRIDGE_H_ | 6 #define ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_CLIENT_BRIDGE_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include "android_webview/browser/aw_contents_client_bridge_base.h" | 10 #include "android_webview/browser/aw_contents_client_bridge_base.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 // A class that handles the Java<->Native communication for the | 23 // A class that handles the Java<->Native communication for the |
| 24 // AwContentsClient. AwContentsClientBridge is created and owned by | 24 // AwContentsClient. AwContentsClientBridge is created and owned by |
| 25 // native AwContents class and it only has a weak reference to the | 25 // native AwContents class and it only has a weak reference to the |
| 26 // its Java peer. Since the Java AwContentsClientBridge can have | 26 // its Java peer. Since the Java AwContentsClientBridge can have |
| 27 // indirect refs from the Application (via callbacks) and so can outlive | 27 // indirect refs from the Application (via callbacks) and so can outlive |
| 28 // webview, this class notifies it before being destroyed and to nullify | 28 // webview, this class notifies it before being destroyed and to nullify |
| 29 // any references. | 29 // any references. |
| 30 class AwContentsClientBridge : public AwContentsClientBridgeBase { | 30 class AwContentsClientBridge : public AwContentsClientBridgeBase { |
| 31 public: | 31 public: |
| 32 AwContentsClientBridge(JNIEnv* env, jobject obj); | 32 AwContentsClientBridge(JNIEnv* env, |
| 33 const base::android::JavaRef<jobject>& obj); |
| 33 ~AwContentsClientBridge() override; | 34 ~AwContentsClientBridge() override; |
| 34 | 35 |
| 35 // AwContentsClientBridgeBase implementation | 36 // AwContentsClientBridgeBase implementation |
| 36 void AllowCertificateError( | 37 void AllowCertificateError( |
| 37 int cert_error, | 38 int cert_error, |
| 38 net::X509Certificate* cert, | 39 net::X509Certificate* cert, |
| 39 const GURL& request_url, | 40 const GURL& request_url, |
| 40 const base::Callback<void(content::CertificateRequestResultType)>& | 41 const base::Callback<void(content::CertificateRequestResultType)>& |
| 41 callback, | 42 callback, |
| 42 bool* cancel_request) override; | 43 bool* cancel_request) override; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // doesn't provide Release, so ownership is managed manually. | 92 // doesn't provide Release, so ownership is managed manually. |
| 92 IDMap<content::ClientCertificateDelegate> | 93 IDMap<content::ClientCertificateDelegate> |
| 93 pending_client_cert_request_delegates_; | 94 pending_client_cert_request_delegates_; |
| 94 }; | 95 }; |
| 95 | 96 |
| 96 bool RegisterAwContentsClientBridge(JNIEnv* env); | 97 bool RegisterAwContentsClientBridge(JNIEnv* env); |
| 97 | 98 |
| 98 } // namespace android_webview | 99 } // namespace android_webview |
| 99 | 100 |
| 100 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_CLIENT_BRIDGE_H_ | 101 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_CLIENT_BRIDGE_H_ |
| OLD | NEW |