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

Side by Side Diff: third_party/WebKit/Source/platform/mac/ScrollAnimatorMac.mm

Issue 2550373005: Make WebTaskRunner ThreadSafeRefCounted (Closed)
Patch Set: mac fix Created 4 years 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) 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2010, 2011 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 @end 685 @end
686 686
687 namespace blink { 687 namespace blink {
688 688
689 ScrollAnimatorBase* ScrollAnimatorBase::create(ScrollableArea* scrollableArea) { 689 ScrollAnimatorBase* ScrollAnimatorBase::create(ScrollableArea* scrollableArea) {
690 return new ScrollAnimatorMac(scrollableArea); 690 return new ScrollAnimatorMac(scrollableArea);
691 } 691 }
692 692
693 ScrollAnimatorMac::ScrollAnimatorMac(ScrollableArea* scrollableArea) 693 ScrollAnimatorMac::ScrollAnimatorMac(ScrollableArea* scrollableArea)
694 : ScrollAnimatorBase(scrollableArea), 694 : ScrollAnimatorBase(scrollableArea),
695 m_taskRunner(Platform::current() 695 m_taskRunner(
696 ->currentThread() 696 Platform::current()->currentThread()->scheduler()->timerTaskRunner()),
697 ->scheduler()
698 ->timerTaskRunner()
699 ->clone()),
700 m_haveScrolledSincePageLoad(false), 697 m_haveScrolledSincePageLoad(false),
701 m_needsScrollerStyleUpdate(false) { 698 m_needsScrollerStyleUpdate(false) {
702 ThreadState::current()->registerPreFinalizer(this); 699 ThreadState::current()->registerPreFinalizer(this);
703 700
704 m_scrollAnimationHelperDelegate.adoptNS( 701 m_scrollAnimationHelperDelegate.adoptNS(
705 [[BlinkScrollAnimationHelperDelegate alloc] initWithScrollAnimator:this]); 702 [[BlinkScrollAnimationHelperDelegate alloc] initWithScrollAnimator:this]);
706 m_scrollAnimationHelper.adoptNS( 703 m_scrollAnimationHelper.adoptNS(
707 [[NSClassFromString(@"NSScrollAnimationHelper") alloc] 704 [[NSClassFromString(@"NSScrollAnimationHelper") alloc]
708 initWithDelegate:m_scrollAnimationHelperDelegate.get()]); 705 initWithDelegate:m_scrollAnimationHelperDelegate.get()]);
709 706
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
1080 rectInViewCoordinates = 1077 rectInViewCoordinates =
1081 verticalScrollbar->convertToContainingWidget(scrollerThumb); 1078 verticalScrollbar->convertToContainingWidget(scrollerThumb);
1082 1079
1083 if (rectInViewCoordinates == m_visibleScrollerThumbRect) 1080 if (rectInViewCoordinates == m_visibleScrollerThumbRect)
1084 return; 1081 return;
1085 1082
1086 m_visibleScrollerThumbRect = rectInViewCoordinates; 1083 m_visibleScrollerThumbRect = rectInViewCoordinates;
1087 } 1084 }
1088 1085
1089 } // namespace blink 1086 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698