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

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

Issue 1264453002: Split the constructor of ThreadableLoader into two methods (ctor and start()) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed pipes around non-variables in a comment Created 4 years, 10 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 | « third_party/WebKit/Source/modules/fetch/FetchManager.cpp ('k') | no next file » | 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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 const ResourceRequest& webcoreRequest = newRequest.toResourceRequest(); 352 const ResourceRequest& webcoreRequest = newRequest.toResourceRequest();
353 if (webcoreRequest.requestContext() == WebURLRequest::RequestContextUnsp ecified) { 353 if (webcoreRequest.requestContext() == WebURLRequest::RequestContextUnsp ecified) {
354 // FIXME: We load URLs without setting a TargetType (and therefore a request context) in several 354 // FIXME: We load URLs without setting a TargetType (and therefore a request context) in several
355 // places in content/ (P2PPortAllocatorSession::AllocateLegacyRelayS ession, for example). Remove 355 // places in content/ (P2PPortAllocatorSession::AllocateLegacyRelayS ession, for example). Remove
356 // this once those places are patched up. 356 // this once those places are patched up.
357 newRequest.setRequestContext(WebURLRequest::RequestContextInternal); 357 newRequest.setRequestContext(WebURLRequest::RequestContextInternal);
358 } 358 }
359 359
360 Document* webcoreDocument = m_frameImpl->frame()->document(); 360 Document* webcoreDocument = m_frameImpl->frame()->document();
361 ASSERT(webcoreDocument); 361 ASSERT(webcoreDocument);
362 m_loader = DocumentThreadableLoader::create(*webcoreDocument, m_clientAd apter.get(), webcoreRequest, options, resourceLoaderOptions); 362 m_loader = DocumentThreadableLoader::create(*webcoreDocument, m_clientAd apter.get(), options, resourceLoaderOptions);
363 m_loader->start(webcoreRequest);
363 } 364 }
364 365
365 if (!m_loader) { 366 if (!m_loader) {
366 // FIXME: return meaningful error codes. 367 // FIXME: return meaningful error codes.
367 m_clientAdapter->setDelayedError(ResourceError()); 368 m_clientAdapter->setDelayedError(ResourceError());
368 } 369 }
369 m_clientAdapter->enableErrorNotifications(); 370 m_clientAdapter->enableErrorNotifications();
370 } 371 }
371 372
372 void AssociatedURLLoader::cancel() 373 void AssociatedURLLoader::cancel()
373 { 374 {
374 if (m_clientAdapter) 375 if (m_clientAdapter)
375 m_clientAdapter->clearClient(); 376 m_clientAdapter->clearClient();
376 if (m_loader) 377 if (m_loader)
377 m_loader->cancel(); 378 m_loader->cancel();
378 } 379 }
379 380
380 void AssociatedURLLoader::setDefersLoading(bool defersLoading) 381 void AssociatedURLLoader::setDefersLoading(bool defersLoading)
381 { 382 {
382 if (m_loader) 383 if (m_loader)
383 m_loader->setDefersLoading(defersLoading); 384 m_loader->setDefersLoading(defersLoading);
384 } 385 }
385 386
386 void AssociatedURLLoader::setLoadingTaskRunner(blink::WebTaskRunner*) 387 void AssociatedURLLoader::setLoadingTaskRunner(blink::WebTaskRunner*)
387 { 388 {
388 // TODO(alexclarke): Maybe support this one day if it proves worthwhile. 389 // TODO(alexclarke): Maybe support this one day if it proves worthwhile.
389 } 390 }
390 391
391 } // namespace blink 392 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/fetch/FetchManager.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698