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

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

Issue 257153003: We have a problem in the process on destroying WebContentsImpl because (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Rebased onto origin/master again, resolved conflicts Created 6 years, 7 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
« no previous file with comments | « android_webview/native/aw_settings.h ('k') | chrome/browser/android/shortcut_helper.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_settings.h" 5 #include "android_webview/native/aw_settings.h"
6 6
7 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h" 7 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h"
8 #include "android_webview/common/aw_content_client.h" 8 #include "android_webview/common/aw_content_client.h"
9 #include "android_webview/native/aw_contents.h" 9 #include "android_webview/native/aw_contents.h"
10 #include "base/android/jni_android.h" 10 #include "base/android/jni_android.h"
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 // settings via RVHExt only ever updates the 'current' RVH. 260 // settings via RVHExt only ever updates the 'current' RVH.
261 // In android_webview we don't swap out the RVH on cross-site navigations, so 261 // In android_webview we don't swap out the RVH on cross-site navigations, so
262 // we shouldn't have to deal with the multiple RVH per WebContents case. That 262 // we shouldn't have to deal with the multiple RVH per WebContents case. That
263 // in turn means that the newly created RVH is always the 'current' RVH 263 // in turn means that the newly created RVH is always the 'current' RVH
264 // (since we only ever go from 0 to 1 RVH instances) and hence the DCHECK. 264 // (since we only ever go from 0 to 1 RVH instances) and hence the DCHECK.
265 DCHECK(web_contents()->GetRenderViewHost() == render_view_host); 265 DCHECK(web_contents()->GetRenderViewHost() == render_view_host);
266 266
267 UpdateEverything(); 267 UpdateEverything();
268 } 268 }
269 269
270 void AwSettings::WebContentsDestroyed(content::WebContents* web_contents) { 270 void AwSettings::WebContentsDestroyed() {
271 delete this; 271 delete this;
272 } 272 }
273 273
274 void AwSettings::PopulateWebPreferences(WebPreferences* web_prefs) { 274 void AwSettings::PopulateWebPreferences(WebPreferences* web_prefs) {
275 JNIEnv* env = base::android::AttachCurrentThread(); 275 JNIEnv* env = base::android::AttachCurrentThread();
276 CHECK(env); 276 CHECK(env);
277 ScopedJavaLocalRef<jobject> scoped_obj = aw_settings_.get(env); 277 ScopedJavaLocalRef<jobject> scoped_obj = aw_settings_.get(env);
278 jobject obj = scoped_obj.obj(); 278 jobject obj = scoped_obj.obj();
279 if (!obj) return; 279 if (!obj) return;
280 // Grab the lock and call PopulateWebPreferencesLocked. 280 // Grab the lock and call PopulateWebPreferencesLocked.
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 439
440 static jstring GetDefaultUserAgent(JNIEnv* env, jclass clazz) { 440 static jstring GetDefaultUserAgent(JNIEnv* env, jclass clazz) {
441 return base::android::ConvertUTF8ToJavaString(env, GetUserAgent()).Release(); 441 return base::android::ConvertUTF8ToJavaString(env, GetUserAgent()).Release();
442 } 442 }
443 443
444 bool RegisterAwSettings(JNIEnv* env) { 444 bool RegisterAwSettings(JNIEnv* env) {
445 return RegisterNativesImpl(env); 445 return RegisterNativesImpl(env);
446 } 446 }
447 447
448 } // namespace android_webview 448 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/native/aw_settings.h ('k') | chrome/browser/android/shortcut_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698