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

Side by Side Diff: Source/core/fetch/Resource.cpp

Issue 961773002: Add a comma delimited syntax parser and use it for Accept-CH (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed useless constructor Created 5 years, 10 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, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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 17 matching lines...) Expand all
28 #include "core/fetch/CachedMetadata.h" 28 #include "core/fetch/CachedMetadata.h"
29 #include "core/fetch/CrossOriginAccessControl.h" 29 #include "core/fetch/CrossOriginAccessControl.h"
30 #include "core/fetch/MemoryCache.h" 30 #include "core/fetch/MemoryCache.h"
31 #include "core/fetch/ResourceClient.h" 31 #include "core/fetch/ResourceClient.h"
32 #include "core/fetch/ResourceClientWalker.h" 32 #include "core/fetch/ResourceClientWalker.h"
33 #include "core/fetch/ResourceFetcher.h" 33 #include "core/fetch/ResourceFetcher.h"
34 #include "core/fetch/ResourceLoader.h" 34 #include "core/fetch/ResourceLoader.h"
35 #include "core/fetch/ResourcePtr.h" 35 #include "core/fetch/ResourcePtr.h"
36 #include "core/inspector/InspectorInstrumentation.h" 36 #include "core/inspector/InspectorInstrumentation.h"
37 #include "core/loader/LinkLoader.h" 37 #include "core/loader/LinkLoader.h"
38 #include "platform/CommaDelimitedParser.h"
38 #include "platform/Logging.h" 39 #include "platform/Logging.h"
39 #include "platform/SharedBuffer.h" 40 #include "platform/SharedBuffer.h"
40 #include "platform/TraceEvent.h" 41 #include "platform/TraceEvent.h"
41 #include "platform/weborigin/KURL.h" 42 #include "platform/weborigin/KURL.h"
42 #include "public/platform/Platform.h" 43 #include "public/platform/Platform.h"
43 #include "wtf/CurrentTime.h" 44 #include "wtf/CurrentTime.h"
44 #include "wtf/MathExtras.h" 45 #include "wtf/MathExtras.h"
45 #include "wtf/RefCountedLeakCounter.h" 46 #include "wtf/RefCountedLeakCounter.h"
46 #include "wtf/StdLibExtras.h" 47 #include "wtf/StdLibExtras.h"
47 #include "wtf/Vector.h" 48 #include "wtf/Vector.h"
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 m_responseTimestamp = currentTime(); 439 m_responseTimestamp = currentTime();
439 String encoding = response.textEncodingName(); 440 String encoding = response.textEncodingName();
440 if (!encoding.isNull()) 441 if (!encoding.isNull())
441 setEncoding(encoding); 442 setEncoding(encoding);
442 443
443 if (m_loader) { 444 if (m_loader) {
444 ResourceFetcher* fetcher = ResourceFetcher::toResourceFetcher(m_loader-> host()); 445 ResourceFetcher* fetcher = ResourceFetcher::toResourceFetcher(m_loader-> host());
445 if (fetcher && fetcher->frame()) { 446 if (fetcher && fetcher->frame()) {
446 LinkLoader::loadLinkFromHeader(response.httpHeaderField("Link"), fet cher->frame()->document()); 447 LinkLoader::loadLinkFromHeader(response.httpHeaderField("Link"), fet cher->frame()->document());
447 if (RuntimeEnabledFeatures::clientHintsEnabled() && type() == Resour ce::MainResource) { 448 if (RuntimeEnabledFeatures::clientHintsEnabled() && type() == Resour ce::MainResource) {
448 String acceptCH = response.httpHeaderField("accept-ch").lower(); 449 CommaDelimitedParser acceptCH(response.httpHeaderField("accept-c h").lower());
449 // FIXME: Write an actual parser for this comma delimited header . crbug.com/461741
450 if (acceptCH.contains("dpr")) 450 if (acceptCH.contains("dpr"))
451 fetcher->frame()->setShouldSendDPRHint(); 451 fetcher->frame()->setShouldSendDPRHint();
452 if (acceptCH.contains("rw")) 452 if (acceptCH.contains("rw"))
453 fetcher->frame()->setShouldSendRWHint(); 453 fetcher->frame()->setShouldSendRWHint();
454 } 454 }
455 } 455 }
456 } 456 }
457 457
458 if (!m_resourceToRevalidate) 458 if (!m_resourceToRevalidate)
459 return; 459 return;
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
1081 return "ImportResource"; 1081 return "ImportResource";
1082 case Resource::Media: 1082 case Resource::Media:
1083 return "Media"; 1083 return "Media";
1084 } 1084 }
1085 ASSERT_NOT_REACHED(); 1085 ASSERT_NOT_REACHED();
1086 return "Unknown"; 1086 return "Unknown";
1087 } 1087 }
1088 #endif // !LOG_DISABLED 1088 #endif // !LOG_DISABLED
1089 1089
1090 } 1090 }
OLDNEW
« no previous file with comments | « no previous file | Source/platform/CommaDelimitedParser.h » ('j') | Source/platform/CommaDelimitedParser.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698