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) 2002 Waldo Bastian (bastian@kde.org) | 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) |
5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
6 Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. | 6 Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. |
7 | 7 |
8 This library is free software; you can redistribute it and/or | 8 This library is free software; you can redistribute it and/or |
9 modify it under the terms of the GNU Library General Public | 9 modify it under the terms of the GNU Library General Public |
10 License as published by the Free Software Foundation; either | 10 License as published by the Free Software Foundation; either |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 namespace blink { | 39 namespace blink { |
40 | 40 |
41 ResourcePtr<CSSStyleSheetResource> CSSStyleSheetResource::fetch(FetchRequest& re
quest, ResourceFetcher* fetcher) | 41 ResourcePtr<CSSStyleSheetResource> CSSStyleSheetResource::fetch(FetchRequest& re
quest, ResourceFetcher* fetcher) |
42 { | 42 { |
43 ASSERT(request.resourceRequest().frameType() == WebURLRequest::FrameTypeNone
); | 43 ASSERT(request.resourceRequest().frameType() == WebURLRequest::FrameTypeNone
); |
44 request.mutableResourceRequest().setRequestContext(WebURLRequest::RequestCon
textStyle); | 44 request.mutableResourceRequest().setRequestContext(WebURLRequest::RequestCon
textStyle); |
45 return toCSSStyleSheetResource(fetcher->requestResource(request, CSSStyleShe
etResourceFactory())); | 45 return toCSSStyleSheetResource(fetcher->requestResource(request, CSSStyleShe
etResourceFactory())); |
46 } | 46 } |
47 | 47 |
| 48 ResourcePtr<CSSStyleSheetResource> CSSStyleSheetResource::createForTest(const Re
sourceRequest& request, const String& charset) |
| 49 { |
| 50 return new CSSStyleSheetResource(request, charset); |
| 51 } |
| 52 |
48 CSSStyleSheetResource::CSSStyleSheetResource(const ResourceRequest& resourceRequ
est, const String& charset) | 53 CSSStyleSheetResource::CSSStyleSheetResource(const ResourceRequest& resourceRequ
est, const String& charset) |
49 : StyleSheetResource(resourceRequest, CSSStyleSheet, "text/css", charset) | 54 : StyleSheetResource(resourceRequest, CSSStyleSheet, "text/css", charset) |
50 { | 55 { |
51 DEFINE_STATIC_LOCAL(const AtomicString, acceptCSS, ("text/css,*/*;q=0.1", At
omicString::ConstructFromLiteral)); | 56 DEFINE_STATIC_LOCAL(const AtomicString, acceptCSS, ("text/css,*/*;q=0.1", At
omicString::ConstructFromLiteral)); |
52 | 57 |
53 // Prefer text/css but accept any type (dell.com serves a stylesheet | 58 // Prefer text/css but accept any type (dell.com serves a stylesheet |
54 // as text/html; see <http://bugs.webkit.org/show_bug.cgi?id=11451>). | 59 // as text/html; see <http://bugs.webkit.org/show_bug.cgi?id=11451>). |
55 setAccept(acceptCSS); | 60 setAccept(acceptCSS); |
56 } | 61 } |
57 | 62 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 | 184 |
180 if (m_parsedStyleSheetCache) | 185 if (m_parsedStyleSheetCache) |
181 m_parsedStyleSheetCache->removedFromMemoryCache(); | 186 m_parsedStyleSheetCache->removedFromMemoryCache(); |
182 m_parsedStyleSheetCache = sheet; | 187 m_parsedStyleSheetCache = sheet; |
183 m_parsedStyleSheetCache->addedToMemoryCache(); | 188 m_parsedStyleSheetCache->addedToMemoryCache(); |
184 | 189 |
185 setDecodedSize(m_parsedStyleSheetCache->estimatedSizeInBytes()); | 190 setDecodedSize(m_parsedStyleSheetCache->estimatedSizeInBytes()); |
186 } | 191 } |
187 | 192 |
188 } | 193 } |
OLD | NEW |