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 #include "android_webview/native/aw_contents_client_bridge.h" | 5 #include "android_webview/native/aw_contents_client_bridge.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "android_webview/common/devtools_instrumentation.h" | 10 #include "android_webview/common/devtools_instrumentation.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 AwContentsClientBridge::~AwContentsClientBridge() { | 66 AwContentsClientBridge::~AwContentsClientBridge() { |
67 JNIEnv* env = AttachCurrentThread(); | 67 JNIEnv* env = AttachCurrentThread(); |
68 | 68 |
69 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 69 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
70 if (!obj.is_null()) { | 70 if (!obj.is_null()) { |
71 // Clear the weak reference from the java peer to the native object since | 71 // Clear the weak reference from the java peer to the native object since |
72 // it is possible that java object lifetime can exceed the AwContens. | 72 // it is possible that java object lifetime can exceed the AwContens. |
73 Java_AwContentsClientBridge_setNativeContentsClientBridge(env, obj, 0); | 73 Java_AwContentsClientBridge_setNativeContentsClientBridge(env, obj, 0); |
74 } | 74 } |
75 | 75 |
76 for (IDMap<content::ClientCertificateDelegate>::iterator iter( | 76 for (IDMap<content::ClientCertificateDelegate*>::iterator iter( |
77 &pending_client_cert_request_delegates_); | 77 &pending_client_cert_request_delegates_); |
78 !iter.IsAtEnd(); iter.Advance()) { | 78 !iter.IsAtEnd(); iter.Advance()) { |
79 delete iter.GetCurrentValue(); | 79 delete iter.GetCurrentValue(); |
80 } | 80 } |
81 } | 81 } |
82 | 82 |
83 void AwContentsClientBridge::AllowCertificateError( | 83 void AwContentsClientBridge::AllowCertificateError( |
84 int cert_error, | 84 int cert_error, |
85 net::X509Certificate* cert, | 85 net::X509Certificate* cert, |
86 const GURL& request_url, | 86 const GURL& request_url, |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 pending_client_cert_request_delegates_.Remove(request_id); | 452 pending_client_cert_request_delegates_.Remove(request_id); |
453 | 453 |
454 delete delegate; | 454 delete delegate; |
455 } | 455 } |
456 | 456 |
457 bool RegisterAwContentsClientBridge(JNIEnv* env) { | 457 bool RegisterAwContentsClientBridge(JNIEnv* env) { |
458 return RegisterNativesImpl(env); | 458 return RegisterNativesImpl(env); |
459 } | 459 } |
460 | 460 |
461 } // namespace android_webview | 461 } // namespace android_webview |
OLD | NEW |