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

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

Issue 444173003: aw: Improve idle task scheduling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove CurrentlyOnUIThread Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « android_webview/browser/shared_renderer_state.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 manager->DidDrawGL(renderer_manager_key_); 355 manager->DidDrawGL(renderer_manager_key_);
356 } 356 }
357 } 357 }
358 358
359 ScopedAppGLStateRestore state_restore( 359 ScopedAppGLStateRestore state_restore(
360 draw_info->mode == AwDrawGLInfo::kModeDraw 360 draw_info->mode == AwDrawGLInfo::kModeDraw
361 ? ScopedAppGLStateRestore::MODE_DRAW 361 ? ScopedAppGLStateRestore::MODE_DRAW
362 : ScopedAppGLStateRestore::MODE_RESOURCE_MANAGEMENT); 362 : ScopedAppGLStateRestore::MODE_RESOURCE_MANAGEMENT);
363 ScopedAllowGL allow_gl; 363 ScopedAllowGL allow_gl;
364 364
365 if (draw_info->mode == AwDrawGLInfo::kModeProcessNoContext) {
366 LOG(ERROR) << "Received unexpected kModeProcessNoContext";
367 }
368
369 // kModeProcessNoContext should never happen because we tear down hardware
370 // in onTrimMemory. However that guarantee is maintained outside of chromium
371 // code. Not notifying shared state in kModeProcessNoContext can lead to
372 // immediate deadlock, which is slightly more catastrophic than leaks or
373 // corruption.
374 if (draw_info->mode == AwDrawGLInfo::kModeProcess ||
375 draw_info->mode == AwDrawGLInfo::kModeProcessNoContext) {
376 shared_renderer_state_.DidDrawGLProcess();
377 }
378
365 if (shared_renderer_state_.IsInsideHardwareRelease()) { 379 if (shared_renderer_state_.IsInsideHardwareRelease()) {
366 hardware_renderer_.reset(); 380 hardware_renderer_.reset();
367 // Flush the idle queue in tear down. 381 // Flush the idle queue in tear down.
368 DeferredGpuCommandService::GetInstance()->PerformIdleWork(true); 382 DeferredGpuCommandService::GetInstance()->PerformAllIdleWork();
369 DCHECK(!DeferredGpuCommandService::GetInstance()->HasIdleWork());
370 return; 383 return;
371 } 384 }
372 385
373 if (draw_info->mode != AwDrawGLInfo::kModeDraw) { 386 if (draw_info->mode != AwDrawGLInfo::kModeDraw) {
374 if (draw_info->mode == AwDrawGLInfo::kModeProcess) { 387 if (draw_info->mode == AwDrawGLInfo::kModeProcess) {
375 DeferredGpuCommandService::GetInstance()->PerformIdleWork(true); 388 DeferredGpuCommandService::GetInstance()->PerformIdleWork(true);
376 } 389 }
377 return; 390 return;
378 } 391 }
379 392
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after
1164 } 1177 }
1165 1178
1166 browser_view_renderer_.TrimMemory(level, visible); 1179 browser_view_renderer_.TrimMemory(level, visible);
1167 } 1180 }
1168 1181
1169 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { 1182 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) {
1170 g_should_download_favicons = true; 1183 g_should_download_favicons = true;
1171 } 1184 }
1172 1185
1173 } // namespace android_webview 1186 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/browser/shared_renderer_state.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698