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

Side by Side Diff: third_party/WebKit/Source/core/css/MediaQuery.cpp

Issue 1858753003: Remove RawPtr from core/css (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
OLDNEW
1 /* 1 /*
2 * CSS Media Query 2 * CSS Media Query
3 * 3 *
4 * Copyright (C) 2005, 2006 Kimmo Kinnunen <kimmo.t.kinnunen@nokia.com>. 4 * Copyright (C) 2005, 2006 Kimmo Kinnunen <kimmo.t.kinnunen@nokia.com>.
5 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 5 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 result.append(m_expressions.at(i)->serialize()); 67 result.append(m_expressions.at(i)->serialize());
68 } 68 }
69 return result.toString(); 69 return result.toString();
70 } 70 }
71 71
72 static bool expressionCompare(const Member<MediaQueryExp>& a, const Member<Media QueryExp>& b) 72 static bool expressionCompare(const Member<MediaQueryExp>& a, const Member<Media QueryExp>& b)
73 { 73 {
74 return codePointCompare(a->serialize(), b->serialize()) < 0; 74 return codePointCompare(a->serialize(), b->serialize()) < 0;
75 } 75 }
76 76
77 RawPtr<MediaQuery> MediaQuery::createNotAll() 77 MediaQuery* MediaQuery::createNotAll()
78 { 78 {
79 return new MediaQuery(MediaQuery::Not, MediaTypeNames::all, ExpressionHeapVe ctor()); 79 return new MediaQuery(MediaQuery::Not, MediaTypeNames::all, ExpressionHeapVe ctor());
80 } 80 }
81 81
82 RawPtr<MediaQuery> MediaQuery::create(RestrictorType restrictor, String mediaTyp e, ExpressionHeapVector expressions) 82 MediaQuery* MediaQuery::create(RestrictorType restrictor, String mediaType, Expr essionHeapVector expressions)
83 { 83 {
84 return new MediaQuery(restrictor, std::move(mediaType), std::move(expression s)); 84 return new MediaQuery(restrictor, std::move(mediaType), std::move(expression s));
85 } 85 }
86 86
87 MediaQuery::MediaQuery(RestrictorType restrictor, String mediaType, ExpressionHe apVector expressions) 87 MediaQuery::MediaQuery(RestrictorType restrictor, String mediaType, ExpressionHe apVector expressions)
88 : m_restrictor(restrictor) 88 : m_restrictor(restrictor)
89 , m_mediaType(attemptStaticStringCreation(mediaType.lower())) 89 , m_mediaType(attemptStaticStringCreation(mediaType.lower()))
90 , m_expressions(std::move(expressions)) 90 , m_expressions(std::move(expressions))
91 { 91 {
92 nonCopyingSort(m_expressions.begin(), m_expressions.end(), expressionCompare ); 92 nonCopyingSort(m_expressions.begin(), m_expressions.end(), expressionCompare );
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 } 133 }
134 134
135 DEFINE_TRACE(MediaQuery) 135 DEFINE_TRACE(MediaQuery)
136 { 136 {
137 // We don't support tracing of vectors of OwnPtrs (ie. OwnPtr<Vector<OwnPtr< MediaQuery>>>). 137 // We don't support tracing of vectors of OwnPtrs (ie. OwnPtr<Vector<OwnPtr< MediaQuery>>>).
138 // Since this is a transitional object we are just ifdef'ing it out when oil pan is not enabled. 138 // Since this is a transitional object we are just ifdef'ing it out when oil pan is not enabled.
139 visitor->trace(m_expressions); 139 visitor->trace(m_expressions);
140 } 140 }
141 141
142 } // namespace blink 142 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/MediaQuery.h ('k') | third_party/WebKit/Source/core/css/MediaQueryEvaluatorTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698