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

Side by Side Diff: content/browser/android/content_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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "content/browser/android/content_settings.h" 5 #include "content/browser/android/content_settings.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "content/browser/android/content_view_core_impl.h" 8 #include "content/browser/android/content_view_core_impl.h"
9 #include "content/browser/renderer_host/render_view_host_delegate.h" 9 #include "content/browser/renderer_host/render_view_host_delegate.h"
10 #include "content/browser/renderer_host/render_view_host_impl.h" 10 #include "content/browser/renderer_host/render_view_host_impl.h"
(...skipping 24 matching lines...) Expand all
35 return RegisterNativesImpl(env); 35 return RegisterNativesImpl(env);
36 } 36 }
37 37
38 bool ContentSettings::GetJavaScriptEnabled(JNIEnv* env, jobject obj) { 38 bool ContentSettings::GetJavaScriptEnabled(JNIEnv* env, jobject obj) {
39 RenderViewHost* render_view_host = web_contents()->GetRenderViewHost(); 39 RenderViewHost* render_view_host = web_contents()->GetRenderViewHost();
40 if (!render_view_host) 40 if (!render_view_host)
41 return false; 41 return false;
42 return render_view_host->GetDelegate()->GetWebkitPrefs().javascript_enabled; 42 return render_view_host->GetDelegate()->GetWebkitPrefs().javascript_enabled;
43 } 43 }
44 44
45 void ContentSettings::WebContentsDestroyed(WebContents* web_contents) { 45 void ContentSettings::WebContentsDestroyed() {
46 delete this; 46 delete this;
47 } 47 }
48 48
49 static jlong Init(JNIEnv* env, jobject obj, jlong nativeContentViewCore) { 49 static jlong Init(JNIEnv* env, jobject obj, jlong nativeContentViewCore) {
50 WebContents* web_contents = 50 WebContents* web_contents =
51 reinterpret_cast<ContentViewCoreImpl*>(nativeContentViewCore) 51 reinterpret_cast<ContentViewCoreImpl*>(nativeContentViewCore)
52 ->GetWebContents(); 52 ->GetWebContents();
53 ContentSettings* content_settings = 53 ContentSettings* content_settings =
54 new ContentSettings(env, obj, web_contents); 54 new ContentSettings(env, obj, web_contents);
55 return reinterpret_cast<intptr_t>(content_settings); 55 return reinterpret_cast<intptr_t>(content_settings);
56 } 56 }
57 57
58 } // namespace content 58 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/android/content_settings.h ('k') | content/browser/android/content_view_core_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698