OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "android_webview/native/aw_contents.h" | 5 #include "android_webview/native/aw_contents.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "android_webview/browser/aw_browser_context.h" | 9 #include "android_webview/browser/aw_browser_context.h" |
10 #include "android_webview/browser/aw_browser_main_parts.h" | 10 #include "android_webview/browser/aw_browser_main_parts.h" |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 return reinterpret_cast<intptr_t>(web_contents_.get()); | 290 return reinterpret_cast<intptr_t>(web_contents_.get()); |
291 } | 291 } |
292 | 292 |
293 void AwContents::Destroy(JNIEnv* env, jobject obj) { | 293 void AwContents::Destroy(JNIEnv* env, jobject obj) { |
294 java_ref_.reset(); | 294 java_ref_.reset(); |
295 | 295 |
296 // We clear the contents_client_bridge_ here so that we break the link with | 296 // We clear the contents_client_bridge_ here so that we break the link with |
297 // the java peer. This is important for the popup window case, where we are | 297 // the java peer. This is important for the popup window case, where we are |
298 // swapping AwContents out that share the same java AwContentsClientBridge. | 298 // swapping AwContents out that share the same java AwContentsClientBridge. |
299 // See b/15074651. | 299 // See b/15074651. |
| 300 AwContentsClientBridgeBase::Disassociate(web_contents_.get()); |
300 contents_client_bridge_.reset(); | 301 contents_client_bridge_.reset(); |
301 | 302 |
302 // We do not delete AwContents immediately. Some applications try to delete | 303 // We do not delete AwContents immediately. Some applications try to delete |
303 // Webview in ShouldOverrideUrlLoading callback, which is a sync IPC from | 304 // Webview in ShouldOverrideUrlLoading callback, which is a sync IPC from |
304 // Webkit. | 305 // Webkit. |
305 BrowserThread::DeleteSoon(BrowserThread::UI, FROM_HERE, this); | 306 BrowserThread::DeleteSoon(BrowserThread::UI, FROM_HERE, this); |
306 } | 307 } |
307 | 308 |
308 static jlong Init(JNIEnv* env, jclass, jobject browser_context) { | 309 static jlong Init(JNIEnv* env, jclass, jobject browser_context) { |
309 // TODO(joth): Use |browser_context| to get the native BrowserContext, rather | 310 // TODO(joth): Use |browser_context| to get the native BrowserContext, rather |
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1164 } | 1165 } |
1165 | 1166 |
1166 browser_view_renderer_.TrimMemory(level, visible); | 1167 browser_view_renderer_.TrimMemory(level, visible); |
1167 } | 1168 } |
1168 | 1169 |
1169 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { | 1170 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { |
1170 g_should_download_favicons = true; | 1171 g_should_download_favicons = true; |
1171 } | 1172 } |
1172 | 1173 |
1173 } // namespace android_webview | 1174 } // namespace android_webview |
OLD | NEW |