Chromium Code Reviews| 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 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 528 } | 528 } |
| 529 | 529 |
| 530 // FIXME: Remove the special casing for NodeFilter and XPathNSResolver. | 530 // FIXME: Remove the special casing for NodeFilter and XPathNSResolver. |
| 531 PassRefPtr<NodeFilter> toNodeFilter(v8::Handle<v8::Value>, v8::Isolate*); | 531 PassRefPtr<NodeFilter> toNodeFilter(v8::Handle<v8::Value>, v8::Isolate*); |
| 532 PassRefPtrWillBeRawPtr<XPathNSResolver> toXPathNSResolver(v8::Handle<v8::Value>, v8::Isolate*); | 532 PassRefPtrWillBeRawPtr<XPathNSResolver> toXPathNSResolver(v8::Handle<v8::Value>, v8::Isolate*); |
| 533 | 533 |
| 534 template<class T> struct NativeValueTraits; | 534 template<class T> struct NativeValueTraits; |
| 535 | 535 |
| 536 template<> | 536 template<> |
| 537 struct NativeValueTraits<String> { | 537 struct NativeValueTraits<String> { |
| 538 static inline String nativeValue(const v8::Handle<v8::Value>& value, v8::Iso late* isolate) | 538 static inline String nativeValue(const v8::Handle<v8::Value>& value, v8::Iso late* isolate) |
|
yhirano
2014/04/24 06:52:51
Because this function is used in another v8::TryCa
| |
| 539 { | 539 { |
| 540 TOSTRING_DEFAULT(V8StringResource<>, stringValue, value, String()); | 540 V8StringResource<> stringValue(value); |
| 541 // Because V8StringResourceToString<DoNotCatch>::call doesn't use the | |
| 542 // instance object, we can pass null pointer. | |
| 543 if (UNLIKELY(!stringValue.init<V8StringResourceDoNotCatchException>(0))) | |
| 544 return String(); | |
| 541 return stringValue; | 545 return stringValue; |
| 542 } | 546 } |
| 543 }; | 547 }; |
| 544 | 548 |
| 545 template<> | 549 template<> |
| 546 struct NativeValueTraits<unsigned> { | 550 struct NativeValueTraits<unsigned> { |
| 547 static inline unsigned nativeValue(const v8::Handle<v8::Value>& value, v8::I solate* isolate) | 551 static inline unsigned nativeValue(const v8::Handle<v8::Value>& value, v8::I solate* isolate) |
| 548 { | 552 { |
| 549 return toUInt32(value); | 553 return toUInt32(value); |
| 550 } | 554 } |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 906 | 910 |
| 907 private: | 911 private: |
| 908 v8::HandleScope m_handleScope; | 912 v8::HandleScope m_handleScope; |
| 909 v8::Context::Scope m_contextScope; | 913 v8::Context::Scope m_contextScope; |
| 910 RefPtr<NewScriptState> m_scriptState; | 914 RefPtr<NewScriptState> m_scriptState; |
| 911 }; | 915 }; |
| 912 | 916 |
| 913 } // namespace WebCore | 917 } // namespace WebCore |
| 914 | 918 |
| 915 #endif // V8Binding_h | 919 #endif // V8Binding_h |
| OLD | NEW |