Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: Source/bindings/v8/V8Binding.h

Issue 232563003: API functions returning Promises should not throw exceptions. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 // FIXME: Remove the special casing for NodeFilter and XPathNSResolver. 442 // FIXME: Remove the special casing for NodeFilter and XPathNSResolver.
443 PassRefPtr<NodeFilter> toNodeFilter(v8::Handle<v8::Value>, v8::Isolate*); 443 PassRefPtr<NodeFilter> toNodeFilter(v8::Handle<v8::Value>, v8::Isolate*);
444 PassRefPtrWillBeRawPtr<XPathNSResolver> toXPathNSResolver(v8::Handle<v8::Value>, v8::Isolate*); 444 PassRefPtrWillBeRawPtr<XPathNSResolver> toXPathNSResolver(v8::Handle<v8::Value>, v8::Isolate*);
445 445
446 template<class T> struct NativeValueTraits; 446 template<class T> struct NativeValueTraits;
447 447
448 template<> 448 template<>
449 struct NativeValueTraits<String> { 449 struct NativeValueTraits<String> {
450 static inline String nativeValue(const v8::Handle<v8::Value>& value, v8::Iso late* isolate) 450 static inline String nativeValue(const v8::Handle<v8::Value>& value, v8::Iso late* isolate)
451 { 451 {
452 TOSTRING_BOOL(V8StringResource<>, stringValue, value, String()); 452 V8StringResource<> stringValue = value;
453 if (UNLIKELY(!stringValue.prepare())) {
454 return String();
455 }
453 return stringValue; 456 return stringValue;
454 } 457 }
455 }; 458 };
456 459
457 template<> 460 template<>
458 struct NativeValueTraits<unsigned> { 461 struct NativeValueTraits<unsigned> {
459 static inline unsigned nativeValue(const v8::Handle<v8::Value>& value, v8::I solate* isolate) 462 static inline unsigned nativeValue(const v8::Handle<v8::Value>& value, v8::I solate* isolate)
460 { 463 {
461 return toUInt32(value); 464 return toUInt32(value);
462 } 465 }
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 762
760 private: 763 private:
761 v8::HandleScope m_handleScope; 764 v8::HandleScope m_handleScope;
762 v8::Context::Scope m_contextScope; 765 v8::Context::Scope m_contextScope;
763 RefPtr<NewScriptState> m_scriptState; 766 RefPtr<NewScriptState> m_scriptState;
764 }; 767 };
765 768
766 } // namespace WebCore 769 } // namespace WebCore
767 770
768 #endif // V8Binding_h 771 #endif // V8Binding_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698