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

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

Issue 2060193002: Clear the SharedBuffer when clearing the image (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « no previous file | 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) 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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 ImageResourceObserverWalker walker(m_observers); 309 ImageResourceObserverWalker walker(m_observers);
310 while (auto* observer = walker.next()) { 310 while (auto* observer = walker.next()) {
311 observer->imageChanged(this, changeRect); 311 observer->imageChanged(this, changeRect);
312 } 312 }
313 } 313 }
314 314
315 void ImageResource::clear() 315 void ImageResource::clear()
316 { 316 {
317 prune(); 317 prune();
318 clearImage(); 318 clearImage();
319 m_data.clear();
319 setEncodedSize(0); 320 setEncodedSize(0);
320 } 321 }
321 322
322 inline void ImageResource::createImage() 323 inline void ImageResource::createImage()
323 { 324 {
324 // Create the image if it doesn't yet exist. 325 // Create the image if it doesn't yet exist.
325 if (m_image) 326 if (m_image)
326 return; 327 return;
327 328
328 if (m_response.mimeType() == "image/svg+xml") { 329 if (m_response.mimeType() == "image/svg+xml") {
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 if (response().wasFetchedViaServiceWorker()) 550 if (response().wasFetchedViaServiceWorker())
550 return response().serviceWorkerResponseType() != WebServiceWorkerRespons eTypeOpaque; 551 return response().serviceWorkerResponseType() != WebServiceWorkerRespons eTypeOpaque;
551 if (!getImage()->currentFrameHasSingleSecurityOrigin()) 552 if (!getImage()->currentFrameHasSingleSecurityOrigin())
552 return false; 553 return false;
553 if (passesAccessControlCheck(securityOrigin)) 554 if (passesAccessControlCheck(securityOrigin))
554 return true; 555 return true;
555 return !securityOrigin->taintsCanvas(response().url()); 556 return !securityOrigin->taintsCanvas(response().url());
556 } 557 }
557 558
558 } // namespace blink 559 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698