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

Side by Side Diff: third_party/WebKit/Source/platform/image-decoders/gif/GIFImageDecoder.cpp

Issue 2494333002: Replace wrapUnique(new T(args)) by makeUnique<T>(args) in Blink (Closed)
Patch Set: Drop redundant WTF:: Created 4 years, 1 month 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) 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 if (index >= m_frameBufferCache.size() - 1 && isAllDataReceived() && 347 if (index >= m_frameBufferCache.size() - 1 && isAllDataReceived() &&
348 m_reader && !m_reader->parseCompleted()) 348 m_reader && !m_reader->parseCompleted())
349 setFailed(); 349 setFailed();
350 } 350 }
351 351
352 void GIFImageDecoder::parse(GIFParseQuery query) { 352 void GIFImageDecoder::parse(GIFParseQuery query) {
353 if (failed()) 353 if (failed())
354 return; 354 return;
355 355
356 if (!m_reader) { 356 if (!m_reader) {
357 m_reader = wrapUnique(new GIFImageReader(this)); 357 m_reader = makeUnique<GIFImageReader>(this);
358 m_reader->setData(m_data); 358 m_reader->setData(m_data);
359 } 359 }
360 360
361 if (!m_reader->parse(query)) 361 if (!m_reader->parse(query))
362 setFailed(); 362 setFailed();
363 } 363 }
364 364
365 bool GIFImageDecoder::initFrameBuffer(size_t frameIndex) { 365 bool GIFImageDecoder::initFrameBuffer(size_t frameIndex) {
366 // Initialize the frame rect in our buffer. 366 // Initialize the frame rect in our buffer.
367 ImageFrame* const buffer = &m_frameBufferCache[frameIndex]; 367 ImageFrame* const buffer = &m_frameBufferCache[frameIndex];
(...skipping 29 matching lines...) Expand all
397 } 397 }
398 398
399 // Update our status to be partially complete. 399 // Update our status to be partially complete.
400 buffer->setStatus(ImageFrame::FramePartial); 400 buffer->setStatus(ImageFrame::FramePartial);
401 401
402 // Reset the alpha pixel tracker for this frame. 402 // Reset the alpha pixel tracker for this frame.
403 m_currentBufferSawAlpha = false; 403 m_currentBufferSawAlpha = false;
404 return true; 404 return true;
405 } 405 }
406 } // namespace blink 406 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698