| OLD | NEW |
| 1 // Copyright (c) 2008, Google Inc. | 1 // Copyright (c) 2008, Google Inc. |
| 2 // All rights reserved. | 2 // 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 { | 46 { |
| 47 return adoptRefWillBeNoop(new V8CustomXPathNSResolver(resolver, isolate)); | 47 return adoptRefWillBeNoop(new V8CustomXPathNSResolver(resolver, isolate)); |
| 48 } | 48 } |
| 49 | 49 |
| 50 V8CustomXPathNSResolver::V8CustomXPathNSResolver(v8::Handle<v8::Object> resolver
, v8::Isolate* isolate) | 50 V8CustomXPathNSResolver::V8CustomXPathNSResolver(v8::Handle<v8::Object> resolver
, v8::Isolate* isolate) |
| 51 : m_resolver(resolver) | 51 : m_resolver(resolver) |
| 52 , m_isolate(isolate) | 52 , m_isolate(isolate) |
| 53 { | 53 { |
| 54 } | 54 } |
| 55 | 55 |
| 56 V8CustomXPathNSResolver::~V8CustomXPathNSResolver() | |
| 57 { | |
| 58 } | |
| 59 | |
| 60 AtomicString V8CustomXPathNSResolver::lookupNamespaceURI(const String& prefix) | 56 AtomicString V8CustomXPathNSResolver::lookupNamespaceURI(const String& prefix) |
| 61 { | 57 { |
| 62 v8::Handle<v8::Function> lookupNamespaceURIFunc; | 58 v8::Handle<v8::Function> lookupNamespaceURIFunc; |
| 63 v8::Handle<v8::String> lookupNamespaceURIName = v8AtomicString(m_isolate, "l
ookupNamespaceURI"); | 59 v8::Handle<v8::String> lookupNamespaceURIName = v8AtomicString(m_isolate, "l
ookupNamespaceURI"); |
| 64 | 60 |
| 65 // Check if the resolver has a function property named lookupNamespaceURI. | 61 // Check if the resolver has a function property named lookupNamespaceURI. |
| 66 if (m_resolver->Has(lookupNamespaceURIName)) { | 62 if (m_resolver->Has(lookupNamespaceURIName)) { |
| 67 v8::Handle<v8::Value> lookupNamespaceURI = m_resolver->Get(lookupNamespa
ceURIName); | 63 v8::Handle<v8::Value> lookupNamespaceURI = m_resolver->Get(lookupNamespa
ceURIName); |
| 68 if (lookupNamespaceURI->IsFunction()) | 64 if (lookupNamespaceURI->IsFunction()) |
| 69 lookupNamespaceURIFunc = v8::Handle<v8::Function>::Cast(lookupNamesp
aceURI); | 65 lookupNamespaceURIFunc = v8::Handle<v8::Function>::Cast(lookupNamesp
aceURI); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 93 TOSTRING_DEFAULT(V8StringResource<WithNullCheck>, returnString, retval, null
Atom); | 89 TOSTRING_DEFAULT(V8StringResource<WithNullCheck>, returnString, retval, null
Atom); |
| 94 return returnString; | 90 return returnString; |
| 95 } | 91 } |
| 96 | 92 |
| 97 void V8CustomXPathNSResolver::trace(Visitor* visitor) | 93 void V8CustomXPathNSResolver::trace(Visitor* visitor) |
| 98 { | 94 { |
| 99 XPathNSResolver::trace(visitor); | 95 XPathNSResolver::trace(visitor); |
| 100 } | 96 } |
| 101 | 97 |
| 102 } // namespace WebCore | 98 } // namespace WebCore |
| OLD | NEW |