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

Side by Side Diff: third_party/WebKit/Source/core/page/scrolling/ScrollStateCallback.h

Issue 2883353002: Replace ASSERT with DCHECK_LE/GE/GT/LT/NE as appropriate (Closed)
Patch Set: DCHECK in BluetoothCharacteristicProperties.cpp 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef ScrollStateCallback_h 5 #ifndef ScrollStateCallback_h
6 #define ScrollStateCallback_h 6 #define ScrollStateCallback_h
7 7
8 #include "platform/heap/Handle.h" 8 #include "platform/heap/Handle.h"
9 #include "public/platform/WebNativeScrollBehavior.h" 9 #include "public/platform/WebNativeScrollBehavior.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 class ScrollState; 13 class ScrollState;
14 14
15 class ScrollStateCallback 15 class ScrollStateCallback
16 : public GarbageCollectedFinalized<ScrollStateCallback> { 16 : public GarbageCollectedFinalized<ScrollStateCallback> {
17 public: 17 public:
18 ScrollStateCallback() 18 ScrollStateCallback()
19 : native_scroll_behavior_(WebNativeScrollBehavior::kDisableNativeScroll) { 19 : native_scroll_behavior_(WebNativeScrollBehavior::kDisableNativeScroll) {
20 } 20 }
21 21
22 virtual ~ScrollStateCallback() {} 22 virtual ~ScrollStateCallback() {}
23 23
24 DEFINE_INLINE_VIRTUAL_TRACE() {} 24 DEFINE_INLINE_VIRTUAL_TRACE() {}
25 virtual void handleEvent(ScrollState*) = 0; 25 virtual void handleEvent(ScrollState*) = 0;
26 26
27 void SetNativeScrollBehavior(WebNativeScrollBehavior native_scroll_behavior) { 27 void SetNativeScrollBehavior(WebNativeScrollBehavior native_scroll_behavior) {
28 ASSERT(static_cast<int>(native_scroll_behavior) < 3); 28 DCHECK_LT(static_cast<int>(native_scroll_behavior), 3);
29 native_scroll_behavior_ = native_scroll_behavior; 29 native_scroll_behavior_ = native_scroll_behavior;
30 } 30 }
31 31
32 WebNativeScrollBehavior NativeScrollBehavior() { 32 WebNativeScrollBehavior NativeScrollBehavior() {
33 return native_scroll_behavior_; 33 return native_scroll_behavior_;
34 } 34 }
35 35
36 static WebNativeScrollBehavior ToNativeScrollBehavior( 36 static WebNativeScrollBehavior ToNativeScrollBehavior(
37 String native_scroll_behavior); 37 String native_scroll_behavior);
38 38
39 protected: 39 protected:
40 WebNativeScrollBehavior native_scroll_behavior_; 40 WebNativeScrollBehavior native_scroll_behavior_;
41 }; 41 };
42 42
43 } // namespace blink 43 } // namespace blink
44 44
45 #endif // ScrollStateCallback_h 45 #endif // ScrollStateCallback_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698