| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2010, 2011 Apple Inc. All rights reserved. |
| 3 * (C) 2007 Graham Dennis (graham.dennis@gmail.com) | 3 * (C) 2007 Graham Dennis (graham.dennis@gmail.com) |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 | 231 |
| 232 void ResourceLoader::requestSynchronously(const ResourceRequest& request) | 232 void ResourceLoader::requestSynchronously(const ResourceRequest& request) |
| 233 { | 233 { |
| 234 // downloadToFile is not supported for synchronous requests. | 234 // downloadToFile is not supported for synchronous requests. |
| 235 ASSERT(!request.downloadToFile()); | 235 ASSERT(!request.downloadToFile()); |
| 236 ASSERT(m_loader); | 236 ASSERT(m_loader); |
| 237 DCHECK(request.priority() == ResourceLoadPriorityHighest); | 237 DCHECK(request.priority() == ResourceLoadPriorityHighest); |
| 238 | 238 |
| 239 WrappedResourceRequest requestIn(request); | 239 WrappedResourceRequest requestIn(request); |
| 240 WebURLResponse responseOut; | 240 WebURLResponse responseOut; |
| 241 responseOut.initialize(); | |
| 242 WebURLError errorOut; | 241 WebURLError errorOut; |
| 243 WebData dataOut; | 242 WebData dataOut; |
| 244 m_loader->loadSynchronously(requestIn, responseOut, errorOut, dataOut); | 243 m_loader->loadSynchronously(requestIn, responseOut, errorOut, dataOut); |
| 245 | 244 |
| 246 // A message dispatched while synchronously fetching the resource | 245 // A message dispatched while synchronously fetching the resource |
| 247 // can bring about the cancellation of this load. | 246 // can bring about the cancellation of this load. |
| 248 if (!m_loader) | 247 if (!m_loader) |
| 249 return; | 248 return; |
| 250 if (errorOut.reason) { | 249 if (errorOut.reason) { |
| 251 didFail(0, errorOut); | 250 didFail(0, errorOut); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 262 // empty buffer is a noop in most cases, but is destructive in the case of | 261 // empty buffer is a noop in most cases, but is destructive in the case of |
| 263 // a 304, where it will overwrite the cached data we should be reusing. | 262 // a 304, where it will overwrite the cached data we should be reusing. |
| 264 if (dataOut.size()) { | 263 if (dataOut.size()) { |
| 265 m_fetcher->didReceiveData(m_resource.get(), dataOut.data(), dataOut.size
(), encodedDataLength); | 264 m_fetcher->didReceiveData(m_resource.get(), dataOut.data(), dataOut.size
(), encodedDataLength); |
| 266 m_resource->setResourceBuffer(dataOut); | 265 m_resource->setResourceBuffer(dataOut); |
| 267 } | 266 } |
| 268 didFinishLoading(0, monotonicallyIncreasingTime(), encodedDataLength); | 267 didFinishLoading(0, monotonicallyIncreasingTime(), encodedDataLength); |
| 269 } | 268 } |
| 270 | 269 |
| 271 } // namespace blink | 270 } // namespace blink |
| OLD | NEW |