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

Unified Diff: android_webview/native/aw_settings.cc

Issue 831523005: Remove most native WebContents references from Java (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Kept same error checking behavior for aw_contents.cc Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: android_webview/native/aw_settings.cc
diff --git a/android_webview/native/aw_settings.cc b/android_webview/native/aw_settings.cc
index 43ea4aebe86f7c1e29254c1ecf4d28dcecbec4ba..6589e960b3c245a7cc348270c0ca982d352ca1d4 100644
--- a/android_webview/native/aw_settings.cc
+++ b/android_webview/native/aw_settings.cc
@@ -70,13 +70,14 @@ class AwSettingsUserData : public base::SupportsUserData::Data {
AwSettings* settings_;
};
-AwSettings::AwSettings(JNIEnv* env, jobject obj, jlong web_contents)
- : WebContentsObserver(
- reinterpret_cast<content::WebContents*>(web_contents)),
+AwSettings::AwSettings(JNIEnv* env,
+ jobject obj,
+ content::WebContents* web_contents)
+ : WebContentsObserver(web_contents),
renderer_prefs_initialized_(false),
aw_settings_(env, obj) {
- reinterpret_cast<content::WebContents*>(web_contents)->
- SetUserData(kAwSettingsUserDataKey, new AwSettingsUserData(this));
+ web_contents->SetUserData(kAwSettingsUserDataKey,
+ new AwSettingsUserData(this));
}
AwSettings::~AwSettings() {
@@ -407,8 +408,10 @@ void AwSettings::PopulateWebPreferencesLocked(
static jlong Init(JNIEnv* env,
jobject obj,
- jlong web_contents) {
- AwSettings* settings = new AwSettings(env, obj, web_contents);
+ jobject web_contents) {
+ content::WebContents* contents = content::WebContents::FromJavaWebContents(
+ web_contents);
+ AwSettings* settings = new AwSettings(env, obj, contents);
return reinterpret_cast<intptr_t>(settings);
}

Powered by Google App Engine
This is Rietveld 408576698