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

Side by Side Diff: Source/core/loader/ImageLoader.cpp

Issue 875503003: Allow Oilpan heap objects account for their external allocations. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Have conservative GC take prio over scheduled GC when urgent GCing Created 5 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Apple Inc. All rights reserv ed. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Apple Inc. All rights reserv ed.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 void ImageLoader::doUpdateFromElement(BypassMainWorldBehavior bypassBehavior, Up dateFromElementBehavior updateBehavior) 232 void ImageLoader::doUpdateFromElement(BypassMainWorldBehavior bypassBehavior, Up dateFromElementBehavior updateBehavior)
233 { 233 {
234 // FIXME: According to 234 // FIXME: According to
235 // http://www.whatwg.org/specs/web-apps/current-work/multipage/embedded-cont ent.html#the-img-element:the-img-element-55 235 // http://www.whatwg.org/specs/web-apps/current-work/multipage/embedded-cont ent.html#the-img-element:the-img-element-55
236 // When "update image" is called due to environment changes and the load fai ls, onerror should not be called. 236 // When "update image" is called due to environment changes and the load fai ls, onerror should not be called.
237 // That is currently not the case. 237 // That is currently not the case.
238 // 238 //
239 // We don't need to call clearLoader here: Either we were called from the 239 // We don't need to call clearLoader here: Either we were called from the
240 // task, or our caller updateFromElement cleared the task's loader (and set 240 // task, or our caller updateFromElement cleared the task's loader (and set
241 // m_pendingTask to null). 241 // m_pendingTask to null).
242 RefPtrWillBeRawPtr<Element> protectElement(m_element.get());
haraken 2015/02/10 01:23:17 What is this change for?
sof 2015/02/11 15:58:25 Good question - running into stray Release crashes
sof 2015/02/12 07:28:31 Current theory is that this is an ImageLoader elem
242 m_pendingTask.clear(); 243 m_pendingTask.clear();
243 // Make sure to only decrement the count when we exit this function 244 // Make sure to only decrement the count when we exit this function
244 OwnPtr<IncrementLoadEventDelayCount> loadDelayCounter; 245 OwnPtr<IncrementLoadEventDelayCount> loadDelayCounter;
245 loadDelayCounter.swap(m_loadDelayCounter); 246 loadDelayCounter.swap(m_loadDelayCounter);
246 247
247 Document& document = m_element->document(); 248 Document& document = m_element->document();
248 if (!document.isActive()) 249 if (!document.isActive())
249 return; 250 return;
250 251
251 AtomicString imageSourceURL = m_element->imageSourceURL(); 252 AtomicString imageSourceURL = m_element->imageSourceURL();
252 KURL url = imageSourceToKURL(imageSourceURL); 253 KURL url = imageSourceToKURL(imageSourceURL);
253 ResourcePtr<ImageResource> newImage = 0; 254 ResourcePtr<ImageResource> newImage = 0;
254 RefPtrWillBeRawPtr<Element> protectElement(m_element.get());
255 if (!url.isNull()) { 255 if (!url.isNull()) {
256 // Unlike raw <img>, we block mixed content inside of <picture> or <img srcset>. 256 // Unlike raw <img>, we block mixed content inside of <picture> or <img srcset>.
257 ResourceLoaderOptions resourceLoaderOptions = ResourceFetcher::defaultRe sourceOptions(); 257 ResourceLoaderOptions resourceLoaderOptions = ResourceFetcher::defaultRe sourceOptions();
258 ResourceRequest resourceRequest(url); 258 ResourceRequest resourceRequest(url);
259 resourceRequest.setFetchCredentialsMode(WebURLRequest::FetchCredentialsM odeSameOrigin); 259 resourceRequest.setFetchCredentialsMode(WebURLRequest::FetchCredentialsM odeSameOrigin);
260 if (isHTMLPictureElement(element()->parentNode()) || !element()->fastGet Attribute(HTMLNames::srcsetAttr).isNull()) { 260 if (isHTMLPictureElement(element()->parentNode()) || !element()->fastGet Attribute(HTMLNames::srcsetAttr).isNull()) {
261 resourceLoaderOptions.mixedContentBlockingTreatment = TreatAsActiveC ontent; 261 resourceLoaderOptions.mixedContentBlockingTreatment = TreatAsActiveC ontent;
262 resourceRequest.setRequestContext(WebURLRequest::RequestContextImage Set); 262 resourceRequest.setRequestContext(WebURLRequest::RequestContextImage Set);
263 } 263 }
264 FetchRequest request(resourceRequest, element()->localName(), resourceLo aderOptions); 264 FetchRequest request(resourceRequest, element()->localName(), resourceLo aderOptions);
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 #endif 589 #endif
590 } 590 }
591 591
592 #if ENABLE(OILPAN) 592 #if ENABLE(OILPAN)
593 ImageLoader::ImageLoaderClientRemover::~ImageLoaderClientRemover() 593 ImageLoader::ImageLoaderClientRemover::~ImageLoaderClientRemover()
594 { 594 {
595 m_loader.willRemoveClient(m_client); 595 m_loader.willRemoveClient(m_client);
596 } 596 }
597 #endif 597 #endif
598 } 598 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698