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

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

Issue 1566653002: Revert of Fix null dereference on MemoryCache. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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) 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 26 matching lines...) Expand all
37 37
38 namespace blink { 38 namespace blink {
39 39
40 ResourcePtr<CSSStyleSheetResource> CSSStyleSheetResource::fetch(FetchRequest& re quest, ResourceFetcher* fetcher) 40 ResourcePtr<CSSStyleSheetResource> CSSStyleSheetResource::fetch(FetchRequest& re quest, ResourceFetcher* fetcher)
41 { 41 {
42 ASSERT(request.resourceRequest().frameType() == WebURLRequest::FrameTypeNone ); 42 ASSERT(request.resourceRequest().frameType() == WebURLRequest::FrameTypeNone );
43 request.mutableResourceRequest().setRequestContext(WebURLRequest::RequestCon textStyle); 43 request.mutableResourceRequest().setRequestContext(WebURLRequest::RequestCon textStyle);
44 return toCSSStyleSheetResource(fetcher->requestResource(request, CSSStyleShe etResourceFactory())); 44 return toCSSStyleSheetResource(fetcher->requestResource(request, CSSStyleShe etResourceFactory()));
45 } 45 }
46 46
47 ResourcePtr<CSSStyleSheetResource> CSSStyleSheetResource::createForTest(const Re sourceRequest& request, const String& charset)
48 {
49 return new CSSStyleSheetResource(request, charset);
50 }
51
52 CSSStyleSheetResource::CSSStyleSheetResource(const ResourceRequest& resourceRequ est, const String& charset) 47 CSSStyleSheetResource::CSSStyleSheetResource(const ResourceRequest& resourceRequ est, const String& charset)
53 : StyleSheetResource(resourceRequest, CSSStyleSheet, "text/css", charset) 48 : StyleSheetResource(resourceRequest, CSSStyleSheet, "text/css", charset)
54 { 49 {
55 DEFINE_STATIC_LOCAL(const AtomicString, acceptCSS, ("text/css,*/*;q=0.1", At omicString::ConstructFromLiteral)); 50 DEFINE_STATIC_LOCAL(const AtomicString, acceptCSS, ("text/css,*/*;q=0.1", At omicString::ConstructFromLiteral));
56 51
57 // Prefer text/css but accept any type (dell.com serves a stylesheet 52 // Prefer text/css but accept any type (dell.com serves a stylesheet
58 // as text/html; see <http://bugs.webkit.org/show_bug.cgi?id=11451>). 53 // as text/html; see <http://bugs.webkit.org/show_bug.cgi?id=11451>).
59 setAccept(acceptCSS); 54 setAccept(acceptCSS);
60 } 55 }
61 56
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 178
184 if (m_parsedStyleSheetCache) 179 if (m_parsedStyleSheetCache)
185 m_parsedStyleSheetCache->removedFromMemoryCache(); 180 m_parsedStyleSheetCache->removedFromMemoryCache();
186 m_parsedStyleSheetCache = sheet; 181 m_parsedStyleSheetCache = sheet;
187 m_parsedStyleSheetCache->addedToMemoryCache(); 182 m_parsedStyleSheetCache->addedToMemoryCache();
188 183
189 setDecodedSize(m_parsedStyleSheetCache->estimatedSizeInBytes()); 184 setDecodedSize(m_parsedStyleSheetCache->estimatedSizeInBytes());
190 } 185 }
191 186
192 } 187 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.h ('k') | third_party/WebKit/Source/core/fetch/MemoryCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698