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

Side by Side Diff: third_party/WebKit/Source/core/frame/Deprecation.cpp

Issue 2858963002: Replace ASSERT with DCHECK in core/ (Closed)
Patch Set: WorkerBackingThread 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "core/frame/Deprecation.h" 5 #include "core/frame/Deprecation.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/dom/ExecutionContext.h" 8 #include "core/dom/ExecutionContext.h"
9 #include "core/frame/FrameConsole.h" 9 #include "core/frame/FrameConsole.h"
10 #include "core/frame/LocalFrame.h" 10 #include "core/frame/LocalFrame.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 void Deprecation::CountDeprecation(const LocalFrame* frame, 123 void Deprecation::CountDeprecation(const LocalFrame* frame,
124 UseCounter::Feature feature) { 124 UseCounter::Feature feature) {
125 if (!frame) 125 if (!frame)
126 return; 126 return;
127 Page* page = frame->GetPage(); 127 Page* page = frame->GetPage();
128 if (!page || page->GetDeprecation().mute_count_) 128 if (!page || page->GetDeprecation().mute_count_)
129 return; 129 return;
130 130
131 if (!page->GetUseCounter().HasRecordedMeasurement(feature)) { 131 if (!page->GetUseCounter().HasRecordedMeasurement(feature)) {
132 page->GetUseCounter().RecordMeasurement(feature); 132 page->GetUseCounter().RecordMeasurement(feature);
133 ASSERT(!DeprecationMessage(feature).IsEmpty()); 133 DCHECK(!DeprecationMessage(feature).IsEmpty());
134 ConsoleMessage* console_message = 134 ConsoleMessage* console_message =
135 ConsoleMessage::Create(kDeprecationMessageSource, kWarningMessageLevel, 135 ConsoleMessage::Create(kDeprecationMessageSource, kWarningMessageLevel,
136 DeprecationMessage(feature)); 136 DeprecationMessage(feature));
137 frame->Console().AddMessage(console_message); 137 frame->Console().AddMessage(console_message);
138 } 138 }
139 } 139 }
140 140
141 void Deprecation::CountDeprecation(ExecutionContext* context, 141 void Deprecation::CountDeprecation(ExecutionContext* context,
142 UseCounter::Feature feature) { 142 UseCounter::Feature feature) {
143 if (!context) 143 if (!context)
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 return replacedBy("-webkit-repeating-radial-gradient", 432 return replacedBy("-webkit-repeating-radial-gradient",
433 "repeating-radial-gradient"); 433 "repeating-radial-gradient");
434 434
435 // Features that aren't deprecated don't have a deprecation message. 435 // Features that aren't deprecated don't have a deprecation message.
436 default: 436 default:
437 return String(); 437 return String();
438 } 438 }
439 } 439 }
440 440
441 } // namespace blink 441 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/DOMWindow.cpp ('k') | third_party/WebKit/Source/core/frame/Frame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698