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

Side by Side Diff: Source/core/testing/Internals.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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 2238 matching lines...) Expand 10 before | Expand all | Expand 10 after
2249 ASSERT(v8Value->IsNumber()); 2249 ASSERT(v8Value->IsNumber());
2250 int intValue = v8Value.As<v8::Integer>()->Value(); 2250 int intValue = v8Value.As<v8::Integer>()->Value();
2251 return ScriptValue(scriptState(), v8::Integer::New(scriptState()->isolat e(), intValue + 1)); 2251 return ScriptValue(scriptState(), v8::Integer::New(scriptState()->isolat e(), intValue + 1));
2252 } 2252 }
2253 }; 2253 };
2254 2254
2255 } // namespace 2255 } // namespace
2256 2256
2257 ScriptPromise Internals::createResolvedPromise(ScriptState* scriptState, ScriptV alue value) 2257 ScriptPromise Internals::createResolvedPromise(ScriptState* scriptState, ScriptV alue value)
2258 { 2258 {
2259 RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver:: create(scriptState); 2259 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState) ;
2260 ScriptPromise promise = resolver->promise(); 2260 ScriptPromise promise = resolver->promise();
2261 resolver->resolve(value); 2261 resolver->resolve(value);
2262 return promise; 2262 return promise;
2263 } 2263 }
2264 2264
2265 ScriptPromise Internals::createRejectedPromise(ScriptState* scriptState, ScriptV alue value) 2265 ScriptPromise Internals::createRejectedPromise(ScriptState* scriptState, ScriptV alue value)
2266 { 2266 {
2267 RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver:: create(scriptState); 2267 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState) ;
2268 ScriptPromise promise = resolver->promise(); 2268 ScriptPromise promise = resolver->promise();
2269 resolver->reject(value); 2269 resolver->reject(value);
2270 return promise; 2270 return promise;
2271 } 2271 }
2272 2272
2273 ScriptPromise Internals::addOneToPromise(ScriptState* scriptState, ScriptPromise promise) 2273 ScriptPromise Internals::addOneToPromise(ScriptState* scriptState, ScriptPromise promise)
2274 { 2274 {
2275 return promise.then(AddOneFunction::createFunction(scriptState)); 2275 return promise.then(AddOneFunction::createFunction(scriptState));
2276 } 2276 }
2277 2277
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
2486 2486
2487 return animator->setScrollbarsVisibleForTesting(visible); 2487 return animator->setScrollbarsVisibleForTesting(visible);
2488 } 2488 }
2489 2489
2490 void Internals::forceRestrictIFramePermissions() 2490 void Internals::forceRestrictIFramePermissions()
2491 { 2491 {
2492 RuntimeEnabledFeatures::setRestrictIFramePermissionsEnabled(true); 2492 RuntimeEnabledFeatures::setRestrictIFramePermissionsEnabled(true);
2493 } 2493 }
2494 2494
2495 } // namespace blink 2495 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698