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

Side by Side Diff: Source/core/inspector/InspectorStyleSheet.cpp

Issue 22887044: [oilpan] Make the oilpan branch build on Mac. (Closed) Base URL: svn://svn.chromium.org/blink/branches/oilpan
Patch Set: Only disable the malloc part of consistency checking Created 7 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010, Google Inc. All rights reserved. 2 * Copyright (C) 2010, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 #include "core/page/ContentSecurityPolicy.h" 57 #include "core/page/ContentSecurityPolicy.h"
58 #include "core/platform/text/RegularExpression.h" 58 #include "core/platform/text/RegularExpression.h"
59 #include "heap/Handle.h" 59 #include "heap/Handle.h"
60 60
61 #include <wtf/OwnPtr.h> 61 #include <wtf/OwnPtr.h>
62 #include <wtf/PassOwnPtr.h> 62 #include <wtf/PassOwnPtr.h>
63 #include <wtf/text/StringBuilder.h> 63 #include <wtf/text/StringBuilder.h>
64 #include <wtf/Vector.h> 64 #include <wtf/Vector.h>
65 65
66 using WebCore::CSSRuleSourceData; 66 using WebCore::CSSRuleSourceData;
67 using WebCore::Handle;
68 using WebCore::Member; 67 using WebCore::Member;
69 using WebCore::Result; 68 using WebCore::Result;
70 using WebCore::RuleSourceDataVectorCollection; 69 using WebCore::RuleSourceDataVectorCollection;
71 using WebCore::TypeBuilder::Array; 70 using WebCore::TypeBuilder::Array;
72 71
73 class ParsedStyleSheet { 72 class ParsedStyleSheet {
74 WTF_MAKE_FAST_ALLOCATED; 73 WTF_MAKE_FAST_ALLOCATED;
75 public: 74 public:
76 ParsedStyleSheet(); 75 ParsedStyleSheet();
77 76
(...skipping 24 matching lines...) Expand all
102 m_hasText = true; 101 m_hasText = true;
103 m_text = text; 102 m_text = text;
104 setSourceData(nullptr); 103 setSourceData(nullptr);
105 } 104 }
106 105
107 // It's safe to use a reference since the lifetime of RuleSourceDataVectorCollec tion 106 // It's safe to use a reference since the lifetime of RuleSourceDataVectorCollec tion
108 // is retained by ParsedStyleSheet::setSourceData(). 107 // is retained by ParsedStyleSheet::setSourceData().
109 static void flattenSourceData(Vector<Member<CSSRuleSourceData> >& dataList, Vect or<Member<CSSRuleSourceData> >& target) 108 static void flattenSourceData(Vector<Member<CSSRuleSourceData> >& dataList, Vect or<Member<CSSRuleSourceData> >& target)
110 { 109 {
111 for (size_t i = 0; i < dataList.size(); ++i) { 110 for (size_t i = 0; i < dataList.size(); ++i) {
112 Handle<CSSRuleSourceData> data = dataList.at(i); 111 WebCore::Handle<CSSRuleSourceData> data = dataList.at(i);
haraken 2013/08/23 11:12:49 Nit: I'm curious why this change is needed. It loo
Mads Ager (chromium) 2013/08/23 11:15:36 I agree. I'll add a FIXME(oilpan) about this. The
haraken 2013/08/23 11:18:52 Makes sense.
113 if (data->type == CSSRuleSourceData::STYLE_RULE) 112 if (data->type == CSSRuleSourceData::STYLE_RULE)
114 target.append(data); 113 target.append(data);
115 else if (data->type == CSSRuleSourceData::MEDIA_RULE) 114 else if (data->type == CSSRuleSourceData::MEDIA_RULE)
116 flattenSourceData(data->childRules, target); 115 flattenSourceData(data->childRules, target);
117 else if (data->type == CSSRuleSourceData::HOST_RULE) 116 else if (data->type == CSSRuleSourceData::HOST_RULE)
118 flattenSourceData(data->childRules, target); 117 flattenSourceData(data->childRules, target);
119 else if (data->type == CSSRuleSourceData::SUPPORTS_RULE) 118 else if (data->type == CSSRuleSourceData::SUPPORTS_RULE)
120 flattenSourceData(data->childRules, target); 119 flattenSourceData(data->childRules, target);
121 } 120 }
122 } 121 }
(...skipping 1704 matching lines...) Expand 10 before | Expand all | Expand 10 after
1827 } 1826 }
1828 Handle<StylePropertySet> tempDeclaration = StylePropertySet::create(); 1827 Handle<StylePropertySet> tempDeclaration = StylePropertySet::create();
1829 RuleSourceDataVectorCollection ruleSourceDataResult; 1828 RuleSourceDataVectorCollection ruleSourceDataResult;
1830 StyleSheetHandler handler(m_styleText, m_element->document(), m_element->doc ument()->elementSheet()->contents(), &ruleSourceDataResult); 1829 StyleSheetHandler handler(m_styleText, m_element->document(), m_element->doc ument()->elementSheet()->contents(), &ruleSourceDataResult);
1831 createCSSParser(m_element->document())->parseDeclaration(tempDeclaration, m_ styleText, &handler, m_element->document()->elementSheet()->contents()); 1830 createCSSParser(m_element->document())->parseDeclaration(tempDeclaration, m_ styleText, &handler, m_element->document()->elementSheet()->contents());
1832 return ruleSourceDataResult->first(); 1831 return ruleSourceDataResult->first();
1833 } 1832 }
1834 1833
1835 } // namespace WebCore 1834 } // namespace WebCore
1836 1835
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698