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

Side by Side Diff: Source/core/css/MediaList.cpp

Issue 419203004: DevTools: wrapping arguments addConsoleMessage in ConsoleMessage (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@wrap-not-all-console-args
Patch Set: Created 6 years, 4 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
« no previous file with comments | « Source/bindings/core/v8/ScriptController.cpp ('k') | Source/core/dom/AddConsoleMessageTask.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2006, 2010, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2006, 2010, 2012 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 11 matching lines...) Expand all
22 22
23 #include "bindings/core/v8/ExceptionState.h" 23 #include "bindings/core/v8/ExceptionState.h"
24 #include "core/MediaFeatureNames.h" 24 #include "core/MediaFeatureNames.h"
25 #include "core/css/parser/BisonCSSParser.h" 25 #include "core/css/parser/BisonCSSParser.h"
26 #include "core/css/CSSStyleSheet.h" 26 #include "core/css/CSSStyleSheet.h"
27 #include "core/css/MediaQuery.h" 27 #include "core/css/MediaQuery.h"
28 #include "core/css/MediaQueryExp.h" 28 #include "core/css/MediaQueryExp.h"
29 #include "core/css/parser/MediaQueryParser.h" 29 #include "core/css/parser/MediaQueryParser.h"
30 #include "core/dom/Document.h" 30 #include "core/dom/Document.h"
31 #include "core/frame/LocalDOMWindow.h" 31 #include "core/frame/LocalDOMWindow.h"
32 #include "core/inspector/ConsoleMessage.h"
32 #include "wtf/text/StringBuilder.h" 33 #include "wtf/text/StringBuilder.h"
33 34
34 namespace blink { 35 namespace blink {
35 36
36 /* MediaList is used to store 3 types of media related entities which mean the s ame: 37 /* MediaList is used to store 3 types of media related entities which mean the s ame:
37 * 38 *
38 * Media Queries, Media Types and Media Descriptors. 39 * Media Queries, Media Types and Media Descriptors.
39 * 40 *
40 * Media queries, as described in the Media Queries Level 3 specification, build on 41 * Media queries, as described in the Media Queries Level 3 specification, build on
41 * the mechanism outlined in HTML4. The syntax of media queries fit into the med ia 42 * the mechanism outlined in HTML4. The syntax of media queries fit into the med ia
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 StringBuilder message; 269 StringBuilder message;
269 if (CSSPrimitiveValue::isDotsPerInch(type)) 270 if (CSSPrimitiveValue::isDotsPerInch(type))
270 message.append(String(mediaQueryMessage).replace("%replacementUnits%", m ediaValueDPI).replace("%lengthUnit%", lengthUnitInch)); 271 message.append(String(mediaQueryMessage).replace("%replacementUnits%", m ediaValueDPI).replace("%lengthUnit%", lengthUnitInch));
271 else if (CSSPrimitiveValue::isDotsPerCentimeter(type)) 272 else if (CSSPrimitiveValue::isDotsPerCentimeter(type))
272 message.append(String(mediaQueryMessage).replace("%replacementUnits%", m ediaValueDPCM).replace("%lengthUnit%", lengthUnitCentimeter)); 273 message.append(String(mediaQueryMessage).replace("%replacementUnits%", m ediaValueDPCM).replace("%lengthUnit%", lengthUnitCentimeter));
273 else 274 else
274 ASSERT_NOT_REACHED(); 275 ASSERT_NOT_REACHED();
275 276
276 message.append(serializedExpression); 277 message.append(serializedExpression);
277 278
278 document->addConsoleMessage(CSSMessageSource, DebugMessageLevel, message.toS tring()); 279 document->addConsoleMessage(ConsoleMessage::create(CSSMessageSource, DebugMe ssageLevel, message.toString()));
279 } 280 }
280 281
281 static inline bool isResolutionMediaFeature(const String& mediaFeature) 282 static inline bool isResolutionMediaFeature(const String& mediaFeature)
282 { 283 {
283 return mediaFeature == MediaFeatureNames::resolutionMediaFeature 284 return mediaFeature == MediaFeatureNames::resolutionMediaFeature
284 || mediaFeature == MediaFeatureNames::maxResolutionMediaFeature 285 || mediaFeature == MediaFeatureNames::maxResolutionMediaFeature
285 || mediaFeature == MediaFeatureNames::minResolutionMediaFeature; 286 || mediaFeature == MediaFeatureNames::minResolutionMediaFeature;
286 } 287 }
287 288
288 void reportMediaQueryWarningIfNeeded(Document* document, const MediaQuerySet* me diaQuerySet) 289 void reportMediaQueryWarningIfNeeded(Document* document, const MediaQuerySet* me diaQuerySet)
(...skipping 27 matching lines...) Expand all
316 } 317 }
317 } 318 }
318 } 319 }
319 } 320 }
320 321
321 if (suspiciousType && !dotsPerPixelUsed) 322 if (suspiciousType && !dotsPerPixelUsed)
322 addResolutionWarningMessageToConsole(document, mediaQuerySet->mediaText( ), suspiciousType); 323 addResolutionWarningMessageToConsole(document, mediaQuerySet->mediaText( ), suspiciousType);
323 } 324 }
324 325
325 } 326 }
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/ScriptController.cpp ('k') | Source/core/dom/AddConsoleMessageTask.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698