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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/ScriptPromise.cpp

Issue 2595543003: Rename toV8(...) function in Blink to ToV8(...). (Closed)
Patch Set: Rebasing... Created 3 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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 return ScriptPromise(); 292 return ScriptPromise();
293 InternalResolver resolver(scriptState); 293 InternalResolver resolver(scriptState);
294 ScriptPromise promise = resolver.promise(); 294 ScriptPromise promise = resolver.promise();
295 resolver.reject(value); 295 resolver.reject(value);
296 return promise; 296 return promise;
297 } 297 }
298 298
299 ScriptPromise ScriptPromise::rejectWithDOMException(ScriptState* scriptState, 299 ScriptPromise ScriptPromise::rejectWithDOMException(ScriptState* scriptState,
300 DOMException* exception) { 300 DOMException* exception) {
301 ASSERT(scriptState->isolate()->InContext()); 301 ASSERT(scriptState->isolate()->InContext());
302 return reject(scriptState, toV8(exception, scriptState->context()->Global(), 302 return reject(scriptState, ToV8(exception, scriptState->context()->Global(),
303 scriptState->isolate())); 303 scriptState->isolate()));
304 } 304 }
305 305
306 v8::Local<v8::Promise> ScriptPromise::rejectRaw(ScriptState* scriptState, 306 v8::Local<v8::Promise> ScriptPromise::rejectRaw(ScriptState* scriptState,
307 v8::Local<v8::Value> value) { 307 v8::Local<v8::Value> value) {
308 if (value.IsEmpty()) 308 if (value.IsEmpty())
309 return v8::Local<v8::Promise>(); 309 return v8::Local<v8::Promise>();
310 v8::Local<v8::Promise::Resolver> resolver; 310 v8::Local<v8::Promise::Resolver> resolver;
311 if (!v8::Promise::Resolver::New(scriptState->context()).ToLocal(&resolver)) 311 if (!v8::Promise::Resolver::New(scriptState->context()).ToLocal(&resolver))
312 return v8::Local<v8::Promise>(); 312 return v8::Local<v8::Promise>();
313 v8::Local<v8::Promise> promise = resolver->GetPromise(); 313 v8::Local<v8::Promise> promise = resolver->GetPromise();
314 resolver->Reject(scriptState->context(), value); 314 resolver->Reject(scriptState->context(), value);
315 return promise; 315 return promise;
316 } 316 }
317 317
318 ScriptPromise ScriptPromise::all(ScriptState* scriptState, 318 ScriptPromise ScriptPromise::all(ScriptState* scriptState,
319 const Vector<ScriptPromise>& promises) { 319 const Vector<ScriptPromise>& promises) {
320 return PromiseAllHandler::all(scriptState, promises); 320 return PromiseAllHandler::all(scriptState, promises);
321 } 321 }
322 322
323 void ScriptPromise::increaseInstanceCount() { 323 void ScriptPromise::increaseInstanceCount() {
324 InstanceCounters::incrementCounter(InstanceCounters::ScriptPromiseCounter); 324 InstanceCounters::incrementCounter(InstanceCounters::ScriptPromiseCounter);
325 } 325 }
326 326
327 void ScriptPromise::decreaseInstanceCount() { 327 void ScriptPromise::decreaseInstanceCount() {
328 InstanceCounters::decrementCounter(InstanceCounters::ScriptPromiseCounter); 328 InstanceCounters::decrementCounter(InstanceCounters::ScriptPromiseCounter);
329 } 329 }
330 330
331 } // namespace blink 331 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698