| 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 23 matching lines...) Expand all Loading... |
| 34 #include "platform/loader/fetch/ResourceClientWalker.h" | 34 #include "platform/loader/fetch/ResourceClientWalker.h" |
| 35 #include "platform/loader/fetch/ResourceFetcher.h" | 35 #include "platform/loader/fetch/ResourceFetcher.h" |
| 36 #include "wtf/CurrentTime.h" | 36 #include "wtf/CurrentTime.h" |
| 37 | 37 |
| 38 namespace blink { | 38 namespace blink { |
| 39 | 39 |
| 40 CSSStyleSheetResource* CSSStyleSheetResource::fetch(FetchRequest& request, | 40 CSSStyleSheetResource* CSSStyleSheetResource::fetch(FetchRequest& request, |
| 41 ResourceFetcher* fetcher) { | 41 ResourceFetcher* fetcher) { |
| 42 DCHECK_EQ(request.resourceRequest().frameType(), | 42 DCHECK_EQ(request.resourceRequest().frameType(), |
| 43 WebURLRequest::FrameTypeNone); | 43 WebURLRequest::FrameTypeNone); |
| 44 request.mutableResourceRequest().setRequestContext( | 44 request.setRequestContext(WebURLRequest::RequestContextStyle); |
| 45 WebURLRequest::RequestContextStyle); | |
| 46 CSSStyleSheetResource* resource = toCSSStyleSheetResource( | 45 CSSStyleSheetResource* resource = toCSSStyleSheetResource( |
| 47 fetcher->requestResource(request, CSSStyleSheetResourceFactory())); | 46 fetcher->requestResource(request, CSSStyleSheetResourceFactory())); |
| 48 // TODO(kouhei): Dedupe this logic w/ ScriptResource::fetch | 47 // TODO(kouhei): Dedupe this logic w/ ScriptResource::fetch |
| 49 if (resource && !request.integrityMetadata().isEmpty()) | 48 if (resource && !request.integrityMetadata().isEmpty()) |
| 50 resource->setIntegrityMetadata(request.integrityMetadata()); | 49 resource->setIntegrityMetadata(request.integrityMetadata()); |
| 51 return resource; | 50 return resource; |
| 52 } | 51 } |
| 53 | 52 |
| 54 CSSStyleSheetResource* CSSStyleSheetResource::createForTest( | 53 CSSStyleSheetResource* CSSStyleSheetResource::createForTest( |
| 55 const ResourceRequest& request, | 54 const ResourceRequest& request, |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 } | 224 } |
| 226 | 225 |
| 227 void CSSStyleSheetResource::updateDecodedSize() { | 226 void CSSStyleSheetResource::updateDecodedSize() { |
| 228 size_t decodedSize = m_decodedSheetText.charactersSizeInBytes(); | 227 size_t decodedSize = m_decodedSheetText.charactersSizeInBytes(); |
| 229 if (m_parsedStyleSheetCache) | 228 if (m_parsedStyleSheetCache) |
| 230 decodedSize += m_parsedStyleSheetCache->estimatedSizeInBytes(); | 229 decodedSize += m_parsedStyleSheetCache->estimatedSizeInBytes(); |
| 231 setDecodedSize(decodedSize); | 230 setDecodedSize(decodedSize); |
| 232 } | 231 } |
| 233 | 232 |
| 234 } // namespace blink | 233 } // namespace blink |
| OLD | NEW |