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

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

Issue 219183002: Disable the thread-safe MQ parser for main thread (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Testing BisonCSSParser Created 6 years, 8 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/core/css/MediaList.h ('k') | Source/core/css/MediaQuerySetTest.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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 m_queries[i] = o.m_queries[i]->copy(); 64 m_queries[i] = o.m_queries[i]->copy();
65 } 65 }
66 66
67 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(MediaQuerySet) 67 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(MediaQuerySet)
68 68
69 PassRefPtrWillBeRawPtr<MediaQuerySet> MediaQuerySet::create(const String& mediaS tring) 69 PassRefPtrWillBeRawPtr<MediaQuerySet> MediaQuerySet::create(const String& mediaS tring)
70 { 70 {
71 if (mediaString.isEmpty()) 71 if (mediaString.isEmpty())
72 return MediaQuerySet::create(); 72 return MediaQuerySet::create();
73 73
74 BisonCSSParser parser(strictCSSParserContext());
75 return parser.parseMediaQueryList(mediaString);
76 }
77
78 PassRefPtrWillBeRawPtr<MediaQuerySet> MediaQuerySet::createOffMainThread(const S tring& mediaString)
79 {
80 if (mediaString.isEmpty())
81 return MediaQuerySet::create();
82
74 return MediaQueryParser::parse(mediaString); 83 return MediaQueryParser::parse(mediaString);
75
76 } 84 }
77 85
78 bool MediaQuerySet::set(const String& mediaString) 86 bool MediaQuerySet::set(const String& mediaString)
79 { 87 {
80 RefPtrWillBeRawPtr<MediaQuerySet> result = create(mediaString); 88 RefPtrWillBeRawPtr<MediaQuerySet> result = create(mediaString);
81 m_queries.swap(result->m_queries); 89 m_queries.swap(result->m_queries);
82 return true; 90 return true;
83 } 91 }
84 92
85 bool MediaQuerySet::add(const String& queryString) 93 bool MediaQuerySet::add(const String& queryString)
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 } 313 }
306 } 314 }
307 } 315 }
308 } 316 }
309 317
310 if (suspiciousValue && !dotsPerPixelUsed) 318 if (suspiciousValue && !dotsPerPixelUsed)
311 addResolutionWarningMessageToConsole(document, mediaQuerySet->mediaText( ), suspiciousValue); 319 addResolutionWarningMessageToConsole(document, mediaQuerySet->mediaText( ), suspiciousValue);
312 } 320 }
313 321
314 } 322 }
OLDNEW
« no previous file with comments | « Source/core/css/MediaList.h ('k') | Source/core/css/MediaQuerySetTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698