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