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

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

Issue 1233173002: Have ScriptPromiseResolver on the Oilpan heap always. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix webusb ScriptPromiseResolver usage Created 5 years, 4 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 #include "platform/graphics/ImageSource.h" 43 #include "platform/graphics/ImageSource.h"
44 #include "platform/graphics/StaticBitmapImage.h" 44 #include "platform/graphics/StaticBitmapImage.h"
45 #include "public/platform/WebSize.h" 45 #include "public/platform/WebSize.h"
46 #include "third_party/skia/include/core/SkImage.h" 46 #include "third_party/skia/include/core/SkImage.h"
47 #include <v8.h> 47 #include <v8.h>
48 48
49 namespace blink { 49 namespace blink {
50 50
51 static ScriptPromise fulfillImageBitmap(ScriptState* scriptState, PassRefPtrWill BeRawPtr<ImageBitmap> imageBitmap) 51 static ScriptPromise fulfillImageBitmap(ScriptState* scriptState, PassRefPtrWill BeRawPtr<ImageBitmap> imageBitmap)
52 { 52 {
53 RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver:: create(scriptState); 53 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState) ;
54 ScriptPromise promise = resolver->promise(); 54 ScriptPromise promise = resolver->promise();
55 if (imageBitmap) { 55 if (imageBitmap) {
56 resolver->resolve(imageBitmap); 56 resolver->resolve(imageBitmap);
57 } else { 57 } else {
58 resolver->reject(ScriptValue(scriptState, v8::Null(scriptState->isolate( )))); 58 resolver->reject(ScriptValue(scriptState, v8::Null(scriptState->isolate( ))));
59 } 59 }
60 return promise; 60 return promise;
61 } 61 }
62 62
63 ScriptPromise ImageBitmapFactories::createImageBitmap(ScriptState* scriptState, EventTarget& eventTarget, Blob* blob, ExceptionState& exceptionState) 63 ScriptPromise ImageBitmapFactories::createImageBitmap(ScriptState* scriptState, EventTarget& eventTarget, Blob* blob, ExceptionState& exceptionState)
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 rejectPromise(); 208 rejectPromise();
209 } 209 }
210 210
211 DEFINE_TRACE(ImageBitmapFactories::ImageBitmapLoader) 211 DEFINE_TRACE(ImageBitmapFactories::ImageBitmapLoader)
212 { 212 {
213 visitor->trace(m_factory); 213 visitor->trace(m_factory);
214 visitor->trace(m_resolver); 214 visitor->trace(m_resolver);
215 } 215 }
216 216
217 } // namespace blink 217 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/imagebitmap/ImageBitmapFactories.h ('k') | Source/core/streams/ReadableStreamImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698