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

Side by Side Diff: third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp

Issue 1983753002: Remove OwnPtr::release() calls in core/ (part 2). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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) 2013, Google Inc. All rights reserved. 2 * Copyright (c) 2013, Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 ImageDecoder::AlphaOption alphaOp = ImageDecoder::AlphaPremultiplied; 231 ImageDecoder::AlphaOption alphaOp = ImageDecoder::AlphaPremultiplied;
232 if (m_options.premultiplyAlpha() == "none") 232 if (m_options.premultiplyAlpha() == "none")
233 alphaOp = ImageDecoder::AlphaNotPremultiplied; 233 alphaOp = ImageDecoder::AlphaNotPremultiplied;
234 ImageDecoder::GammaAndColorProfileOption colorSpaceOp = ImageDecoder::GammaA ndColorProfileApplied; 234 ImageDecoder::GammaAndColorProfileOption colorSpaceOp = ImageDecoder::GammaA ndColorProfileApplied;
235 if (m_options.colorSpaceConversion() == "none") 235 if (m_options.colorSpaceConversion() == "none")
236 colorSpaceOp = ImageDecoder::GammaAndColorProfileIgnored; 236 colorSpaceOp = ImageDecoder::GammaAndColorProfileIgnored;
237 OwnPtr<ImageDecoder> decoder(ImageDecoder::create(*sharedBuffer, alphaOp, co lorSpaceOp)); 237 OwnPtr<ImageDecoder> decoder(ImageDecoder::create(*sharedBuffer, alphaOp, co lorSpaceOp));
238 RefPtr<SkImage> frame; 238 RefPtr<SkImage> frame;
239 if (decoder) { 239 if (decoder) {
240 decoder->setData(sharedBuffer.get(), true); 240 decoder->setData(sharedBuffer.get(), true);
241 frame = ImageBitmap::getSkImageFromDecoder(decoder.release()); 241 frame = ImageBitmap::getSkImageFromDecoder(std::move(decoder));
242 } 242 }
243 taskRunner->postTask(BLINK_FROM_HERE, threadSafeBind(&ImageBitmapFactories:: ImageBitmapLoader::resolvePromiseOnOriginalThread, AllowCrossThreadAccess(this), frame.release())); 243 taskRunner->postTask(BLINK_FROM_HERE, threadSafeBind(&ImageBitmapFactories:: ImageBitmapLoader::resolvePromiseOnOriginalThread, AllowCrossThreadAccess(this), frame.release()));
244 } 244 }
245 245
246 void ImageBitmapFactories::ImageBitmapLoader::resolvePromiseOnOriginalThread(Pas sRefPtr<SkImage> frame) 246 void ImageBitmapFactories::ImageBitmapLoader::resolvePromiseOnOriginalThread(Pas sRefPtr<SkImage> frame)
247 { 247 {
248 if (!frame) { 248 if (!frame) {
249 rejectPromise(); 249 rejectPromise();
250 return; 250 return;
251 } 251 }
(...skipping 16 matching lines...) Expand all
268 m_factory->didFinishLoading(this); 268 m_factory->didFinishLoading(this);
269 } 269 }
270 270
271 DEFINE_TRACE(ImageBitmapFactories::ImageBitmapLoader) 271 DEFINE_TRACE(ImageBitmapFactories::ImageBitmapLoader)
272 { 272 {
273 visitor->trace(m_factory); 273 visitor->trace(m_factory);
274 visitor->trace(m_resolver); 274 visitor->trace(m_resolver);
275 } 275 }
276 276
277 } // namespace blink 277 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/parser/XSSAuditor.cpp ('k') | third_party/WebKit/Source/core/input/EventHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698