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

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

Issue 2050123002: Remove OwnPtr from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: First attempt to land. Created 4 years, 6 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 #include "core/layout/LayoutImage.h" 44 #include "core/layout/LayoutImage.h"
45 #include "core/layout/LayoutVideo.h" 45 #include "core/layout/LayoutVideo.h"
46 #include "core/layout/svg/LayoutSVGImage.h" 46 #include "core/layout/svg/LayoutSVGImage.h"
47 #include "core/svg/graphics/SVGImage.h" 47 #include "core/svg/graphics/SVGImage.h"
48 #include "platform/Logging.h" 48 #include "platform/Logging.h"
49 #include "platform/weborigin/SecurityOrigin.h" 49 #include "platform/weborigin/SecurityOrigin.h"
50 #include "platform/weborigin/SecurityPolicy.h" 50 #include "platform/weborigin/SecurityPolicy.h"
51 #include "public/platform/WebCachePolicy.h" 51 #include "public/platform/WebCachePolicy.h"
52 #include "public/platform/WebURLRequest.h" 52 #include "public/platform/WebURLRequest.h"
53 #include "wtf/PtrUtil.h" 53 #include "wtf/PtrUtil.h"
54 #include <memory>
54 55
55 namespace blink { 56 namespace blink {
56 57
57 static ImageEventSender& loadEventSender() 58 static ImageEventSender& loadEventSender()
58 { 59 {
59 DEFINE_STATIC_LOCAL(ImageEventSender, sender, (ImageEventSender::create(Even tTypeNames::load))); 60 DEFINE_STATIC_LOCAL(ImageEventSender, sender, (ImageEventSender::create(Even tTypeNames::load)));
60 return sender; 61 return sender;
61 } 62 }
62 63
63 static ImageEventSender& errorEventSender() 64 static ImageEventSender& errorEventSender()
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 // FIXME: According to 256 // FIXME: According to
256 // http://www.whatwg.org/specs/web-apps/current-work/multipage/embedded-cont ent.html#the-img-element:the-img-element-55 257 // http://www.whatwg.org/specs/web-apps/current-work/multipage/embedded-cont ent.html#the-img-element:the-img-element-55
257 // When "update image" is called due to environment changes and the load fai ls, onerror should not be called. 258 // When "update image" is called due to environment changes and the load fai ls, onerror should not be called.
258 // That is currently not the case. 259 // That is currently not the case.
259 // 260 //
260 // We don't need to call clearLoader here: Either we were called from the 261 // We don't need to call clearLoader here: Either we were called from the
261 // task, or our caller updateFromElement cleared the task's loader (and set 262 // task, or our caller updateFromElement cleared the task's loader (and set
262 // m_pendingTask to null). 263 // m_pendingTask to null).
263 m_pendingTask.clear(); 264 m_pendingTask.clear();
264 // Make sure to only decrement the count when we exit this function 265 // Make sure to only decrement the count when we exit this function
265 OwnPtr<IncrementLoadEventDelayCount> loadDelayCounter; 266 std::unique_ptr<IncrementLoadEventDelayCount> loadDelayCounter;
266 loadDelayCounter.swap(m_loadDelayCounter); 267 loadDelayCounter.swap(m_loadDelayCounter);
267 268
268 Document& document = m_element->document(); 269 Document& document = m_element->document();
269 if (!document.isActive()) 270 if (!document.isActive())
270 return; 271 return;
271 272
272 AtomicString imageSourceURL = m_element->imageSourceURL(); 273 AtomicString imageSourceURL = m_element->imageSourceURL();
273 KURL url = imageSourceToKURL(imageSourceURL); 274 KURL url = imageSourceToKURL(imageSourceURL);
274 ImageResource* newImage = nullptr; 275 ImageResource* newImage = nullptr;
275 if (!url.isNull()) { 276 if (!url.isNull()) {
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 603
603 void ImageLoader::elementDidMoveToNewDocument() 604 void ImageLoader::elementDidMoveToNewDocument()
604 { 605 {
605 if (m_loadDelayCounter) 606 if (m_loadDelayCounter)
606 m_loadDelayCounter->documentChanged(m_element->document()); 607 m_loadDelayCounter->documentChanged(m_element->document());
607 clearFailedLoadURL(); 608 clearFailedLoadURL();
608 setImage(0); 609 setImage(0);
609 } 610 }
610 611
611 } // namespace blink 612 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/ImageLoader.h ('k') | third_party/WebKit/Source/core/loader/LinkLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698