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

Side by Side Diff: third_party/WebKit/Source/modules/screen_orientation/ScreenOrientation.cpp

Issue 2862963003: Replace ASSERT with DCHECK in modules/ (Closed)
Patch Set: NOTREACHED instead of DCHECK(false) 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "modules/screen_orientation/ScreenOrientation.h" 5 #include "modules/screen_orientation/ScreenOrientation.h"
6 6
7 #include "bindings/core/v8/ScriptPromise.h" 7 #include "bindings/core/v8/ScriptPromise.h"
8 #include "bindings/core/v8/ScriptPromiseResolver.h" 8 #include "bindings/core/v8/ScriptPromiseResolver.h"
9 #include "core/dom/DOMException.h" 9 #include "core/dom/DOMException.h"
10 #include "core/dom/Document.h" 10 #include "core/dom/Document.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 return static_cast<WebScreenOrientationLockType>( 86 return static_cast<WebScreenOrientationLockType>(
87 orientation_map[i].orientation); 87 orientation_map[i].orientation);
88 } 88 }
89 89
90 NOTREACHED(); 90 NOTREACHED();
91 return kWebScreenOrientationLockDefault; 91 return kWebScreenOrientationLockDefault;
92 } 92 }
93 93
94 // static 94 // static
95 ScreenOrientation* ScreenOrientation::Create(LocalFrame* frame) { 95 ScreenOrientation* ScreenOrientation::Create(LocalFrame* frame) {
96 ASSERT(frame); 96 DCHECK(frame);
97 97
98 // Check if the ScreenOrientationController is supported for the 98 // Check if the ScreenOrientationController is supported for the
99 // frame. It will not be for all LocalFrames, or the frame may 99 // frame. It will not be for all LocalFrames, or the frame may
100 // have been detached. 100 // have been detached.
101 if (!ScreenOrientationControllerImpl::From(*frame)) 101 if (!ScreenOrientationControllerImpl::From(*frame))
102 return nullptr; 102 return nullptr;
103 103
104 ScreenOrientation* orientation = new ScreenOrientation(frame); 104 ScreenOrientation* orientation = new ScreenOrientation(frame);
105 ASSERT(orientation->Controller()); 105 DCHECK(orientation->Controller());
106 // FIXME: ideally, we would like to provide the ScreenOrientationController 106 // FIXME: ideally, we would like to provide the ScreenOrientationController
107 // the case where it is not defined but for the moment, it is eagerly 107 // the case where it is not defined but for the moment, it is eagerly
108 // created when the LocalFrame is created so we shouldn't be in that 108 // created when the LocalFrame is created so we shouldn't be in that
109 // situation. 109 // situation.
110 // In order to create the ScreenOrientationController lazily, we would need 110 // In order to create the ScreenOrientationController lazily, we would need
111 // to be able to access WebFrameClient from modules/. 111 // to be able to access WebFrameClient from modules/.
112 112
113 orientation->Controller()->SetOrientation(orientation); 113 orientation->Controller()->SetOrientation(orientation);
114 return orientation; 114 return orientation;
115 } 115 }
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 187
188 return ScreenOrientationControllerImpl::From(*GetFrame()); 188 return ScreenOrientationControllerImpl::From(*GetFrame());
189 } 189 }
190 190
191 DEFINE_TRACE(ScreenOrientation) { 191 DEFINE_TRACE(ScreenOrientation) {
192 EventTargetWithInlineData::Trace(visitor); 192 EventTargetWithInlineData::Trace(visitor);
193 ContextClient::Trace(visitor); 193 ContextClient::Trace(visitor);
194 } 194 }
195 195
196 } // namespace blink 196 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698