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

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

Issue 1667843003: Make Resource RefCountedWillBeGarbageCollectedFinalized, attempt #2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase + address review comments Created 4 years, 10 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 23 matching lines...) Expand all
34 #include "platform/RuntimeEnabledFeatures.h" 34 #include "platform/RuntimeEnabledFeatures.h"
35 #include "platform/SharedBuffer.h" 35 #include "platform/SharedBuffer.h"
36 #include "platform/TraceEvent.h" 36 #include "platform/TraceEvent.h"
37 #include "platform/graphics/BitmapImage.h" 37 #include "platform/graphics/BitmapImage.h"
38 #include "public/platform/Platform.h" 38 #include "public/platform/Platform.h"
39 #include "wtf/CurrentTime.h" 39 #include "wtf/CurrentTime.h"
40 #include "wtf/StdLibExtras.h" 40 #include "wtf/StdLibExtras.h"
41 41
42 namespace blink { 42 namespace blink {
43 43
44 ResourcePtr<ImageResource> ImageResource::fetch(FetchRequest& request, ResourceF etcher* fetcher) 44 PassRefPtrWillBeRawPtr<ImageResource> ImageResource::fetch(FetchRequest& request , ResourceFetcher* fetcher)
45 { 45 {
46 if (request.resourceRequest().requestContext() == WebURLRequest::RequestCont extUnspecified) 46 if (request.resourceRequest().requestContext() == WebURLRequest::RequestCont extUnspecified)
47 request.mutableResourceRequest().setRequestContext(WebURLRequest::Reques tContextImage); 47 request.mutableResourceRequest().setRequestContext(WebURLRequest::Reques tContextImage);
48 if (fetcher->context().pageDismissalEventBeingDispatched()) { 48 if (fetcher->context().pageDismissalEventBeingDispatched()) {
49 KURL requestURL = request.resourceRequest().url(); 49 KURL requestURL = request.resourceRequest().url();
50 if (requestURL.isValid() && fetcher->context().canRequest(Resource::Imag e, request.resourceRequest(), requestURL, request.options(), request.forPreload( ), request.originRestriction())) 50 if (requestURL.isValid() && fetcher->context().canRequest(Resource::Imag e, request.resourceRequest(), requestURL, request.options(), request.forPreload( ), request.originRestriction()))
51 fetcher->context().sendImagePing(requestURL); 51 fetcher->context().sendImagePing(requestURL);
52 return 0; 52 return nullptr;
53 } 53 }
54 54
55 if (fetcher->clientDefersImage(request.resourceRequest().url())) 55 if (fetcher->clientDefersImage(request.resourceRequest().url()))
56 request.setDefer(FetchRequest::DeferredByClient); 56 request.setDefer(FetchRequest::DeferredByClient);
57 57
58 return toImageResource(fetcher->requestResource(request, ImageResourceFactor y())); 58 return toImageResource(fetcher->requestResource(request, ImageResourceFactor y()));
59 } 59 }
60 60
61 ImageResource::ImageResource(const ResourceRequest& resourceRequest) 61 ImageResource::ImageResource(const ResourceRequest& resourceRequest)
62 : Resource(resourceRequest, Image) 62 : Resource(resourceRequest, Image)
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 return true; 456 return true;
457 return !securityOrigin->taintsCanvas(response().url()); 457 return !securityOrigin->taintsCanvas(response().url());
458 } 458 }
459 459
460 bool ImageResource::loadingMultipartContent() const 460 bool ImageResource::loadingMultipartContent() const
461 { 461 {
462 return m_loader && m_loader->loadingMultipartContent(); 462 return m_loader && m_loader->loadingMultipartContent();
463 } 463 }
464 464
465 } // namespace blink 465 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ImageResource.h ('k') | third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698