Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Side by Side Diff: Source/web/AssociatedURLLoader.cpp

Issue 204983007: Make ThreadableLoader class to use references (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: review comments Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/xml/XMLHttpRequest.cpp ('k') | Source/web/WebEmbeddedWorkerImpl.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « Source/core/xml/XMLHttpRequest.cpp ('k') | Source/web/WebEmbeddedWorkerImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698