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

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

Issue 2220543002: Make Resource::resourceBuffer() to return PassRefPtr<const SharedBuffer> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@WTF_UseIsConvertibleInEnsure
Patch Set: Rebase 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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 if (!ThreadHeap::willObjectBeLazilySwept(this)) 224 if (!ThreadHeap::willObjectBeLazilySwept(this))
225 Platform::current()->currentThread()->getWebTaskRunner()->postTask(B LINK_FROM_HERE, WTF::bind(&ImageResource::doResetAnimation, wrapWeakPersistent(t his))); 225 Platform::current()->currentThread()->getWebTaskRunner()->postTask(B LINK_FROM_HERE, WTF::bind(&ImageResource::doResetAnimation, wrapWeakPersistent(t his)));
226 else 226 else
227 m_image->resetAnimation(); 227 m_image->resetAnimation();
228 } 228 }
229 if (m_multipartParser) 229 if (m_multipartParser)
230 m_multipartParser->cancel(); 230 m_multipartParser->cancel();
231 Resource::allClientsAndObserversRemoved(); 231 Resource::allClientsAndObserversRemoved();
232 } 232 }
233 233
234 PassRefPtr<SharedBuffer> ImageResource::resourceBuffer() const 234 PassRefPtr<const SharedBuffer> ImageResource::resourceBuffer() const
235 { 235 {
236 if (data()) 236 if (data())
237 return data(); 237 return data();
238 if (m_image) 238 if (m_image)
239 return m_image->data(); 239 return m_image->data();
240 return nullptr; 240 return nullptr;
241 } 241 }
242 242
243 void ImageResource::appendData(const char* data, size_t length) 243 void ImageResource::appendData(const char* data, size_t length)
244 { 244 {
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 if (response().wasFetchedViaServiceWorker()) 585 if (response().wasFetchedViaServiceWorker())
586 return response().serviceWorkerResponseType() != WebServiceWorkerRespons eTypeOpaque; 586 return response().serviceWorkerResponseType() != WebServiceWorkerRespons eTypeOpaque;
587 if (!getImage()->currentFrameHasSingleSecurityOrigin()) 587 if (!getImage()->currentFrameHasSingleSecurityOrigin())
588 return false; 588 return false;
589 if (passesAccessControlCheck(securityOrigin)) 589 if (passesAccessControlCheck(securityOrigin))
590 return true; 590 return true;
591 return !securityOrigin->taintsCanvas(response().url()); 591 return !securityOrigin->taintsCanvas(response().url());
592 } 592 }
593 593
594 } // namespace blink 594 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ImageResource.h ('k') | third_party/WebKit/Source/core/fetch/Resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698