| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. |
| 3 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 3 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 m_waitingForContentPolicy = true; | 316 m_waitingForContentPolicy = true; |
| 317 ref(); // balanced by deref in continueAfterContentPolicy and didCancel | 317 ref(); // balanced by deref in continueAfterContentPolicy and didCancel |
| 318 frameLoader()->checkContentPolicy(m_response.mimeType(), callContinueAfterCo
ntentPolicy, this); | 318 frameLoader()->checkContentPolicy(m_response.mimeType(), callContinueAfterCo
ntentPolicy, this); |
| 319 } | 319 } |
| 320 | 320 |
| 321 void MainResourceLoader::didReceiveData(const char* data, int length, long long
lengthReceived, bool allAtOnce) | 321 void MainResourceLoader::didReceiveData(const char* data, int length, long long
lengthReceived, bool allAtOnce) |
| 322 { | 322 { |
| 323 ASSERT(data); | 323 ASSERT(data); |
| 324 ASSERT(length != 0); | 324 ASSERT(length != 0); |
| 325 | 325 |
| 326 ASSERT(!m_response.isNull()); |
| 327 |
| 328 #if USE(CFNETWORK) || (PLATFORM(MAC) && !defined(BUILDING_ON_TIGER)) |
| 329 // Workaround for <rdar://problem/6060782> |
| 330 if (m_response.isNull()) { |
| 331 m_response = ResourceResponse(KURL(), "text/html", 0, String(), String()
); |
| 332 if (DocumentLoader* documentLoader = frameLoader()->activeDocumentLoader
()) |
| 333 documentLoader->setResponse(m_response); |
| 334 } |
| 335 #endif |
| 336 |
| 326 // There is a bug in CFNetwork where callbacks can be dispatched even when l
oads are deferred. | 337 // There is a bug in CFNetwork where callbacks can be dispatched even when l
oads are deferred. |
| 327 // See <rdar://problem/6304600> for more details. | 338 // See <rdar://problem/6304600> for more details. |
| 328 #if !PLATFORM(CF) | 339 #if !PLATFORM(CF) |
| 329 ASSERT(!defersLoading()); | 340 ASSERT(!defersLoading()); |
| 330 #endif | 341 #endif |
| 331 | 342 |
| 332 // The additional processing can do anything including possibly removing the
last | 343 // The additional processing can do anything including possibly removing the
last |
| 333 // reference to this object; one example of this is 3266216. | 344 // reference to this object; one example of this is 3266216. |
| 334 RefPtr<MainResourceLoader> protect(this); | 345 RefPtr<MainResourceLoader> protect(this); |
| 335 | 346 |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 m_dataLoadTimer.startOneShot(0); | 525 m_dataLoadTimer.startOneShot(0); |
| 515 else { | 526 else { |
| 516 ResourceRequest r(m_initialRequest); | 527 ResourceRequest r(m_initialRequest); |
| 517 m_initialRequest = ResourceRequest(); | 528 m_initialRequest = ResourceRequest(); |
| 518 loadNow(r); | 529 loadNow(r); |
| 519 } | 530 } |
| 520 } | 531 } |
| 521 } | 532 } |
| 522 | 533 |
| 523 } | 534 } |
| OLD | NEW |