| 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, 2007, 2008 Apple Inc. All rights reserved. | 6 Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 } | 48 } |
| 49 | 49 |
| 50 XSLStyleSheetResource* XSLStyleSheetResource::fetchSynchronously(FetchRequest& r
equest, ResourceFetcher* fetcher) | 50 XSLStyleSheetResource* XSLStyleSheetResource::fetchSynchronously(FetchRequest& r
equest, ResourceFetcher* fetcher) |
| 51 { | 51 { |
| 52 applyXSLRequestProperties(request.mutableResourceRequest()); | 52 applyXSLRequestProperties(request.mutableResourceRequest()); |
| 53 request.mutableResourceRequest().setTimeoutInterval(10); | 53 request.mutableResourceRequest().setTimeoutInterval(10); |
| 54 ResourceLoaderOptions options(request.options()); | 54 ResourceLoaderOptions options(request.options()); |
| 55 options.synchronousPolicy = RequestSynchronously; | 55 options.synchronousPolicy = RequestSynchronously; |
| 56 request.setOptions(options); | 56 request.setOptions(options); |
| 57 XSLStyleSheetResource* resource = toXSLStyleSheetResource(fetcher->requestRe
source(request, XSLStyleSheetResourceFactory())); | 57 XSLStyleSheetResource* resource = toXSLStyleSheetResource(fetcher->requestRe
source(request, XSLStyleSheetResourceFactory())); |
| 58 if (resource && resource->m_data) | 58 if (resource && resource->data()) |
| 59 resource->m_sheet = resource->decodedText(); | 59 resource->m_sheet = resource->decodedText(); |
| 60 return resource; | 60 return resource; |
| 61 } | 61 } |
| 62 | 62 |
| 63 XSLStyleSheetResource* XSLStyleSheetResource::fetch(FetchRequest& request, Resou
rceFetcher* fetcher) | 63 XSLStyleSheetResource* XSLStyleSheetResource::fetch(FetchRequest& request, Resou
rceFetcher* fetcher) |
| 64 { | 64 { |
| 65 ASSERT(RuntimeEnabledFeatures::xsltEnabled()); | 65 ASSERT(RuntimeEnabledFeatures::xsltEnabled()); |
| 66 applyXSLRequestProperties(request.mutableResourceRequest()); | 66 applyXSLRequestProperties(request.mutableResourceRequest()); |
| 67 return toXSLStyleSheetResource(fetcher->requestResource(request, XSLStyleShe
etResourceFactory())); | 67 return toXSLStyleSheetResource(fetcher->requestResource(request, XSLStyleShe
etResourceFactory())); |
| 68 } | 68 } |
| 69 | 69 |
| 70 XSLStyleSheetResource::XSLStyleSheetResource(const ResourceRequest& resourceRequ
est, const ResourceLoaderOptions& options, const String& charset) | 70 XSLStyleSheetResource::XSLStyleSheetResource(const ResourceRequest& resourceRequ
est, const ResourceLoaderOptions& options, const String& charset) |
| 71 : StyleSheetResource(resourceRequest, XSLStyleSheet, options, "text/xsl", ch
arset) | 71 : StyleSheetResource(resourceRequest, XSLStyleSheet, options, "text/xsl", ch
arset) |
| 72 { | 72 { |
| 73 } | 73 } |
| 74 | 74 |
| 75 void XSLStyleSheetResource::didAddClient(ResourceClient* c) | 75 void XSLStyleSheetResource::didAddClient(ResourceClient* c) |
| 76 { | 76 { |
| 77 ASSERT(StyleSheetResourceClient::isExpectedType(c)); | 77 ASSERT(StyleSheetResourceClient::isExpectedType(c)); |
| 78 Resource::didAddClient(c); | 78 Resource::didAddClient(c); |
| 79 if (!isLoading()) | 79 if (!isLoading()) |
| 80 static_cast<StyleSheetResourceClient*>(c)->setXSLStyleSheet(resourceRequ
est().url(), response().url(), m_sheet); | 80 static_cast<StyleSheetResourceClient*>(c)->setXSLStyleSheet(resourceRequ
est().url(), response().url(), m_sheet); |
| 81 } | 81 } |
| 82 | 82 |
| 83 void XSLStyleSheetResource::checkNotify() | 83 void XSLStyleSheetResource::checkNotify() |
| 84 { | 84 { |
| 85 if (m_data.get()) | 85 if (data()) |
| 86 m_sheet = decodedText(); | 86 m_sheet = decodedText(); |
| 87 | 87 |
| 88 ResourceClientWalker<StyleSheetResourceClient> w(clients()); | 88 ResourceClientWalker<StyleSheetResourceClient> w(clients()); |
| 89 while (StyleSheetResourceClient* c = w.next()) | 89 while (StyleSheetResourceClient* c = w.next()) |
| 90 c->setXSLStyleSheet(resourceRequest().url(), response().url(), m_sheet); | 90 c->setXSLStyleSheet(resourceRequest().url(), response().url(), m_sheet); |
| 91 } | 91 } |
| 92 | 92 |
| 93 } // namespace blink | 93 } // namespace blink |
| OLD | NEW |