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

Side by Side Diff: third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.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) 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 m_resolver->reject(ScriptValue(m_resolver->scriptState(), v8::Null(m_resolve r->scriptState()->isolate()))); 164 m_resolver->reject(ScriptValue(m_resolver->scriptState(), v8::Null(m_resolve r->scriptState()->isolate())));
165 m_factory->didFinishLoading(this); 165 m_factory->didFinishLoading(this);
166 } 166 }
167 167
168 void ImageBitmapFactories::ImageBitmapLoader::didFinishLoading() 168 void ImageBitmapFactories::ImageBitmapLoader::didFinishLoading()
169 { 169 {
170 if (!m_loader.arrayBufferResult()) { 170 if (!m_loader.arrayBufferResult()) {
171 rejectPromise(); 171 rejectPromise();
172 return; 172 return;
173 } 173 }
174 RefPtr<SharedBuffer> sharedBuffer = SharedBuffer::create((char*)m_loader.arr ayBufferResult()->data(), m_loader.arrayBufferResult()->byteLength()); 174 RefPtr<SharedBuffer> sharedBuffer = SharedBuffer::create((char*)m_loader.arr ayBufferResult()->data(), static_cast<size_t>(m_loader.arrayBufferResult()->byte Length()));
175 175
176 OwnPtr<ImageSource> source = adoptPtr(new ImageSource()); 176 OwnPtr<ImageSource> source = adoptPtr(new ImageSource());
177 source->setData(*sharedBuffer, true); 177 source->setData(*sharedBuffer, true);
178 178
179 RefPtr<SkImage> frame = source->createFrameAtIndex(0); 179 RefPtr<SkImage> frame = source->createFrameAtIndex(0);
180 ASSERT(!frame || (frame->width() && frame->height())); 180 ASSERT(!frame || (frame->width() && frame->height()));
181 if (!frame) { 181 if (!frame) {
182 rejectPromise(); 182 rejectPromise();
183 return; 183 return;
184 } 184 }
(...skipping 14 matching lines...) Expand all
199 rejectPromise(); 199 rejectPromise();
200 } 200 }
201 201
202 DEFINE_TRACE(ImageBitmapFactories::ImageBitmapLoader) 202 DEFINE_TRACE(ImageBitmapFactories::ImageBitmapLoader)
203 { 203 {
204 visitor->trace(m_factory); 204 visitor->trace(m_factory);
205 visitor->trace(m_resolver); 205 visitor->trace(m_resolver);
206 } 206 }
207 207
208 } // namespace blink 208 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/track/vtt/VTTParser.cpp ('k') | third_party/WebKit/Source/core/loader/DocumentLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698