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

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

Issue 2876513002: Use WTF::TimeDelta to specify delays on WebTaskRunner (Closed)
Patch Set: mac fix Created 3 years, 7 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) 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 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after
1033 } 1033 }
1034 1034
1035 void ScrollAnimatorMac::StartScrollbarPaintTimer() { 1035 void ScrollAnimatorMac::StartScrollbarPaintTimer() {
1036 // Post a task with 1 ms delay to give a chance to run other immediate tasks 1036 // Post a task with 1 ms delay to give a chance to run other immediate tasks
1037 // that may cancel this. 1037 // that may cancel this.
1038 initial_scrollbar_paint_task_handle_ = 1038 initial_scrollbar_paint_task_handle_ =
1039 task_runner_->PostDelayedCancellableTask( 1039 task_runner_->PostDelayedCancellableTask(
1040 BLINK_FROM_HERE, 1040 BLINK_FROM_HERE,
1041 WTF::Bind(&ScrollAnimatorMac::InitialScrollbarPaintTask, 1041 WTF::Bind(&ScrollAnimatorMac::InitialScrollbarPaintTask,
1042 WrapWeakPersistent(this)), 1042 WrapWeakPersistent(this)),
1043 1); 1043 TimeDelta::FromMilliseconds(1));
1044 } 1044 }
1045 1045
1046 bool ScrollAnimatorMac::ScrollbarPaintTimerIsActive() const { 1046 bool ScrollAnimatorMac::ScrollbarPaintTimerIsActive() const {
1047 return initial_scrollbar_paint_task_handle_.IsActive(); 1047 return initial_scrollbar_paint_task_handle_.IsActive();
1048 } 1048 }
1049 1049
1050 void ScrollAnimatorMac::StopScrollbarPaintTimer() { 1050 void ScrollAnimatorMac::StopScrollbarPaintTimer() {
1051 initial_scrollbar_paint_task_handle_.Cancel(); 1051 initial_scrollbar_paint_task_handle_.Cancel();
1052 } 1052 }
1053 1053
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
1088 rect_in_view_coordinates = 1088 rect_in_view_coordinates =
1089 vertical_scrollbar->ConvertToContainingFrameViewBase(scroller_thumb); 1089 vertical_scrollbar->ConvertToContainingFrameViewBase(scroller_thumb);
1090 1090
1091 if (rect_in_view_coordinates == visible_scroller_thumb_rect_) 1091 if (rect_in_view_coordinates == visible_scroller_thumb_rect_)
1092 return; 1092 return;
1093 1093
1094 visible_scroller_thumb_rect_ = rect_in_view_coordinates; 1094 visible_scroller_thumb_rect_ = rect_in_view_coordinates;
1095 } 1095 }
1096 1096
1097 } // namespace blink 1097 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698