Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2010, 2011, 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 142 DCHECK(m_client); | 142 DCHECK(m_client); |
| 143 } | 143 } |
| 144 | 144 |
| 145 void AssociatedURLLoader::ClientAdapter::willFollowRedirect(ResourceRequest& new Request, const ResourceResponse& redirectResponse) | 145 void AssociatedURLLoader::ClientAdapter::willFollowRedirect(ResourceRequest& new Request, const ResourceResponse& redirectResponse) |
| 146 { | 146 { |
| 147 if (!m_client) | 147 if (!m_client) |
| 148 return; | 148 return; |
| 149 | 149 |
| 150 WrappedResourceRequest wrappedNewRequest(newRequest); | 150 WrappedResourceRequest wrappedNewRequest(newRequest); |
| 151 WrappedResourceResponse wrappedRedirectResponse(redirectResponse); | 151 WrappedResourceResponse wrappedRedirectResponse(redirectResponse); |
| 152 m_client->willFollowRedirect(m_loader, wrappedNewRequest, wrappedRedirectRes ponse); | 152 // FIXME: Set encodedDataLength |
|
kinuko
2016/06/28 15:35:08
Are you going to plumb this too? Do we need to pr
Adam Rice
2016/06/29 09:52:15
I'm not sure whether it is actually needed. I have
| |
| 153 m_client->willFollowRedirect(m_loader, wrappedNewRequest, wrappedRedirectRes ponse, 0); | |
| 153 } | 154 } |
| 154 | 155 |
| 155 void AssociatedURLLoader::ClientAdapter::didSendData(unsigned long long bytesSen t, unsigned long long totalBytesToBeSent) | 156 void AssociatedURLLoader::ClientAdapter::didSendData(unsigned long long bytesSen t, unsigned long long totalBytesToBeSent) |
| 156 { | 157 { |
| 157 if (!m_client) | 158 if (!m_client) |
| 158 return; | 159 return; |
| 159 | 160 |
| 160 m_client->didSendData(m_loader, bytesSent, totalBytesToBeSent); | 161 m_client->didSendData(m_loader, bytesSent, totalBytesToBeSent); |
| 161 } | 162 } |
| 162 | 163 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 201 m_client->didDownloadData(m_loader, dataLength, -1); | 202 m_client->didDownloadData(m_loader, dataLength, -1); |
| 202 } | 203 } |
| 203 | 204 |
| 204 void AssociatedURLLoader::ClientAdapter::didReceiveData(const char* data, unsign ed dataLength) | 205 void AssociatedURLLoader::ClientAdapter::didReceiveData(const char* data, unsign ed dataLength) |
| 205 { | 206 { |
| 206 if (!m_client) | 207 if (!m_client) |
| 207 return; | 208 return; |
| 208 | 209 |
| 209 CHECK_LE(dataLength, static_cast<unsigned>(std::numeric_limits<int>::max())) ; | 210 CHECK_LE(dataLength, static_cast<unsigned>(std::numeric_limits<int>::max())) ; |
| 210 | 211 |
| 211 m_client->didReceiveData(m_loader, data, dataLength, -1); | 212 m_client->didReceiveData(m_loader, data, dataLength, -1, dataLength); |
|
kinuko
2016/06/28 15:35:08
In this case we might be adding up -1 to the respo
Adam Rice
2016/06/29 09:52:15
It gets added to the encodedDataSize, but it is a
| |
| 212 } | 213 } |
| 213 | 214 |
| 214 void AssociatedURLLoader::ClientAdapter::didReceiveCachedMetadata(const char* da ta, int dataLength) | 215 void AssociatedURLLoader::ClientAdapter::didReceiveCachedMetadata(const char* da ta, int dataLength) |
| 215 { | 216 { |
| 216 if (!m_client) | 217 if (!m_client) |
| 217 return; | 218 return; |
| 218 | 219 |
| 219 m_client->didReceiveCachedMetadata(m_loader, data, dataLength); | 220 m_client->didReceiveCachedMetadata(m_loader, data, dataLength); |
| 220 } | 221 } |
| 221 | 222 |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 451 // there could be a WebURLLoader instance behind the | 452 // there could be a WebURLLoader instance behind the |
| 452 // DocumentThreadableLoader instance. So, for safety, we chose to just | 453 // DocumentThreadableLoader instance. So, for safety, we chose to just |
| 453 // crash here. | 454 // crash here. |
| 454 RELEASE_ASSERT(ThreadState::current()); | 455 RELEASE_ASSERT(ThreadState::current()); |
| 455 | 456 |
| 456 m_observer->dispose(); | 457 m_observer->dispose(); |
| 457 m_observer = nullptr; | 458 m_observer = nullptr; |
| 458 } | 459 } |
| 459 | 460 |
| 460 } // namespace blink | 461 } // namespace blink |
| OLD | NEW |