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 30 matching lines...) Expand all Loading... |
41 #include "wtf/MathExtras.h" | 41 #include "wtf/MathExtras.h" |
42 #include "wtf/text/AtomicString.h" | 42 #include "wtf/text/AtomicString.h" |
43 #include <v8.h> | 43 #include <v8.h> |
44 | 44 |
45 namespace WebCore { | 45 namespace WebCore { |
46 | 46 |
47 class DOMStringList; | 47 class DOMStringList; |
48 class DOMWindow; | 48 class DOMWindow; |
49 class Document; | 49 class Document; |
50 class Frame; | 50 class Frame; |
51 class NodeFilter; | |
52 class ScriptExecutionContext; | 51 class ScriptExecutionContext; |
53 class ScriptWrappable; | 52 class ScriptWrappable; |
54 class XPathNSResolver; | 53 class XPathNSResolver; |
55 | 54 |
56 const int kMaxRecursionDepth = 22; | 55 const int kMaxRecursionDepth = 22; |
57 | 56 |
58 // Schedule a DOM exception to be thrown, if the exception code is different | 57 // Schedule a DOM exception to be thrown, if the exception code is different |
59 // from zero. | 58 // from zero. |
60 v8::Handle<v8::Value> setDOMException(int, v8::Isolate*); | 59 v8::Handle<v8::Value> setDOMException(int, v8::Isolate*); |
61 v8::Handle<v8::Value> setDOMException(int, const String&, v8::Isolate*); | 60 v8::Handle<v8::Value> setDOMException(int, const String&, v8::Isolate*); |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 throwTypeError(isolate); | 504 throwTypeError(isolate); |
506 return v8Undefined(); | 505 return v8Undefined(); |
507 } | 506 } |
508 | 507 |
509 V8TRYCATCH(uint32_t, sequenceLength, lengthValue->Int32Value()); | 508 V8TRYCATCH(uint32_t, sequenceLength, lengthValue->Int32Value()); |
510 length = sequenceLength; | 509 length = sequenceLength; |
511 | 510 |
512 return v8Value; | 511 return v8Value; |
513 } | 512 } |
514 | 513 |
515 PassRefPtr<NodeFilter> toNodeFilter(v8::Handle<v8::Value>); | |
516 | |
517 inline bool isUndefinedOrNull(v8::Handle<v8::Value> value) | 514 inline bool isUndefinedOrNull(v8::Handle<v8::Value> value) |
518 { | 515 { |
519 return value->IsNull() || value->IsUndefined(); | 516 return value->IsNull() || value->IsUndefined(); |
520 } | 517 } |
521 | 518 |
522 // Returns true if the provided object is to be considered a 'host object',
as used in the | 519 // Returns true if the provided object is to be considered a 'host object',
as used in the |
523 // HTML5 structured clone algorithm. | 520 // HTML5 structured clone algorithm. |
524 inline bool isHostObject(v8::Handle<v8::Object> object) | 521 inline bool isHostObject(v8::Handle<v8::Object> object) |
525 { | 522 { |
526 // If the object has any internal fields, then we won't be able to seria
lize or deserialize | 523 // If the object has any internal fields, then we won't be able to seria
lize or deserialize |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 inline v8::Local<v8::Function> createClosure(v8::FunctionCallback function,
v8::Handle<v8::Value> environment) | 618 inline v8::Local<v8::Function> createClosure(v8::FunctionCallback function,
v8::Handle<v8::Value> environment) |
622 { | 619 { |
623 return v8::FunctionTemplate::New(function, environment)->GetFunction(); | 620 return v8::FunctionTemplate::New(function, environment)->GetFunction(); |
624 } | 621 } |
625 | 622 |
626 v8::Local<v8::Value> getHiddenValueFromMainWorldWrapper(v8::Isolate*, Script
Wrappable*, v8::Handle<v8::String> key); | 623 v8::Local<v8::Value> getHiddenValueFromMainWorldWrapper(v8::Isolate*, Script
Wrappable*, v8::Handle<v8::String> key); |
627 | 624 |
628 } // namespace WebCore | 625 } // namespace WebCore |
629 | 626 |
630 #endif // V8Binding_h | 627 #endif // V8Binding_h |
OLD | NEW |