Chromium Code Reviews| 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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 250 | 250 |
| 251 DEFINE_TRACE(Resource) | 251 DEFINE_TRACE(Resource) |
| 252 { | 252 { |
| 253 visitor->trace(m_loader); | 253 visitor->trace(m_loader); |
| 254 visitor->trace(m_cacheHandler); | 254 visitor->trace(m_cacheHandler); |
| 255 } | 255 } |
| 256 | 256 |
| 257 void Resource::load(ResourceFetcher* fetcher) | 257 void Resource::load(ResourceFetcher* fetcher) |
| 258 { | 258 { |
| 259 RELEASE_ASSERT(!m_loader); | 259 RELEASE_ASSERT(!m_loader); |
| 260 ASSERT(stillNeedsLoad()); | |
|
Nate Chapin
2016/04/07 23:46:16
The changes to ImageResource were to facilitate th
| |
| 260 m_status = Pending; | 261 m_status = Pending; |
| 261 | 262 |
| 262 ResourceRequest& request(m_revalidatingRequest.isNull() ? m_resourceRequest : m_revalidatingRequest); | 263 ResourceRequest& request(m_revalidatingRequest.isNull() ? m_resourceRequest : m_revalidatingRequest); |
| 263 KURL url = request.url(); | 264 KURL url = request.url(); |
| 264 request.setAllowStoredCredentials(m_options.allowCredentials == AllowStoredC redentials); | 265 request.setAllowStoredCredentials(m_options.allowCredentials == AllowStoredC redentials); |
| 265 | 266 |
| 266 m_loader = ResourceLoader::create(fetcher, this); | 267 m_loader = ResourceLoader::create(fetcher, this); |
| 267 m_loader->start(request); | 268 m_loader->start(request); |
| 268 // If the request reference is null (i.e., a synchronous revalidation will | 269 // If the request reference is null (i.e., a synchronous revalidation will |
| 269 // null the request), don't make the request non-null by setting the url. | 270 // null the request), don't make the request non-null by setting the url. |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 450 return currentAge(response, responseTimestamp) <= freshnessLifetime(response , responseTimestamp); | 451 return currentAge(response, responseTimestamp) <= freshnessLifetime(response , responseTimestamp); |
| 451 } | 452 } |
| 452 | 453 |
| 453 const ResourceRequest& Resource::lastResourceRequest() const | 454 const ResourceRequest& Resource::lastResourceRequest() const |
| 454 { | 455 { |
| 455 if (!m_redirectChain.size()) | 456 if (!m_redirectChain.size()) |
| 456 return m_resourceRequest; | 457 return m_resourceRequest; |
| 457 return m_redirectChain.last().m_request; | 458 return m_redirectChain.last().m_request; |
| 458 } | 459 } |
| 459 | 460 |
| 461 void Resource::setRevalidatingRequest(const ResourceRequest& request) | |
| 462 { | |
| 463 m_revalidatingRequest = request; | |
| 464 m_status = NotStarted; | |
|
Nate Chapin
2016/04/07 23:46:16
Also to enable the ASSERT in Resource::load
| |
| 465 } | |
| 466 | |
| 460 void Resource::willFollowRedirect(ResourceRequest& newRequest, const ResourceRes ponse& redirectResponse) | 467 void Resource::willFollowRedirect(ResourceRequest& newRequest, const ResourceRes ponse& redirectResponse) |
| 461 { | 468 { |
| 462 newRequest.setAllowStoredCredentials(m_options.allowCredentials == AllowStor edCredentials); | 469 newRequest.setAllowStoredCredentials(m_options.allowCredentials == AllowStor edCredentials); |
| 463 m_redirectChain.append(RedirectPair(newRequest, redirectResponse)); | 470 m_redirectChain.append(RedirectPair(newRequest, redirectResponse)); |
| 464 } | 471 } |
| 465 | 472 |
| 466 bool Resource::unlock() | 473 bool Resource::unlock() |
| 467 { | 474 { |
| 468 if (!m_data) | 475 if (!m_data) |
| 469 return false; | 476 return false; |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1075 case Resource::Media: | 1082 case Resource::Media: |
| 1076 return "Media"; | 1083 return "Media"; |
| 1077 case Resource::Manifest: | 1084 case Resource::Manifest: |
| 1078 return "Manifest"; | 1085 return "Manifest"; |
| 1079 } | 1086 } |
| 1080 ASSERT_NOT_REACHED(); | 1087 ASSERT_NOT_REACHED(); |
| 1081 return "Unknown"; | 1088 return "Unknown"; |
| 1082 } | 1089 } |
| 1083 | 1090 |
| 1084 } // namespace blink | 1091 } // namespace blink |
| OLD | NEW |