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

Side by Side Diff: third_party/WebKit/Source/core/loader/PingLoader.cpp

Issue 2807533003: [WIP2] off-main-thread loading
Patch Set: rebase Created 3 years, 7 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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 identifier_, passed_new_request.ToMutableResourceRequest(), 346 identifier_, passed_new_request.ToMutableResourceRequest(),
347 passed_redirect_response.ToResourceResponse(), initiator_info); 347 passed_redirect_response.ToResourceResponse(), initiator_info);
348 } 348 }
349 349
350 return true; 350 return true;
351 } 351 }
352 352
353 void PingLoaderImpl::DidReceiveResponse(const WebURLResponse& response) { 353 void PingLoaderImpl::DidReceiveResponse(const WebURLResponse& response) {
354 if (GetFrame()) { 354 if (GetFrame()) {
355 const ResourceResponse& resource_response = response.ToResourceResponse(); 355 const ResourceResponse& resource_response = response.ToResourceResponse();
356 probe::didReceiveResourceResponse(GetFrame(), identifier_, 0, 356 probe::didReceiveResourceResponse(GetFrame()->GetDocument(), identifier_, 0,
357 resource_response, 0); 357 resource_response, 0);
358 DidFailLoading(GetFrame()); 358 DidFailLoading(GetFrame());
359 } 359 }
360 Dispose(); 360 Dispose();
361 } 361 }
362 362
363 void PingLoaderImpl::DidReceiveData(const char*, int data_length) { 363 void PingLoaderImpl::DidReceiveData(const char*, int data_length) {
364 if (GetFrame()) 364 if (GetFrame())
365 DidFailLoading(GetFrame()); 365 DidFailLoading(GetFrame());
366 Dispose(); 366 Dispose();
(...skipping 17 matching lines...) Expand all
384 Dispose(); 384 Dispose();
385 } 385 }
386 386
387 void PingLoaderImpl::Timeout(TimerBase*) { 387 void PingLoaderImpl::Timeout(TimerBase*) {
388 if (GetFrame()) 388 if (GetFrame())
389 DidFailLoading(GetFrame()); 389 DidFailLoading(GetFrame());
390 Dispose(); 390 Dispose();
391 } 391 }
392 392
393 void PingLoaderImpl::DidFailLoading(LocalFrame* frame) { 393 void PingLoaderImpl::DidFailLoading(LocalFrame* frame) {
394 probe::didFailLoading(frame, identifier_, 394 probe::didFailLoading(frame->GetDocument(), identifier_,
395 ResourceError::CancelledError(url_)); 395 ResourceError::CancelledError(url_));
396 frame->Console().DidFailLoading(identifier_, 396 frame->Console().DidFailLoading(identifier_,
397 ResourceError::CancelledError(url_)); 397 ResourceError::CancelledError(url_));
398 } 398 }
399 399
400 DEFINE_TRACE(PingLoaderImpl) { 400 DEFINE_TRACE(PingLoaderImpl) {
401 ContextClient::Trace(visitor); 401 ContextClient::Trace(visitor);
402 } 402 }
403 403
404 void FinishPingRequestInitialization( 404 void FinishPingRequestInitialization(
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 bool PingLoader::SendBeacon(LocalFrame* frame, 590 bool PingLoader::SendBeacon(LocalFrame* frame,
591 int allowance, 591 int allowance,
592 const KURL& beacon_url, 592 const KURL& beacon_url,
593 Blob* data, 593 Blob* data,
594 size_t& beacon_size) { 594 size_t& beacon_size) {
595 BeaconBlob beacon(data); 595 BeaconBlob beacon(data);
596 return SendBeaconCommon(frame, allowance, beacon_url, beacon, beacon_size); 596 return SendBeaconCommon(frame, allowance, beacon_url, beacon, beacon_size);
597 } 597 }
598 598
599 } // namespace blink 599 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameLoader.cpp ('k') | third_party/WebKit/Source/core/loader/WorkerFetchContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698