OLD | NEW |
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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 setResponse(response); | 437 setResponse(response); |
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) { |
| 448 String acceptCH = response.httpHeaderField("accept-ch").lower(); |
| 449 // FIXME: Write an actual parser for this comma delimited header
. crbug.com/461741 |
| 450 if (acceptCH.contains("dpr")) |
| 451 fetcher->frame()->setShouldSendDPRHint(); |
| 452 if (acceptCH.contains("rw")) |
| 453 fetcher->frame()->setShouldSendRWHint(); |
| 454 } |
447 } | 455 } |
448 } | 456 } |
449 | 457 |
450 if (!m_resourceToRevalidate) | 458 if (!m_resourceToRevalidate) |
451 return; | 459 return; |
452 if (response.httpStatusCode() == 304) | 460 if (response.httpStatusCode() == 304) |
453 revalidationSucceeded(response); | 461 revalidationSucceeded(response); |
454 else | 462 else |
455 revalidationFailed(); | 463 revalidationFailed(); |
456 } | 464 } |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1073 return "ImportResource"; | 1081 return "ImportResource"; |
1074 case Resource::Media: | 1082 case Resource::Media: |
1075 return "Media"; | 1083 return "Media"; |
1076 } | 1084 } |
1077 ASSERT_NOT_REACHED(); | 1085 ASSERT_NOT_REACHED(); |
1078 return "Unknown"; | 1086 return "Unknown"; |
1079 } | 1087 } |
1080 #endif // !LOG_DISABLED | 1088 #endif // !LOG_DISABLED |
1081 | 1089 |
1082 } | 1090 } |
OLD | NEW |