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

Side by Side Diff: third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.h

Issue 2290983003: CSSStyleSheetResource should cache decoded text instead of raw bytes (Closed)
Patch Set: Created 4 years, 3 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 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2010 Google Inc. All Rights Reserved. 3 * Copyright (C) 2010 Google Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 }; 86 };
87 87
88 // Each CSSPreloaderResourceClient keeps track of a single CSS resource, and 88 // Each CSSPreloaderResourceClient keeps track of a single CSS resource, and
89 // drives a CSSPreloadScanner as raw data arrives for it. This lets us preload 89 // drives a CSSPreloadScanner as raw data arrives for it. This lets us preload
90 // @import tags before parsing. 90 // @import tags before parsing.
91 class CORE_EXPORT CSSPreloaderResourceClient : public GarbageCollectedFinalized< CSSPreloaderResourceClient>, public ResourceOwner<CSSStyleSheetResource, StyleSh eetResourceClient> { 91 class CORE_EXPORT CSSPreloaderResourceClient : public GarbageCollectedFinalized< CSSPreloaderResourceClient>, public ResourceOwner<CSSStyleSheetResource, StyleSh eetResourceClient> {
92 USING_GARBAGE_COLLECTED_MIXIN(CSSPreloaderResourceClient); 92 USING_GARBAGE_COLLECTED_MIXIN(CSSPreloaderResourceClient);
93 public: 93 public:
94 CSSPreloaderResourceClient(Resource*, HTMLResourcePreloader*); 94 CSSPreloaderResourceClient(Resource*, HTMLResourcePreloader*);
95 ~CSSPreloaderResourceClient(); 95 ~CSSPreloaderResourceClient();
96 void setCSSStyleSheet(const String& href, const KURL& baseURL, const String& charset, const CSSStyleSheetResource*) override; 96 void setCSSStyleSheet(const String& href, const KURL& baseURL, const String& charset, CSSStyleSheetResource*) override;
97 void didAppendFirstData(const CSSStyleSheetResource*) override; 97 void didAppendFirstData(const CSSStyleSheetResource*) override;
98 String debugName() const override { return "CSSPreloaderResourceClient"; } 98 String debugName() const override { return "CSSPreloaderResourceClient"; }
99 99
100 DECLARE_TRACE(); 100 DECLARE_TRACE();
101 101
102 protected: 102 protected:
103 // Protected for tests, which don't want to initialize a fully featured 103 // Protected for tests, which don't want to initialize a fully featured
104 // DocumentLoader. 104 // DocumentLoader.
105 virtual void fetchPreloads(PreloadRequestStream& preloads); 105 virtual void fetchPreloads(PreloadRequestStream& preloads);
106 106
107 private: 107 private:
108 void scanCSS(const CSSStyleSheetResource*); 108 void scanCSS(const CSSStyleSheetResource*);
109 109
110 WeakMember<HTMLResourcePreloader> m_preloader; 110 WeakMember<HTMLResourcePreloader> m_preloader;
111 }; 111 };
112 112
113 } // namespace blink 113 } // namespace blink
114 114
115 #endif 115 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698