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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 | 247 |
248 DEFINE_TRACE(Resource) | 248 DEFINE_TRACE(Resource) |
249 { | 249 { |
250 visitor->trace(m_loader); | 250 visitor->trace(m_loader); |
251 visitor->trace(m_cacheHandler); | 251 visitor->trace(m_cacheHandler); |
252 } | 252 } |
253 | 253 |
254 void Resource::load(ResourceFetcher* fetcher) | 254 void Resource::load(ResourceFetcher* fetcher) |
255 { | 255 { |
256 RELEASE_ASSERT(!m_loader); | 256 RELEASE_ASSERT(!m_loader); |
| 257 ASSERT(stillNeedsLoad()); |
257 m_status = Pending; | 258 m_status = Pending; |
258 | 259 |
259 ResourceRequest& request(m_revalidatingRequest.isNull() ? m_resourceRequest
: m_revalidatingRequest); | 260 ResourceRequest& request(m_revalidatingRequest.isNull() ? m_resourceRequest
: m_revalidatingRequest); |
260 KURL url = request.url(); | 261 KURL url = request.url(); |
261 request.setAllowStoredCredentials(m_options.allowCredentials == AllowStoredC
redentials); | 262 request.setAllowStoredCredentials(m_options.allowCredentials == AllowStoredC
redentials); |
262 | 263 |
263 m_loader = ResourceLoader::create(fetcher, this); | 264 m_loader = ResourceLoader::create(fetcher, this); |
264 m_loader->start(request); | 265 m_loader->start(request); |
265 // If the request reference is null (i.e., a synchronous revalidation will | 266 // If the request reference is null (i.e., a synchronous revalidation will |
266 // null the request), don't make the request non-null by setting the url. | 267 // 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... |
447 return currentAge(response, responseTimestamp) <= freshnessLifetime(response
, responseTimestamp); | 448 return currentAge(response, responseTimestamp) <= freshnessLifetime(response
, responseTimestamp); |
448 } | 449 } |
449 | 450 |
450 const ResourceRequest& Resource::lastResourceRequest() const | 451 const ResourceRequest& Resource::lastResourceRequest() const |
451 { | 452 { |
452 if (!m_redirectChain.size()) | 453 if (!m_redirectChain.size()) |
453 return m_resourceRequest; | 454 return m_resourceRequest; |
454 return m_redirectChain.last().m_request; | 455 return m_redirectChain.last().m_request; |
455 } | 456 } |
456 | 457 |
| 458 void Resource::setRevalidatingRequest(const ResourceRequest& request) |
| 459 { |
| 460 m_revalidatingRequest = request; |
| 461 m_status = NotStarted; |
| 462 } |
| 463 |
457 void Resource::willFollowRedirect(ResourceRequest& newRequest, const ResourceRes
ponse& redirectResponse) | 464 void Resource::willFollowRedirect(ResourceRequest& newRequest, const ResourceRes
ponse& redirectResponse) |
458 { | 465 { |
459 newRequest.setAllowStoredCredentials(m_options.allowCredentials == AllowStor
edCredentials); | 466 newRequest.setAllowStoredCredentials(m_options.allowCredentials == AllowStor
edCredentials); |
460 m_redirectChain.append(RedirectPair(newRequest, redirectResponse)); | 467 m_redirectChain.append(RedirectPair(newRequest, redirectResponse)); |
461 } | 468 } |
462 | 469 |
463 bool Resource::unlock() | 470 bool Resource::unlock() |
464 { | 471 { |
465 if (!m_data) | 472 if (!m_data) |
466 return false; | 473 return false; |
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1063 case Resource::Media: | 1070 case Resource::Media: |
1064 return "Media"; | 1071 return "Media"; |
1065 case Resource::Manifest: | 1072 case Resource::Manifest: |
1066 return "Manifest"; | 1073 return "Manifest"; |
1067 } | 1074 } |
1068 ASSERT_NOT_REACHED(); | 1075 ASSERT_NOT_REACHED(); |
1069 return "Unknown"; | 1076 return "Unknown"; |
1070 } | 1077 } |
1071 | 1078 |
1072 } // namespace blink | 1079 } // namespace blink |
OLD | NEW |