| 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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 void AwContents::SetAwAutofillClient(jobject client) { | 260 void AwContents::SetAwAutofillClient(jobject client) { |
| 261 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 261 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 262 JNIEnv* env = AttachCurrentThread(); | 262 JNIEnv* env = AttachCurrentThread(); |
| 263 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 263 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 264 if (obj.is_null()) | 264 if (obj.is_null()) |
| 265 return; | 265 return; |
| 266 Java_AwContents_setAwAutofillClient(env, obj.obj(), client); | 266 Java_AwContents_setAwAutofillClient(env, obj.obj(), client); |
| 267 } | 267 } |
| 268 | 268 |
| 269 AwContents::~AwContents() { | 269 AwContents::~AwContents() { |
| 270 DCHECK(AwContents::FromWebContents(web_contents_.get()) == this); | 270 DCHECK_EQ(this, AwContents::FromWebContents(web_contents_.get())); |
| 271 DCHECK(!hardware_renderer_.get()); | 271 DCHECK(!hardware_renderer_.get()); |
| 272 web_contents_->RemoveUserData(kAwContentsUserDataKey); | 272 web_contents_->RemoveUserData(kAwContentsUserDataKey); |
| 273 if (find_helper_.get()) | 273 if (find_helper_.get()) |
| 274 find_helper_->SetListener(NULL); | 274 find_helper_->SetListener(NULL); |
| 275 if (icon_helper_.get()) | 275 if (icon_helper_.get()) |
| 276 icon_helper_->SetListener(NULL); | 276 icon_helper_->SetListener(NULL); |
| 277 base::subtle::NoBarrier_AtomicIncrement(&g_instance_count, -1); | 277 base::subtle::NoBarrier_AtomicIncrement(&g_instance_count, -1); |
| 278 // When the last WebView is destroyed free all discardable memory allocated by | 278 // When the last WebView is destroyed free all discardable memory allocated by |
| 279 // Chromium, because the app process may continue to run for a long time | 279 // Chromium, because the app process may continue to run for a long time |
| 280 // without ever using another WebView. | 280 // without ever using another WebView. |
| (...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1136 jboolean visible) { | 1136 jboolean visible) { |
| 1137 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1137 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 1138 browser_view_renderer_.TrimMemory(level, visible); | 1138 browser_view_renderer_.TrimMemory(level, visible); |
| 1139 } | 1139 } |
| 1140 | 1140 |
| 1141 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { | 1141 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { |
| 1142 g_should_download_favicons = true; | 1142 g_should_download_favicons = true; |
| 1143 } | 1143 } |
| 1144 | 1144 |
| 1145 } // namespace android_webview | 1145 } // namespace android_webview |
| OLD | NEW |