Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(418)

Side by Side Diff: android_webview/native/aw_contents.cc

Issue 545963002: Android WebView: clean up the AwContentsClientBridge webcontents userdata. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add another missing callback run Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « android_webview/browser/aw_javascript_dialog_manager.cc ('k') | android_webview/native/aw_contents_client_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698