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

Side by Side Diff: third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.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. 2 * Copyright (C) 2006 Apple Computer, Inc.
3 * 3 *
4 * Portions are Copyright (C) 2001-6 mozilla.org 4 * Portions are Copyright (C) 2001-6 mozilla.org
5 * 5 *
6 * Other contributors: 6 * Other contributors:
7 * Stuart Parmenter <stuart@mozilla.com> 7 * Stuart Parmenter <stuart@mozilla.com>
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public 10 * modify it under the terms of the GNU Lesser General Public
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after
1001 return true; 1001 return true;
1002 1002
1003 return decoder->frameIsCompleteAtIndex(0); 1003 return decoder->frameIsCompleteAtIndex(0);
1004 } 1004 }
1005 1005
1006 void JPEGImageDecoder::decode(bool onlySize) { 1006 void JPEGImageDecoder::decode(bool onlySize) {
1007 if (failed()) 1007 if (failed())
1008 return; 1008 return;
1009 1009
1010 if (!m_reader) { 1010 if (!m_reader) {
1011 m_reader = wrapUnique(new JPEGImageReader(this)); 1011 m_reader = makeUnique<JPEGImageReader>(this);
1012 m_reader->setData(m_data.get()); 1012 m_reader->setData(m_data.get());
1013 } 1013 }
1014 1014
1015 // If we couldn't decode the image but have received all the data, decoding 1015 // If we couldn't decode the image but have received all the data, decoding
1016 // has failed. 1016 // has failed.
1017 if (!m_reader->decode(onlySize) && isAllDataReceived()) 1017 if (!m_reader->decode(onlySize) && isAllDataReceived())
1018 setFailed(); 1018 setFailed();
1019 1019
1020 // If decoding is done or failed, we don't need the JPEGImageReader anymore. 1020 // If decoding is done or failed, we don't need the JPEGImageReader anymore.
1021 if (isComplete(this, onlySize) || failed()) 1021 if (isComplete(this, onlySize) || failed())
1022 m_reader.reset(); 1022 m_reader.reset();
1023 } 1023 }
1024 1024
1025 } // namespace blink 1025 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698