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

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

Issue 1571233003: Fix errors caused by unsafe conversions to/from size_t (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: improved ALLOW_NUMERIC_ARG_TYPES_PROMOTABLE_TO Created 4 years, 11 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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 288
289 inline void ImageResource::clearImage() 289 inline void ImageResource::clearImage()
290 { 290 {
291 // If our Image has an observer, it's always us so we need to clear the back pointer 291 // If our Image has an observer, it's always us so we need to clear the back pointer
292 // before dropping our reference. 292 // before dropping our reference.
293 if (m_image) 293 if (m_image)
294 m_image->setImageObserver(nullptr); 294 m_image->setImageObserver(nullptr);
295 m_image.clear(); 295 m_image.clear();
296 } 296 }
297 297
298 void ImageResource::appendData(const char* data, unsigned length) 298 void ImageResource::appendData(const char* data, size_t length)
299 { 299 {
300 Resource::appendData(data, length); 300 Resource::appendData(data, length);
301 if (!loadingMultipartContent()) 301 if (!loadingMultipartContent())
302 updateImage(false); 302 updateImage(false);
303 } 303 }
304 304
305 void ImageResource::updateImage(bool allDataReceived) 305 void ImageResource::updateImage(bool allDataReceived)
306 { 306 {
307 TRACE_EVENT0("blink", "ImageResource::updateImage"); 307 TRACE_EVENT0("blink", "ImageResource::updateImage");
308 308
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 return true; 454 return true;
455 return !securityOrigin->taintsCanvas(response().url()); 455 return !securityOrigin->taintsCanvas(response().url());
456 } 456 }
457 457
458 bool ImageResource::loadingMultipartContent() const 458 bool ImageResource::loadingMultipartContent() const
459 { 459 {
460 return m_loader && m_loader->loadingMultipartContent(); 460 return m_loader && m_loader->loadingMultipartContent();
461 } 461 }
462 462
463 } // namespace blink 463 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ImageResource.h ('k') | third_party/WebKit/Source/core/fetch/MemoryCacheTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698