| 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 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 if (!memoryCache()->contains(this) || hasClientsOrObservers() || !m_revalida
tingRequest.isNull() || !m_loadFinishTime || !isSafeToUnlock()) | 575 if (!memoryCache()->contains(this) || hasClientsOrObservers() || !m_revalida
tingRequest.isNull() || !m_loadFinishTime || !isSafeToUnlock()) |
| 576 return false; | 576 return false; |
| 577 | 577 |
| 578 m_data->unlock(); | 578 m_data->unlock(); |
| 579 return true; | 579 return true; |
| 580 } | 580 } |
| 581 | 581 |
| 582 void Resource::responseReceived(const ResourceResponse& response, PassOwnPtr<Web
DataConsumerHandle>) | 582 void Resource::responseReceived(const ResourceResponse& response, PassOwnPtr<Web
DataConsumerHandle>) |
| 583 { | 583 { |
| 584 m_responseTimestamp = currentTime(); | 584 m_responseTimestamp = currentTime(); |
| 585 if (m_preloadDiscoveryTime) { |
| 586 int timeSinceDiscovery = static_cast<int>(1000 * (monotonicallyIncreasin
gTime() - m_preloadDiscoveryTime)); |
| 587 DEFINE_STATIC_LOCAL(CustomCountHistogram, preloadDiscoveryToFirstByteHis
togram, ("PreloadScanner.TTFB", 0, 10000, 50)); |
| 588 preloadDiscoveryToFirstByteHistogram.count(timeSinceDiscovery); |
| 589 } |
| 585 | 590 |
| 586 if (!m_revalidatingRequest.isNull()) { | 591 if (!m_revalidatingRequest.isNull()) { |
| 587 if (response.httpStatusCode() == 304) { | 592 if (response.httpStatusCode() == 304) { |
| 588 revalidationSucceeded(response); | 593 revalidationSucceeded(response); |
| 589 return; | 594 return; |
| 590 } | 595 } |
| 591 revalidationFailed(); | 596 revalidationFailed(); |
| 592 } | 597 } |
| 593 setResponse(response); | 598 setResponse(response); |
| 594 String encoding = response.textEncodingName(); | 599 String encoding = response.textEncodingName(); |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1129 case Resource::Media: | 1134 case Resource::Media: |
| 1130 return "Media"; | 1135 return "Media"; |
| 1131 case Resource::Manifest: | 1136 case Resource::Manifest: |
| 1132 return "Manifest"; | 1137 return "Manifest"; |
| 1133 } | 1138 } |
| 1134 ASSERT_NOT_REACHED(); | 1139 ASSERT_NOT_REACHED(); |
| 1135 return "Unknown"; | 1140 return "Unknown"; |
| 1136 } | 1141 } |
| 1137 | 1142 |
| 1138 } // namespace blink | 1143 } // namespace blink |
| OLD | NEW |