| OLD | NEW | 
|---|
| 1 /* | 1 /* | 
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 
| 3 * Copyright (C) 2012 Ericsson AB. All rights reserved. | 3 * Copyright (C) 2012 Ericsson AB. 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 are | 6 * modification, are permitted provided that the following conditions are | 
| 7 * met: | 7 * met: | 
| 8 * | 8 * | 
| 9 *     * Redistributions of source code must retain the above copyright | 9 *     * 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 27 matching lines...) Expand all  Loading... | 
| 38 #include "bindings/v8/V8PerIsolateData.h" | 38 #include "bindings/v8/V8PerIsolateData.h" | 
| 39 #include "bindings/v8/V8StringResource.h" | 39 #include "bindings/v8/V8StringResource.h" | 
| 40 #include "bindings/v8/V8ThrowException.h" | 40 #include "bindings/v8/V8ThrowException.h" | 
| 41 #include "bindings/v8/V8ValueCache.h" | 41 #include "bindings/v8/V8ValueCache.h" | 
| 42 #include "wtf/MathExtras.h" | 42 #include "wtf/MathExtras.h" | 
| 43 #include "wtf/text/AtomicString.h" | 43 #include "wtf/text/AtomicString.h" | 
| 44 #include <v8.h> | 44 #include <v8.h> | 
| 45 | 45 | 
| 46 namespace WebCore { | 46 namespace WebCore { | 
| 47 | 47 | 
| 48     class DOMStringList; |  | 
| 49     class DOMWindow; | 48     class DOMWindow; | 
| 50     class Document; | 49     class Document; | 
| 51     class Frame; | 50     class Frame; | 
| 52     class NodeFilter; | 51     class NodeFilter; | 
| 53     class ExecutionContext; | 52     class ExecutionContext; | 
| 54     class ScriptWrappable; | 53     class ScriptWrappable; | 
| 55     class XPathNSResolver; | 54     class XPathNSResolver; | 
| 56 | 55 | 
| 57     const int kMaxRecursionDepth = 22; | 56     const int kMaxRecursionDepth = 22; | 
| 58 | 57 | 
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 301     { | 300     { | 
| 302         v8::Local<v8::Array> result = v8::Array::New(iterator.size()); | 301         v8::Local<v8::Array> result = v8::Array::New(iterator.size()); | 
| 303         int index = 0; | 302         int index = 0; | 
| 304         typename Vector<T, inlineCapacity>::const_iterator end = iterator.end(); | 303         typename Vector<T, inlineCapacity>::const_iterator end = iterator.end(); | 
| 305         typedef V8ValueTraits<T> TraitsType; | 304         typedef V8ValueTraits<T> TraitsType; | 
| 306         for (typename Vector<T, inlineCapacity>::const_iterator iter = iterator.
     begin(); iter != end; ++iter) | 305         for (typename Vector<T, inlineCapacity>::const_iterator iter = iterator.
     begin(); iter != end; ++iter) | 
| 307             result->Set(v8::Integer::New(index++, isolate), TraitsType::arrayV8V
     alue(*iter, isolate)); | 306             result->Set(v8::Integer::New(index++, isolate), TraitsType::arrayV8V
     alue(*iter, isolate)); | 
| 308         return result; | 307         return result; | 
| 309     } | 308     } | 
| 310 | 309 | 
| 311     v8::Handle<v8::Value> v8Array(PassRefPtr<DOMStringList>, v8::Isolate*); |  | 
| 312 |  | 
| 313     // Conversion flags, used in toIntXX/toUIntXX. | 310     // Conversion flags, used in toIntXX/toUIntXX. | 
| 314     enum IntegerConversionConfiguration { | 311     enum IntegerConversionConfiguration { | 
| 315         NormalConversion, | 312         NormalConversion, | 
| 316         EnforceRange, | 313         EnforceRange, | 
| 317         // FIXME: Implement Clamp | 314         // FIXME: Implement Clamp | 
| 318     }; | 315     }; | 
| 319 | 316 | 
| 320     // Convert a value to a 8-bit signed integer. The conversion fails if the | 317     // Convert a value to a 8-bit signed integer. The conversion fails if the | 
| 321     // value cannot be converted to a number or the range violated per WebIDL: | 318     // value cannot be converted to a number or the range violated per WebIDL: | 
| 322     // http://www.w3.org/TR/WebIDL/#es-byte | 319     // http://www.w3.org/TR/WebIDL/#es-byte | 
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 619     } | 616     } | 
| 620 | 617 | 
| 621     inline v8::Handle<v8::Value> v8DateOrNull(double value, v8::Isolate* isolate
     ) | 618     inline v8::Handle<v8::Value> v8DateOrNull(double value, v8::Isolate* isolate
     ) | 
| 622     { | 619     { | 
| 623         ASSERT(isolate); | 620         ASSERT(isolate); | 
| 624         return std::isfinite(value) ? v8::Date::New(value) : v8NullWithCheck(iso
     late); | 621         return std::isfinite(value) ? v8::Date::New(value) : v8NullWithCheck(iso
     late); | 
| 625     } | 622     } | 
| 626 | 623 | 
| 627     v8::Handle<v8::FunctionTemplate> createRawTemplate(v8::Isolate*); | 624     v8::Handle<v8::FunctionTemplate> createRawTemplate(v8::Isolate*); | 
| 628 | 625 | 
| 629     PassRefPtr<DOMStringList> toDOMStringList(v8::Handle<v8::Value>, v8::Isolate
     *); |  | 
| 630     PassRefPtr<XPathNSResolver> toXPathNSResolver(v8::Handle<v8::Value>, v8::Iso
     late*); | 626     PassRefPtr<XPathNSResolver> toXPathNSResolver(v8::Handle<v8::Value>, v8::Iso
     late*); | 
| 631 | 627 | 
| 632     v8::Handle<v8::Object> toInnerGlobalObject(v8::Handle<v8::Context>); | 628     v8::Handle<v8::Object> toInnerGlobalObject(v8::Handle<v8::Context>); | 
| 633     DOMWindow* toDOMWindow(v8::Handle<v8::Context>); | 629     DOMWindow* toDOMWindow(v8::Handle<v8::Context>); | 
| 634     ExecutionContext* toExecutionContext(v8::Handle<v8::Context>); | 630     ExecutionContext* toExecutionContext(v8::Handle<v8::Context>); | 
| 635 | 631 | 
| 636     DOMWindow* activeDOMWindow(); | 632     DOMWindow* activeDOMWindow(); | 
| 637     ExecutionContext* activeExecutionContext(); | 633     ExecutionContext* activeExecutionContext(); | 
| 638     DOMWindow* firstDOMWindow(); | 634     DOMWindow* firstDOMWindow(); | 
| 639     Document* currentDocument(); | 635     Document* currentDocument(); | 
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 691 | 687 | 
| 692     v8::Isolate* mainThreadIsolate(); | 688     v8::Isolate* mainThreadIsolate(); | 
| 693     v8::Isolate* toIsolate(ExecutionContext*); | 689     v8::Isolate* toIsolate(ExecutionContext*); | 
| 694     v8::Isolate* toIsolate(Frame*); | 690     v8::Isolate* toIsolate(Frame*); | 
| 695 | 691 | 
| 696     // Can only be called by WebKit::initialize | 692     // Can only be called by WebKit::initialize | 
| 697     void setMainThreadIsolate(v8::Isolate*); | 693     void setMainThreadIsolate(v8::Isolate*); | 
| 698 } // namespace WebCore | 694 } // namespace WebCore | 
| 699 | 695 | 
| 700 #endif // V8Binding_h | 696 #endif // V8Binding_h | 
| OLD | NEW | 
|---|