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

Side by Side Diff: third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResource.cpp

Issue 2741753003: Remove mutableResourceRequest() by FetchRequest::setRequestContext() (Closed)
Patch Set: fix Created 3 years, 9 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/resource/DocumentResource.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/resource/DocumentResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698