OLD | NEW |
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 2294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2305 v8::Isolate* isolate = value.isolate(); | 2305 v8::Isolate* isolate = value.isolate(); |
2306 ASSERT(v8Value->IsNumber()); | 2306 ASSERT(v8Value->IsNumber()); |
2307 int intValue = v8Value.As<v8::Integer>()->Value(); | 2307 int intValue = v8Value.As<v8::Integer>()->Value(); |
2308 ScriptValue result = ScriptValue(v8::Integer::New(isolate, intValue + 1
), isolate); | 2308 ScriptValue result = ScriptValue(v8::Integer::New(isolate, intValue + 1
), isolate); |
2309 return result; | 2309 return result; |
2310 } | 2310 } |
2311 }; | 2311 }; |
2312 | 2312 |
2313 } // namespace | 2313 } // namespace |
2314 | 2314 |
2315 ScriptPromise Internals::createPromise(ExecutionContext* context) | 2315 ScriptPromise Internals::createPromise(ScriptState* scriptState) |
2316 { | 2316 { |
2317 return ScriptPromiseResolver::create(context)->promise(); | 2317 return ScriptPromiseResolver::create(scriptState)->promise(); |
2318 } | 2318 } |
2319 | 2319 |
2320 ScriptPromise Internals::createResolvedPromise(ExecutionContext* context, Script
Value value) | 2320 ScriptPromise Internals::createResolvedPromise(ScriptState* scriptState, ScriptV
alue value) |
2321 { | 2321 { |
2322 RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(conte
xt); | 2322 RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scrip
tState); |
2323 ScriptPromise promise = resolver->promise(); | 2323 ScriptPromise promise = resolver->promise(); |
2324 resolver->resolve(value); | 2324 resolver->resolve(value); |
2325 return promise; | 2325 return promise; |
2326 } | 2326 } |
2327 | 2327 |
2328 ScriptPromise Internals::createRejectedPromise(ExecutionContext* context, Script
Value value) | 2328 ScriptPromise Internals::createRejectedPromise(ScriptState* scriptState, ScriptV
alue value) |
2329 { | 2329 { |
2330 RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(conte
xt); | 2330 RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scrip
tState); |
2331 ScriptPromise promise = resolver->promise(); | 2331 ScriptPromise promise = resolver->promise(); |
2332 resolver->reject(value); | 2332 resolver->reject(value); |
2333 return promise; | 2333 return promise; |
2334 } | 2334 } |
2335 | 2335 |
2336 ScriptPromise Internals::addOneToPromise(ExecutionContext* context, ScriptPromis
e promise) | 2336 ScriptPromise Internals::addOneToPromise(ExecutionContext* context, ScriptPromis
e promise) |
2337 { | 2337 { |
2338 return promise.then(AddOneFunction::create(context)); | 2338 return promise.then(AddOneFunction::create(context)); |
2339 } | 2339 } |
2340 | 2340 |
(...skipping 11 matching lines...) Expand all Loading... |
2352 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma
xLength) | 2352 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma
xLength) |
2353 { | 2353 { |
2354 if (!node) | 2354 if (!node) |
2355 return String(); | 2355 return String(); |
2356 blink::WebPoint point(x, y); | 2356 blink::WebPoint point(x, y); |
2357 SurroundingText surroundingText(VisiblePosition(node->renderer()->positionFo
rPoint(static_cast<IntPoint>(point))), maxLength); | 2357 SurroundingText surroundingText(VisiblePosition(node->renderer()->positionFo
rPoint(static_cast<IntPoint>(point))), maxLength); |
2358 return surroundingText.content(); | 2358 return surroundingText.content(); |
2359 } | 2359 } |
2360 | 2360 |
2361 } | 2361 } |
OLD | NEW |