| 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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 if (find_helper_.get()) | 272 if (find_helper_.get()) |
| 273 find_helper_->SetListener(NULL); | 273 find_helper_->SetListener(NULL); |
| 274 if (icon_helper_.get()) | 274 if (icon_helper_.get()) |
| 275 icon_helper_->SetListener(NULL); | 275 icon_helper_->SetListener(NULL); |
| 276 base::subtle::NoBarrier_AtomicIncrement(&g_instance_count, -1); | 276 base::subtle::NoBarrier_AtomicIncrement(&g_instance_count, -1); |
| 277 // When the last WebView is destroyed free all discardable memory allocated by | 277 // When the last WebView is destroyed free all discardable memory allocated by |
| 278 // Chromium, because the app process may continue to run for a long time | 278 // Chromium, because the app process may continue to run for a long time |
| 279 // without ever using another WebView. | 279 // without ever using another WebView. |
| 280 if (base::subtle::NoBarrier_Load(&g_instance_count) == 0) { | 280 if (base::subtle::NoBarrier_Load(&g_instance_count) == 0) { |
| 281 base::MemoryPressureListener::NotifyMemoryPressure( | 281 base::MemoryPressureListener::NotifyMemoryPressure( |
| 282 base::MemoryPressureListener::MEMORY_PRESSURE_CRITICAL); | 282 base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL); |
| 283 } | 283 } |
| 284 } | 284 } |
| 285 | 285 |
| 286 jlong AwContents::GetWebContents(JNIEnv* env, jobject obj) { | 286 jlong AwContents::GetWebContents(JNIEnv* env, jobject obj) { |
| 287 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 287 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 288 DCHECK(web_contents_); | 288 DCHECK(web_contents_); |
| 289 return reinterpret_cast<intptr_t>(web_contents_.get()); | 289 return reinterpret_cast<intptr_t>(web_contents_.get()); |
| 290 } | 290 } |
| 291 | 291 |
| 292 void AwContents::Destroy(JNIEnv* env, jobject obj) { | 292 void AwContents::Destroy(JNIEnv* env, jobject obj) { |
| (...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1168 } | 1168 } |
| 1169 | 1169 |
| 1170 browser_view_renderer_.TrimMemory(level, visible); | 1170 browser_view_renderer_.TrimMemory(level, visible); |
| 1171 } | 1171 } |
| 1172 | 1172 |
| 1173 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { | 1173 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { |
| 1174 g_should_download_favicons = true; | 1174 g_should_download_favicons = true; |
| 1175 } | 1175 } |
| 1176 | 1176 |
| 1177 } // namespace android_webview | 1177 } // namespace android_webview |
| OLD | NEW |