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

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

Issue 2218013002: Ensure setEncodedSizeMemoryUsage() is called when |m_data| is cleared (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove setEncodedSizeMemoryUsage() Created 4 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
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 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 if (data()) 480 if (data())
481 updateImageAndClearBuffer(); 481 updateImageAndClearBuffer();
482 } else { 482 } else {
483 updateImage(true); 483 updateImage(true);
484 // As encoded image data can be created from m_image (see 484 // As encoded image data can be created from m_image (see
485 // ImageResource::resourceBuffer(), we don't have to keep m_data. Let's 485 // ImageResource::resourceBuffer(), we don't have to keep m_data. Let's
486 // clear this. As for the lifetimes of m_image and m_data, see this 486 // clear this. As for the lifetimes of m_image and m_data, see this
487 // document: 487 // document:
488 // https://docs.google.com/document/d/1v0yTAZ6wkqX2U_M6BNIGUJpM1s0TIw1Vsqpxo L7aciY/edit?usp=sharing 488 // https://docs.google.com/document/d/1v0yTAZ6wkqX2U_M6BNIGUJpM1s0TIw1Vsqpxo L7aciY/edit?usp=sharing
489 clearData(); 489 clearData();
490 setEncodedSizeMemoryUsage(0);
491 } 490 }
492 Resource::finish(loadFinishTime); 491 Resource::finish(loadFinishTime);
493 } 492 }
494 493
495 void ImageResource::error(const ResourceError& error) { 494 void ImageResource::error(const ResourceError& error) {
496 if (m_multipartParser) 495 if (m_multipartParser)
497 m_multipartParser->cancel(); 496 m_multipartParser->cancel();
498 clear(); 497 clear();
499 Resource::error(error); 498 Resource::error(error);
500 notifyObservers(); 499 notifyObservers();
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 WebServiceWorkerResponseTypeOpaque; 679 WebServiceWorkerResponseTypeOpaque;
681 } 680 }
682 if (!getImage()->currentFrameHasSingleSecurityOrigin()) 681 if (!getImage()->currentFrameHasSingleSecurityOrigin())
683 return false; 682 return false;
684 if (passesAccessControlCheck(securityOrigin)) 683 if (passesAccessControlCheck(securityOrigin))
685 return true; 684 return true;
686 return !securityOrigin->taintsCanvas(response().url()); 685 return !securityOrigin->taintsCanvas(response().url());
687 } 686 }
688 687
689 } // namespace blink 688 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.cpp ('k') | third_party/WebKit/Source/core/fetch/Resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698