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

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

Issue 2417673003: Revert changes made to ImageResource memory accounting at crrev.com/2337733002 (Closed)
Patch Set: Created 4 years, 2 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) 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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 // As encoded image data can be created from m_image (see 417 // As encoded image data can be created from m_image (see
418 // ImageResource::resourceBuffer(), we don't have to keep m_data. Let's 418 // ImageResource::resourceBuffer(), we don't have to keep m_data. Let's
419 // clear this. As for the lifetimes of m_image and m_data, see this 419 // clear this. As for the lifetimes of m_image and m_data, see this
420 // document: 420 // document:
421 // https://docs.google.com/document/d/1v0yTAZ6wkqX2U_M6BNIGUJpM1s0TIw1Vsqpxo L7aciY/edit?usp=sharing 421 // https://docs.google.com/document/d/1v0yTAZ6wkqX2U_M6BNIGUJpM1s0TIw1Vsqpxo L7aciY/edit?usp=sharing
422 clearData(); 422 clearData();
423 } 423 }
424 Resource::finish(loadFinishTime); 424 Resource::finish(loadFinishTime);
425 } 425 }
426 426
427 void ImageResource::onMemoryDump(WebMemoryDumpLevelOfDetail levelOfDetail,
428 WebProcessMemoryDump* memoryDump) const {
429 Resource::onMemoryDump(levelOfDetail, memoryDump);
430 const String name = getMemoryDumpName() + "/encoded_data";
431 if (m_image && !m_image->isNull())
432 m_image->data()->onMemoryDump(name, memoryDump);
433 }
434
435 void ImageResource::error(const ResourceError& error) { 427 void ImageResource::error(const ResourceError& error) {
436 if (m_multipartParser) 428 if (m_multipartParser)
437 m_multipartParser->cancel(); 429 m_multipartParser->cancel();
438 clear(); 430 clear();
439 Resource::error(error); 431 Resource::error(error);
440 notifyObservers(); 432 notifyObservers();
441 } 433 }
442 434
443 void ImageResource::responseReceived( 435 void ImageResource::responseReceived(
444 const ResourceResponse& response, 436 const ResourceResponse& response,
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 return response().serviceWorkerResponseType() != 578 return response().serviceWorkerResponseType() !=
587 WebServiceWorkerResponseTypeOpaque; 579 WebServiceWorkerResponseTypeOpaque;
588 if (!getImage()->currentFrameHasSingleSecurityOrigin()) 580 if (!getImage()->currentFrameHasSingleSecurityOrigin())
589 return false; 581 return false;
590 if (passesAccessControlCheck(securityOrigin)) 582 if (passesAccessControlCheck(securityOrigin))
591 return true; 583 return true;
592 return !securityOrigin->taintsCanvas(response().url()); 584 return !securityOrigin->taintsCanvas(response().url());
593 } 585 }
594 586
595 } // namespace blink 587 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ImageResource.h ('k') | third_party/WebKit/Source/platform/SharedBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698