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

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

Issue 1844223002: Literal AtomicString construction can rely on strlen optimization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 } 45 }
46 46
47 PassRefPtrWillBeRawPtr<CSSStyleSheetResource> CSSStyleSheetResource::createForTe st(const ResourceRequest& request, const String& charset) 47 PassRefPtrWillBeRawPtr<CSSStyleSheetResource> CSSStyleSheetResource::createForTe st(const ResourceRequest& request, const String& charset)
48 { 48 {
49 return adoptRefWillBeNoop(new CSSStyleSheetResource(request, ResourceLoaderO ptions(), charset)); 49 return adoptRefWillBeNoop(new CSSStyleSheetResource(request, ResourceLoaderO ptions(), charset));
50 } 50 }
51 51
52 CSSStyleSheetResource::CSSStyleSheetResource(const ResourceRequest& resourceRequ est, const ResourceLoaderOptions& options, const String& charset) 52 CSSStyleSheetResource::CSSStyleSheetResource(const ResourceRequest& resourceRequ est, const ResourceLoaderOptions& options, const String& charset)
53 : StyleSheetResource(resourceRequest, CSSStyleSheet, options, "text/css", ch arset) 53 : StyleSheetResource(resourceRequest, CSSStyleSheet, options, "text/css", ch arset)
54 { 54 {
55 DEFINE_STATIC_LOCAL(const AtomicString, acceptCSS, ("text/css,*/*;q=0.1", At omicString::ConstructFromLiteral)); 55 DEFINE_STATIC_LOCAL(const AtomicString, acceptCSS, ("text/css,*/*;q=0.1"));
56 56
57 // Prefer text/css but accept any type (dell.com serves a stylesheet 57 // 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>). 58 // as text/html; see <http://bugs.webkit.org/show_bug.cgi?id=11451>).
59 setAccept(acceptCSS); 59 setAccept(acceptCSS);
60 } 60 }
61 61
62 CSSStyleSheetResource::~CSSStyleSheetResource() 62 CSSStyleSheetResource::~CSSStyleSheetResource()
63 { 63 {
64 } 64 }
65 65
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 182
183 setDecodedSize(m_parsedStyleSheetCache->estimatedSizeInBytes()); 183 setDecodedSize(m_parsedStyleSheetCache->estimatedSizeInBytes());
184 184
185 // Check if this stylesheet resource didn't conflict with 185 // Check if this stylesheet resource didn't conflict with
186 // another resource and has indeed been added to the cache. 186 // another resource and has indeed been added to the cache.
187 if (memoryCache()->contains(this)) 187 if (memoryCache()->contains(this))
188 m_parsedStyleSheetCache->addedToMemoryCache(); 188 m_parsedStyleSheetCache->addedToMemoryCache();
189 } 189 }
190 190
191 } // namespace blink 191 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698