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

Side by Side Diff: third_party/WebKit/Source/core/fetch/ResourceLoader.cpp

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2010, 2011 Apple Inc. All rights reserved.
3 * (C) 2007 Graham Dennis (graham.dennis@gmail.com) 3 * (C) 2007 Graham Dennis (graham.dennis@gmail.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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 m_defersLoading = defers; 171 m_defersLoading = defers;
172 if (m_loader) 172 if (m_loader)
173 m_loader->setDefersLoading(defers); 173 m_loader->setDefersLoading(defers);
174 if (!defers && !m_deferredRequest.isNull()) { 174 if (!defers && !m_deferredRequest.isNull()) {
175 m_request = applyOptions(m_deferredRequest); 175 m_request = applyOptions(m_deferredRequest);
176 m_deferredRequest = ResourceRequest(); 176 m_deferredRequest = ResourceRequest();
177 start(); 177 start();
178 } 178 }
179 } 179 }
180 180
181 void ResourceLoader::attachThreadedDataReceiver(PassRefPtrWillBeRawPtr<ThreadedD ataReceiver> threadedDataReceiver) 181 void ResourceLoader::attachThreadedDataReceiver(RawPtr<ThreadedDataReceiver> thr eadedDataReceiver)
182 { 182 {
183 if (m_loader) { 183 if (m_loader) {
184 // The implementor of the WebURLLoader assumes ownership of the 184 // The implementor of the WebURLLoader assumes ownership of the
185 // threaded data receiver if it signals that it got successfully 185 // threaded data receiver if it signals that it got successfully
186 // attached. 186 // attached.
187 WebThreadedDataReceiver* webDataReceiver = new WebThreadedDataReceiver(t hreadedDataReceiver); 187 WebThreadedDataReceiver* webDataReceiver = new WebThreadedDataReceiver(t hreadedDataReceiver);
188 if (!m_loader->attachThreadedDataReceiver(webDataReceiver)) 188 if (!m_loader->attachThreadedDataReceiver(webDataReceiver))
189 delete webDataReceiver; 189 delete webDataReceiver;
190 } 190 }
191 } 191 }
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 423
424 void ResourceLoader::didFinishLoading(WebURLLoader*, double finishTime, int64_t encodedDataLength) 424 void ResourceLoader::didFinishLoading(WebURLLoader*, double finishTime, int64_t encodedDataLength)
425 { 425 {
426 RELEASE_ASSERT(m_connectionState == ConnectionStateReceivedResponse || m_con nectionState == ConnectionStateReceivingData); 426 RELEASE_ASSERT(m_connectionState == ConnectionStateReceivedResponse || m_con nectionState == ConnectionStateReceivingData);
427 m_connectionState = ConnectionStateFinishedLoading; 427 m_connectionState = ConnectionStateFinishedLoading;
428 if (m_state != Initialized) 428 if (m_state != Initialized)
429 return; 429 return;
430 ASSERT(m_state != Terminated); 430 ASSERT(m_state != Terminated);
431 WTF_LOG(ResourceLoading, "Received '%s'.", m_resource->url().string().latin1 ().data()); 431 WTF_LOG(ResourceLoading, "Received '%s'.", m_resource->url().string().latin1 ().data());
432 432
433 RefPtrWillBeRawPtr<Resource> protectResource(m_resource.get()); 433 RawPtr<Resource> protectResource(m_resource.get());
434 m_state = Finishing; 434 m_state = Finishing;
435 m_resource->setLoadFinishTime(finishTime); 435 m_resource->setLoadFinishTime(finishTime);
436 didFinishLoadingOnePart(finishTime, encodedDataLength); 436 didFinishLoadingOnePart(finishTime, encodedDataLength);
437 if (m_state == Terminated) 437 if (m_state == Terminated)
438 return; 438 return;
439 m_resource->finish(); 439 m_resource->finish();
440 440
441 // If the load has been cancelled by a delegate in response to didFinishLoad (), do not release 441 // If the load has been cancelled by a delegate in response to didFinishLoad (), do not release
442 // the resources a second time, they have been released by cancel. 442 // the resources a second time, they have been released by cancel.
443 if (m_state == Terminated) 443 if (m_state == Terminated)
444 return; 444 return;
445 releaseResources(); 445 releaseResources();
446 } 446 }
447 447
448 void ResourceLoader::didFail(WebURLLoader*, const WebURLError& error) 448 void ResourceLoader::didFail(WebURLLoader*, const WebURLError& error)
449 { 449 {
450 m_connectionState = ConnectionStateFailed; 450 m_connectionState = ConnectionStateFailed;
451 ASSERT(m_state != Terminated); 451 ASSERT(m_state != Terminated);
452 WTF_LOG(ResourceLoading, "Failed to load '%s'.\n", m_resource->url().string( ).latin1().data()); 452 WTF_LOG(ResourceLoading, "Failed to load '%s'.\n", m_resource->url().string( ).latin1().data());
453 453
454 RefPtrWillBeRawPtr<Resource> protectResource(m_resource.get()); 454 RawPtr<Resource> protectResource(m_resource.get());
455 m_state = Finishing; 455 m_state = Finishing;
456 m_resource->setResourceError(error); 456 m_resource->setResourceError(error);
457 457
458 if (!m_notifiedLoadComplete) { 458 if (!m_notifiedLoadComplete) {
459 m_notifiedLoadComplete = true; 459 m_notifiedLoadComplete = true;
460 m_fetcher->didFailLoading(m_resource.get(), error); 460 m_fetcher->didFailLoading(m_resource.get(), error);
461 } 461 }
462 if (m_state == Terminated) 462 if (m_state == Terminated)
463 return; 463 return;
464 464
(...skipping 11 matching lines...) Expand all
476 } 476 }
477 477
478 void ResourceLoader::requestSynchronously() 478 void ResourceLoader::requestSynchronously()
479 { 479 {
480 OwnPtr<WebURLLoader> loader = adoptPtr(Platform::current()->createURLLoader( )); 480 OwnPtr<WebURLLoader> loader = adoptPtr(Platform::current()->createURLLoader( ));
481 ASSERT(loader); 481 ASSERT(loader);
482 482
483 // downloadToFile is not supported for synchronous requests. 483 // downloadToFile is not supported for synchronous requests.
484 ASSERT(!m_request.downloadToFile()); 484 ASSERT(!m_request.downloadToFile());
485 485
486 RefPtrWillBeRawPtr<Resource> protectResource(m_resource.get()); 486 RawPtr<Resource> protectResource(m_resource.get());
487 487
488 RELEASE_ASSERT(m_connectionState == ConnectionStateNew); 488 RELEASE_ASSERT(m_connectionState == ConnectionStateNew);
489 m_connectionState = ConnectionStateStarted; 489 m_connectionState = ConnectionStateStarted;
490 490
491 WrappedResourceRequest requestIn(m_request); 491 WrappedResourceRequest requestIn(m_request);
492 WebURLResponse responseOut; 492 WebURLResponse responseOut;
493 responseOut.initialize(); 493 responseOut.initialize();
494 WebURLError errorOut; 494 WebURLError errorOut;
495 WebData dataOut; 495 WebData dataOut;
496 loader->loadSynchronously(requestIn, responseOut, errorOut, dataOut); 496 loader->loadSynchronously(requestIn, responseOut, errorOut, dataOut);
(...skipping 24 matching lines...) Expand all
521 didFinishLoading(0, monotonicallyIncreasingTime(), encodedDataLength); 521 didFinishLoading(0, monotonicallyIncreasingTime(), encodedDataLength);
522 } 522 }
523 523
524 ResourceRequest& ResourceLoader::applyOptions(ResourceRequest& request) const 524 ResourceRequest& ResourceLoader::applyOptions(ResourceRequest& request) const
525 { 525 {
526 request.setAllowStoredCredentials(m_options.allowCredentials == AllowStoredC redentials); 526 request.setAllowStoredCredentials(m_options.allowCredentials == AllowStoredC redentials);
527 return request; 527 return request;
528 } 528 }
529 529
530 } // namespace blink 530 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698