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

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

Issue 2337733002: [tracing] Support BACKGROUND mode in MemoryCache dump provider (Closed)
Patch Set: remove trace_event change. Created 4 years, 3 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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 // As encoded image data can be created from m_image (see 425 // As encoded image data can be created from m_image (see
426 // ImageResource::resourceBuffer(), we don't have to keep m_data. Let's 426 // ImageResource::resourceBuffer(), we don't have to keep m_data. Let's
427 // clear this. As for the lifetimes of m_image and m_data, see this 427 // clear this. As for the lifetimes of m_image and m_data, see this
428 // document: 428 // document:
429 // https://docs.google.com/document/d/1v0yTAZ6wkqX2U_M6BNIGUJpM1s0TIw1Vs qpxoL7aciY/edit?usp=sharing 429 // https://docs.google.com/document/d/1v0yTAZ6wkqX2U_M6BNIGUJpM1s0TIw1Vs qpxoL7aciY/edit?usp=sharing
430 clearData(); 430 clearData();
431 } 431 }
432 Resource::finish(loadFinishTime); 432 Resource::finish(loadFinishTime);
433 } 433 }
434 434
435 void ImageResource::onMemoryDump(WebMemoryDumpLevelOfDetail levelOfDetail, WebPr ocessMemoryDump* memoryDump) const
436 {
437 Resource::onMemoryDump(levelOfDetail, memoryDump);
438 const String name = getMemoryDumpName() + "/encoded_data";
439 if (m_image && !m_image->isNull())
440 m_image->data()->onMemoryDump(name, memoryDump);
441 }
442
435 void ImageResource::error(const ResourceError& error) 443 void ImageResource::error(const ResourceError& error)
436 { 444 {
437 if (m_multipartParser) 445 if (m_multipartParser)
438 m_multipartParser->cancel(); 446 m_multipartParser->cancel();
439 clear(); 447 clear();
440 Resource::error(error); 448 Resource::error(error);
441 notifyObservers(); 449 notifyObservers();
442 } 450 }
443 451
444 void ImageResource::responseReceived(const ResourceResponse& response, std::uniq ue_ptr<WebDataConsumerHandle> handle) 452 void ImageResource::responseReceived(const ResourceResponse& response, std::uniq ue_ptr<WebDataConsumerHandle> handle)
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 if (response().wasFetchedViaServiceWorker()) 593 if (response().wasFetchedViaServiceWorker())
586 return response().serviceWorkerResponseType() != WebServiceWorkerRespons eTypeOpaque; 594 return response().serviceWorkerResponseType() != WebServiceWorkerRespons eTypeOpaque;
587 if (!getImage()->currentFrameHasSingleSecurityOrigin()) 595 if (!getImage()->currentFrameHasSingleSecurityOrigin())
588 return false; 596 return false;
589 if (passesAccessControlCheck(securityOrigin)) 597 if (passesAccessControlCheck(securityOrigin))
590 return true; 598 return true;
591 return !securityOrigin->taintsCanvas(response().url()); 599 return !securityOrigin->taintsCanvas(response().url());
592 } 600 }
593 601
594 } // namespace blink 602 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ImageResource.h ('k') | third_party/WebKit/Source/core/fetch/MemoryCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698