OLD | NEW |
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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 | 330 |
331 void StyleSheetHandler::endMediaQuery() | 331 void StyleSheetHandler::endMediaQuery() |
332 { | 332 { |
333 m_currentMediaQueryData.clear(); | 333 m_currentMediaQueryData.clear(); |
334 } | 334 } |
335 | 335 |
336 } // namespace | 336 } // namespace |
337 | 337 |
338 class ParsedStyleSheet : public NoBaseWillBeGarbageCollectedFinalized<ParsedStyl
eSheet> { | 338 class ParsedStyleSheet : public NoBaseWillBeGarbageCollectedFinalized<ParsedStyl
eSheet> { |
339 public: | 339 public: |
340 ParsedStyleSheet(CSSStyleSheet* pageStyleSheet); | 340 static PassOwnPtrWillBeRawPtr<ParsedStyleSheet> create(CSSStyleSheet* pageSt
yleSheet) |
| 341 { |
| 342 return adoptPtrWillBeNoop(new ParsedStyleSheet(pageStyleSheet)); |
| 343 } |
341 | 344 |
342 const String& text() const { ASSERT(m_hasText); return m_text; } | 345 const String& text() const { ASSERT(m_hasText); return m_text; } |
343 void setText(const String&); | 346 void setText(const String&); |
344 bool hasText() const { return m_hasText; } | 347 bool hasText() const { return m_hasText; } |
345 bool ensureSourceData(); | 348 bool ensureSourceData(); |
346 bool hasSourceData() const { return m_sourceData; } | 349 bool hasSourceData() const { return m_sourceData; } |
347 PassRefPtrWillBeRawPtr<blink::CSSRuleSourceData> ruleSourceDataAt(unsigned)
const; | 350 PassRefPtrWillBeRawPtr<blink::CSSRuleSourceData> ruleSourceDataAt(unsigned)
const; |
348 unsigned ruleCount() { return m_sourceData->size(); } | 351 unsigned ruleCount() { return m_sourceData->size(); } |
349 | 352 |
350 DECLARE_TRACE(); | 353 DECLARE_TRACE(); |
351 | 354 |
352 private: | 355 private: |
| 356 explicit ParsedStyleSheet(CSSStyleSheet* pageStyleSheet); |
| 357 |
353 void flattenSourceData(RuleSourceDataList*); | 358 void flattenSourceData(RuleSourceDataList*); |
354 void setSourceData(PassOwnPtrWillBeRawPtr<RuleSourceDataList>); | 359 void setSourceData(PassOwnPtrWillBeRawPtr<RuleSourceDataList>); |
355 | 360 |
356 String m_text; | 361 String m_text; |
357 bool m_hasText; | 362 bool m_hasText; |
358 OwnPtrWillBeMember<RuleSourceDataList> m_sourceData; | 363 OwnPtrWillBeMember<RuleSourceDataList> m_sourceData; |
359 RefPtrWillBeMember<CSSStyleSheet> m_pageStyleSheet; | 364 RefPtrWillBeMember<CSSStyleSheet> m_pageStyleSheet; |
360 }; | 365 }; |
361 | 366 |
362 ParsedStyleSheet::ParsedStyleSheet(CSSStyleSheet* pageStyleSheet) | 367 ParsedStyleSheet::ParsedStyleSheet(CSSStyleSheet* pageStyleSheet) |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
941 } | 946 } |
942 | 947 |
943 InspectorStyleSheet::InspectorStyleSheet(InspectorResourceAgent* resourceAgent,
const String& id, PassRefPtrWillBeRawPtr<CSSStyleSheet> pageStyleSheet, TypeBuil
der::CSS::StyleSheetOrigin::Enum origin, const String& documentURL, InspectorCSS
Agent* cssAgent) | 948 InspectorStyleSheet::InspectorStyleSheet(InspectorResourceAgent* resourceAgent,
const String& id, PassRefPtrWillBeRawPtr<CSSStyleSheet> pageStyleSheet, TypeBuil
der::CSS::StyleSheetOrigin::Enum origin, const String& documentURL, InspectorCSS
Agent* cssAgent) |
944 : InspectorStyleSheetBase(id, cssAgent) | 949 : InspectorStyleSheetBase(id, cssAgent) |
945 , m_cssAgent(cssAgent) | 950 , m_cssAgent(cssAgent) |
946 , m_resourceAgent(resourceAgent) | 951 , m_resourceAgent(resourceAgent) |
947 , m_pageStyleSheet(pageStyleSheet) | 952 , m_pageStyleSheet(pageStyleSheet) |
948 , m_origin(origin) | 953 , m_origin(origin) |
949 , m_documentURL(documentURL) | 954 , m_documentURL(documentURL) |
950 { | 955 { |
951 m_parsedStyleSheet = adoptPtr(new ParsedStyleSheet(m_pageStyleSheet.get())); | 956 m_parsedStyleSheet = ParsedStyleSheet::create(m_pageStyleSheet.get()); |
952 } | 957 } |
953 | 958 |
954 InspectorStyleSheet::~InspectorStyleSheet() | 959 InspectorStyleSheet::~InspectorStyleSheet() |
955 { | 960 { |
956 } | 961 } |
957 | 962 |
958 DEFINE_TRACE(InspectorStyleSheet) | 963 DEFINE_TRACE(InspectorStyleSheet) |
959 { | 964 { |
960 visitor->trace(m_cssAgent); | 965 visitor->trace(m_cssAgent); |
961 visitor->trace(m_resourceAgent); | 966 visitor->trace(m_resourceAgent); |
(...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1940 | 1945 |
1941 DEFINE_TRACE(InspectorStyleSheetForInlineStyle) | 1946 DEFINE_TRACE(InspectorStyleSheetForInlineStyle) |
1942 { | 1947 { |
1943 visitor->trace(m_element); | 1948 visitor->trace(m_element); |
1944 visitor->trace(m_ruleSourceData); | 1949 visitor->trace(m_ruleSourceData); |
1945 visitor->trace(m_inspectorStyle); | 1950 visitor->trace(m_inspectorStyle); |
1946 InspectorStyleSheetBase::trace(visitor); | 1951 InspectorStyleSheetBase::trace(visitor); |
1947 } | 1952 } |
1948 | 1953 |
1949 } // namespace blink | 1954 } // namespace blink |
OLD | NEW |