| 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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 if (allowLoad) { | 341 if (allowLoad) { |
| 342 ThreadableLoaderOptions options; | 342 ThreadableLoaderOptions options; |
| 343 options.sniffContent = m_options.sniffContent ? SniffContent : DoNotSnif
fContent; | 343 options.sniffContent = m_options.sniffContent ? SniffContent : DoNotSnif
fContent; |
| 344 options.allowCredentials = m_options.allowCredentials ? AllowStoredCrede
ntials : DoNotAllowStoredCredentials; | 344 options.allowCredentials = m_options.allowCredentials ? AllowStoredCrede
ntials : DoNotAllowStoredCredentials; |
| 345 options.preflightPolicy = static_cast<WebCore::PreflightPolicy>(m_option
s.preflightPolicy); | 345 options.preflightPolicy = static_cast<WebCore::PreflightPolicy>(m_option
s.preflightPolicy); |
| 346 options.crossOriginRequestPolicy = static_cast<WebCore::CrossOriginReque
stPolicy>(m_options.crossOriginRequestPolicy); | 346 options.crossOriginRequestPolicy = static_cast<WebCore::CrossOriginReque
stPolicy>(m_options.crossOriginRequestPolicy); |
| 347 options.dataBufferingPolicy = DoNotBufferData; | 347 options.dataBufferingPolicy = DoNotBufferData; |
| 348 | 348 |
| 349 const ResourceRequest& webcoreRequest = newRequest.toResourceRequest(); | 349 const ResourceRequest& webcoreRequest = newRequest.toResourceRequest(); |
| 350 Document* webcoreDocument = m_frameImpl->frame()->document(); | 350 Document* webcoreDocument = m_frameImpl->frame()->document(); |
| 351 m_loader = DocumentThreadableLoader::create(webcoreDocument, m_clientAda
pter.get(), webcoreRequest, options); | 351 ASSERT(webcoreDocument); |
| 352 m_loader = DocumentThreadableLoader::create(*webcoreDocument, m_clientAd
apter.get(), webcoreRequest, options); |
| 352 } else { | 353 } else { |
| 353 // FIXME: return meaningful error codes. | 354 // FIXME: return meaningful error codes. |
| 354 m_clientAdapter->setDelayedError(ResourceError()); | 355 m_clientAdapter->setDelayedError(ResourceError()); |
| 355 } | 356 } |
| 356 m_clientAdapter->enableErrorNotifications(); | 357 m_clientAdapter->enableErrorNotifications(); |
| 357 } | 358 } |
| 358 | 359 |
| 359 void AssociatedURLLoader::cancel() | 360 void AssociatedURLLoader::cancel() |
| 360 { | 361 { |
| 361 if (m_clientAdapter) | 362 if (m_clientAdapter) |
| 362 m_clientAdapter->clearClient(); | 363 m_clientAdapter->clearClient(); |
| 363 if (m_loader) | 364 if (m_loader) |
| 364 m_loader->cancel(); | 365 m_loader->cancel(); |
| 365 } | 366 } |
| 366 | 367 |
| 367 void AssociatedURLLoader::setDefersLoading(bool defersLoading) | 368 void AssociatedURLLoader::setDefersLoading(bool defersLoading) |
| 368 { | 369 { |
| 369 if (m_loader) | 370 if (m_loader) |
| 370 m_loader->setDefersLoading(defersLoading); | 371 m_loader->setDefersLoading(defersLoading); |
| 371 } | 372 } |
| 372 | 373 |
| 373 } // namespace blink | 374 } // namespace blink |
| OLD | NEW |