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

Side by Side Diff: third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp

Issue 2620453003: Update comments about not setting kHandlingScrollFromMainThread on subframes (Closed)
Patch Set: Created 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2011, Google Inc. All rights reserved. 2 * Copyright (c) 2011, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 354
355 // Main thread should deal with the scroll animations it started. 355 // Main thread should deal with the scroll animations it started.
356 if (sentToCompositor || runningOnMainThread) 356 if (sentToCompositor || runningOnMainThread)
357 addMainThreadScrollingReason(); 357 addMainThreadScrollingReason();
358 else 358 else
359 removeMainThreadScrollingReason(); 359 removeMainThreadScrollingReason();
360 } 360 }
361 } 361 }
362 362
363 void ScrollAnimator::addMainThreadScrollingReason() { 363 void ScrollAnimator::addMainThreadScrollingReason() {
364 // TODO(yigu): Should update the frame tree to make sure
365 // the same reason is set for subframes. crbug.com/675677.
366 if (WebLayer* scrollLayer = 364 if (WebLayer* scrollLayer =
367 toWebLayer(getScrollableArea()->layerForScrolling())) { 365 toWebLayer(getScrollableArea()->layerForScrolling())) {
368 scrollLayer->addMainThreadScrollingReasons( 366 scrollLayer->addMainThreadScrollingReasons(
369 MainThreadScrollingReason::kHandlingScrollFromMainThread); 367 MainThreadScrollingReason::kHandlingScrollFromMainThread);
370 } 368 }
371 } 369 }
372 370
373 void ScrollAnimator::removeMainThreadScrollingReason() { 371 void ScrollAnimator::removeMainThreadScrollingReason() {
374 if (WebLayer* scrollLayer = 372 if (WebLayer* scrollLayer =
375 toWebLayer(getScrollableArea()->layerForScrolling())) { 373 toWebLayer(getScrollableArea()->layerForScrolling())) {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 return false; 432 return false;
435 } 433 }
436 return true; 434 return true;
437 } 435 }
438 436
439 DEFINE_TRACE(ScrollAnimator) { 437 DEFINE_TRACE(ScrollAnimator) {
440 ScrollAnimatorBase::trace(visitor); 438 ScrollAnimatorBase::trace(visitor);
441 } 439 }
442 440
443 } // namespace blink 441 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698