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 2268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2279 | 2279 |
2280 private: | 2280 private: |
2281 AddOneFunction(v8::Isolate* isolate) | 2281 AddOneFunction(v8::Isolate* isolate) |
2282 : ScriptFunction(isolate) | 2282 : ScriptFunction(isolate) |
2283 { | 2283 { |
2284 } | 2284 } |
2285 | 2285 |
2286 virtual ScriptValue call(ScriptValue value) OVERRIDE | 2286 virtual ScriptValue call(ScriptValue value) OVERRIDE |
2287 { | 2287 { |
2288 v8::Local<v8::Value> v8Value = value.v8Value(); | 2288 v8::Local<v8::Value> v8Value = value.v8Value(); |
| 2289 v8::Isolate* isolate = value.isolate(); |
2289 ASSERT(v8Value->IsNumber()); | 2290 ASSERT(v8Value->IsNumber()); |
2290 int intValue = v8Value.As<v8::Integer>()->Value(); | 2291 int intValue = v8Value.As<v8::Integer>()->Value(); |
2291 ScriptValue result = ScriptValue(ScriptState::current(isolate()), v8::I
nteger::New(isolate(), intValue + 1)); | 2292 ScriptValue result = ScriptValue(value.scriptState(), v8::Integer::New(
isolate, intValue + 1)); |
2292 return result; | 2293 return result; |
2293 } | 2294 } |
2294 }; | 2295 }; |
2295 | 2296 |
2296 } // namespace | 2297 } // namespace |
2297 | 2298 |
2298 ScriptPromise Internals::createPromise(ScriptState* scriptState) | 2299 ScriptPromise Internals::createPromise(ScriptState* scriptState) |
2299 { | 2300 { |
2300 return ScriptPromiseResolver::create(scriptState)->promise(); | 2301 return ScriptPromiseResolver::create(scriptState)->promise(); |
2301 } | 2302 } |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2367 } else if (type == "none") { | 2368 } else if (type == "none") { |
2368 webtype = blink::ConnectionTypeNone; | 2369 webtype = blink::ConnectionTypeNone; |
2369 } else { | 2370 } else { |
2370 exceptionState.throwDOMException(NotFoundError, ExceptionMessages::faile
dToEnumerate("connection type", type)); | 2371 exceptionState.throwDOMException(NotFoundError, ExceptionMessages::faile
dToEnumerate("connection type", type)); |
2371 return; | 2372 return; |
2372 } | 2373 } |
2373 networkStateNotifier().setWebConnectionTypeForTest(webtype); | 2374 networkStateNotifier().setWebConnectionTypeForTest(webtype); |
2374 } | 2375 } |
2375 | 2376 |
2376 } // namespace WebCore | 2377 } // namespace WebCore |
OLD | NEW |