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

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: Added layout test Created 5 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
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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 m_responseTimestamp = currentTime(); 438 m_responseTimestamp = currentTime();
439 String encoding = response.textEncodingName(); 439 String encoding = response.textEncodingName();
440 if (!encoding.isNull()) 440 if (!encoding.isNull())
441 setEncoding(encoding); 441 setEncoding(encoding);
442 442
443 if (m_loader) { 443 if (m_loader) {
444 ResourceFetcher* fetcher = ResourceFetcher::toResourceFetcher(m_loader-> host()); 444 ResourceFetcher* fetcher = ResourceFetcher::toResourceFetcher(m_loader-> host());
445 if (fetcher && fetcher->frame()) { 445 if (fetcher && fetcher->frame()) {
446 LinkLoader::loadLinkFromHeader(response.httpHeaderField("Link"), fet cher->frame()->document()); 446 LinkLoader::loadLinkFromHeader(response.httpHeaderField("Link"), fet cher->frame()->document());
447 if (RuntimeEnabledFeatures::clientHintsEnabled() && type() == Resour ce::MainResource) { 447 if (RuntimeEnabledFeatures::clientHintsEnabled() && type() == Resour ce::MainResource) {
448 String acceptCH = response.httpHeaderField("accept-ch").lower(); 448 CommaDelimitedHeaderSet acceptCH;
449 // FIXME: Write an actual parser for this comma delimited header . crbug.com/461741 449 parseCommaDelimitedHeader(response.httpHeaderField("accept-ch"), acceptCH);
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 | « LayoutTests/http/tests/misc/client-hints-invalid-accept.php ('k') | Source/platform/network/HTTPParsers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698