| 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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 ASSERT(!errorOccurred()); | 206 ASSERT(!errorOccurred()); |
| 207 if (m_options.dataBufferingPolicy == DoNotBufferData) | 207 if (m_options.dataBufferingPolicy == DoNotBufferData) |
| 208 return; | 208 return; |
| 209 if (m_data) | 209 if (m_data) |
| 210 m_data->append(data, length); | 210 m_data->append(data, length); |
| 211 else | 211 else |
| 212 m_data = SharedBuffer::create(data, length); | 212 m_data = SharedBuffer::create(data, length); |
| 213 setEncodedSize(m_data->size()); | 213 setEncodedSize(m_data->size()); |
| 214 } | 214 } |
| 215 | 215 |
| 216 void Resource::didDownloadData(int length) |
| 217 { |
| 218 setEncodedSize(encodedSize() + length); |
| 219 } |
| 220 |
| 216 void Resource::error(Resource::Status status) | 221 void Resource::error(Resource::Status status) |
| 217 { | 222 { |
| 218 if (m_resourceToRevalidate) | 223 if (m_resourceToRevalidate) |
| 219 revalidationFailed(); | 224 revalidationFailed(); |
| 220 | 225 |
| 221 if (!m_error.isNull() && (m_error.isCancellation() || !isPreloaded())) | 226 if (!m_error.isNull() && (m_error.isCancellation() || !isPreloaded())) |
| 222 memoryCache()->remove(this); | 227 memoryCache()->remove(this); |
| 223 | 228 |
| 224 setStatus(status); | 229 setStatus(status); |
| 225 ASSERT(errorOccurred()); | 230 ASSERT(errorOccurred()); |
| (...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 872 Vector<ResourcePtr<Resource> > resources; | 877 Vector<ResourcePtr<Resource> > resources; |
| 873 for (HashSet<Resource*>::iterator it = m_resourcesWithPendingClients.begin()
; it != end; ++it) | 878 for (HashSet<Resource*>::iterator it = m_resourcesWithPendingClients.begin()
; it != end; ++it) |
| 874 resources.append(*it); | 879 resources.append(*it); |
| 875 m_resourcesWithPendingClients.clear(); | 880 m_resourcesWithPendingClients.clear(); |
| 876 for (size_t i = 0; i < resources.size(); i++) | 881 for (size_t i = 0; i < resources.size(); i++) |
| 877 resources[i]->finishPendingClients(); | 882 resources[i]->finishPendingClients(); |
| 878 } | 883 } |
| 879 | 884 |
| 880 } | 885 } |
| 881 | 886 |
| OLD | NEW |