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

Side by Side Diff: Source/core/fetch/ImageResource.cpp

Issue 603903003: [Streams] Pass WebDataConsumerHandle when the response arrives. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@web-data-pipe
Patch Set: Created 6 years, 1 month 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/fetch/ImageResource.h ('k') | Source/core/fetch/ImageResourceTest.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) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de)
3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org)
4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org)
5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
6 Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 6 Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
7 7
8 This library is free software; you can redistribute it and/or 8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public 9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either 10 License as published by the Free Software Foundation; either
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 Resource::finishOnePart(); 407 Resource::finishOnePart();
408 } 408 }
409 409
410 void ImageResource::error(Resource::Status status) 410 void ImageResource::error(Resource::Status status)
411 { 411 {
412 clear(); 412 clear();
413 Resource::error(status); 413 Resource::error(status);
414 notifyObservers(); 414 notifyObservers();
415 } 415 }
416 416
417 void ImageResource::responseReceived(const ResourceResponse& response) 417 void ImageResource::responseReceived(const ResourceResponse& response, PassOwnPt r<WebDataConsumerHandle> handle)
418 { 418 {
419 if (m_loadingMultipartContent && m_data) 419 if (m_loadingMultipartContent && m_data)
420 finishOnePart(); 420 finishOnePart();
421 else if (response.isMultipart()) 421 else if (response.isMultipart())
422 m_loadingMultipartContent = true; 422 m_loadingMultipartContent = true;
423 if (RuntimeEnabledFeatures::clientHintsDprEnabled()) { 423 if (RuntimeEnabledFeatures::clientHintsDprEnabled()) {
424 m_devicePixelRatioHeaderValue = response.httpHeaderField("DPR").toFloat( &m_hasDevicePixelRatioHeaderValue); 424 m_devicePixelRatioHeaderValue = response.httpHeaderField("DPR").toFloat( &m_hasDevicePixelRatioHeaderValue);
425 if (!m_hasDevicePixelRatioHeaderValue || m_devicePixelRatioHeaderValue < = 0.0) { 425 if (!m_hasDevicePixelRatioHeaderValue || m_devicePixelRatioHeaderValue < = 0.0) {
426 m_devicePixelRatioHeaderValue = 1.0; 426 m_devicePixelRatioHeaderValue = 1.0;
427 m_hasDevicePixelRatioHeaderValue = false; 427 m_hasDevicePixelRatioHeaderValue = false;
428 } 428 }
429 } 429 }
430 Resource::responseReceived(response); 430 Resource::responseReceived(response, handle);
431 } 431 }
432 432
433 void ImageResource::decodedSizeChanged(const blink::Image* image, int delta) 433 void ImageResource::decodedSizeChanged(const blink::Image* image, int delta)
434 { 434 {
435 if (!image || image != m_image) 435 if (!image || image != m_image)
436 return; 436 return;
437 437
438 setDecodedSize(decodedSize() + delta); 438 setDecodedSize(decodedSize() + delta);
439 } 439 }
440 440
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 if (response().wasFetchedViaServiceWorker()) 490 if (response().wasFetchedViaServiceWorker())
491 return response().serviceWorkerResponseType() != WebServiceWorkerRespons eTypeOpaque; 491 return response().serviceWorkerResponseType() != WebServiceWorkerRespons eTypeOpaque;
492 if (!image()->currentFrameHasSingleSecurityOrigin()) 492 if (!image()->currentFrameHasSingleSecurityOrigin())
493 return false; 493 return false;
494 if (passesAccessControlCheck(securityOrigin)) 494 if (passesAccessControlCheck(securityOrigin))
495 return true; 495 return true;
496 return !securityOrigin->taintsCanvas(response().url()); 496 return !securityOrigin->taintsCanvas(response().url());
497 } 497 }
498 498
499 } // namespace blink 499 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/fetch/ImageResource.h ('k') | Source/core/fetch/ImageResourceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698