Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) | 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) |
| 3 Copyright (C) 2001 Dirk Mueller <mueller@kde.org> | 3 Copyright (C) 2001 Dirk Mueller <mueller@kde.org> |
| 4 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 4 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 5 Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 5 Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 6 | 6 |
| 7 This library is free software; you can redistribute it and/or | 7 This library is free software; you can redistribute it and/or |
| 8 modify it under the terms of the GNU Library General Public | 8 modify it under the terms of the GNU Library General Public |
| 9 License as published by the Free Software Foundation; either | 9 License as published by the Free Software Foundation; either |
| 10 version 2 of the License, or (at your option) any later version. | 10 version 2 of the License, or (at your option) any later version. |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 21 | 21 |
| 22 This class provides all functionality needed for loading images, style sheet s and html | 22 This class provides all functionality needed for loading images, style sheet s and html |
| 23 pages from the web. It has a memory cache for these objects. | 23 pages from the web. It has a memory cache for these objects. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef CSSStyleSheetResource_h | 26 #ifndef CSSStyleSheetResource_h |
| 27 #define CSSStyleSheetResource_h | 27 #define CSSStyleSheetResource_h |
| 28 | 28 |
| 29 #include "core/fetch/ResourcePtr.h" | 29 #include "core/fetch/ResourcePtr.h" |
| 30 #include "core/fetch/StyleSheetResource.h" | 30 #include "core/fetch/StyleSheetResource.h" |
| 31 #include "core/html/parser/BackgroundHTMLInputStream.h" | |
| 32 #include "core/html/parser/CSSPreloadScanner.h" | |
| 33 #include "core/html/parser/HTMLParserOptions.h" | |
| 34 #include "core/html/parser/HTMLTokenizer.h" | |
|
abarth-chromium
2014/02/15 18:48:48
Woah there. Fetch shouldn't need to know about an
| |
| 31 | 35 |
| 32 namespace WebCore { | 36 namespace WebCore { |
| 33 | 37 |
| 34 class CSSParserContext; | 38 class CSSParserContext; |
| 35 class ResourceClient; | 39 class ResourceClient; |
| 36 class StyleSheetContents; | 40 class StyleSheetContents; |
| 37 class TextResourceDecoder; | 41 class TextResourceDecoder; |
| 38 | 42 |
| 39 class CSSStyleSheetResource FINAL : public StyleSheetResource { | 43 class CSSStyleSheetResource FINAL : public StyleSheetResource { |
| 40 public: | 44 public: |
| 41 CSSStyleSheetResource(const ResourceRequest&, const String& charset); | 45 CSSStyleSheetResource(const ResourceRequest&, const String& charset, Documen t*); |
|
abarth-chromium
2014/02/15 18:48:48
Resources shouldn't be specific to documents.
| |
| 42 virtual ~CSSStyleSheetResource(); | 46 virtual ~CSSStyleSheetResource(); |
| 43 | 47 |
| 44 const String sheetText(bool enforceMIMEType = true, bool* hasValidMIMEType = 0) const; | 48 const String sheetText(bool enforceMIMEType = true, bool* hasValidMIMEType = 0) const; |
| 45 | 49 |
| 46 virtual void didAddClient(ResourceClient*) OVERRIDE; | 50 virtual void didAddClient(ResourceClient*) OVERRIDE; |
| 47 virtual void setEncoding(const String&) OVERRIDE; | 51 virtual void setEncoding(const String&) OVERRIDE; |
| 48 virtual String encoding() const OVERRIDE; | 52 virtual String encoding() const OVERRIDE; |
| 49 virtual void destroyDecodedData() OVERRIDE; | 53 virtual void destroyDecodedData() OVERRIDE; |
| 50 | 54 |
| 51 PassRefPtr<StyleSheetContents> restoreParsedStyleSheet(const CSSParserContex t&); | 55 PassRefPtr<StyleSheetContents> restoreParsedStyleSheet(const CSSParserContex t&); |
| 52 void saveParsedStyleSheet(PassRefPtr<StyleSheetContents>); | 56 void saveParsedStyleSheet(PassRefPtr<StyleSheetContents>); |
| 53 | 57 |
| 54 private: | 58 private: |
| 55 bool canUseSheet(bool enforceMIMEType, bool* hasValidMIMEType) const; | 59 bool canUseSheet(bool enforceMIMEType, bool* hasValidMIMEType) const; |
| 56 virtual void checkNotify() OVERRIDE; | 60 virtual void checkNotify() OVERRIDE; |
| 61 virtual void appendData(const char*, int); | |
| 62 void prescan(const char* data); | |
| 57 | 63 |
| 58 OwnPtr<TextResourceDecoder> m_decoder; | 64 OwnPtr<TextResourceDecoder> m_decoder; |
| 59 String m_decodedSheetText; | 65 String m_decodedSheetText; |
| 60 | 66 |
| 61 RefPtr<StyleSheetContents> m_parsedStyleSheetCache; | 67 RefPtr<StyleSheetContents> m_parsedStyleSheetCache; |
| 68 HTMLParserOptions m_options; | |
| 69 OwnPtr<HTMLTokenizer> m_tokenizer; | |
|
eseidel
2014/02/14 12:15:41
This seems wrong. Do other resources own a Tokeni
eseidel
2014/02/14 12:16:57
Why would each resource want its own tokenizer/sca
| |
| 70 OwnPtr<CSSPreloadScanner> m_preloadScanner; | |
| 71 OwnPtr<BackgroundHTMLInputStream> m_input; | |
| 72 OwnPtr<HTMLToken> m_token; | |
| 73 OwnPtr<HTMLResourcePreloader> m_preloader; | |
| 74 bool m_prescan; | |
| 62 }; | 75 }; |
| 63 | 76 |
| 64 DEFINE_RESOURCE_TYPE_CASTS(CSSStyleSheet); | 77 DEFINE_RESOURCE_TYPE_CASTS(CSSStyleSheet); |
| 65 | 78 |
| 66 } | 79 } |
| 67 | 80 |
| 68 #endif | 81 #endif |
| OLD | NEW |