Chromium Code Reviews| Index: Source/bindings/core/v8/V8StringResource.h |
| diff --git a/Source/bindings/core/v8/V8StringResource.h b/Source/bindings/core/v8/V8StringResource.h |
| index a061f6146072bdf338e5262cdf035425bdc7c7dd..f6f3b2de155e54744f605e231f3ac7569e4a508f 100644 |
| --- a/Source/bindings/core/v8/V8StringResource.h |
| +++ b/Source/bindings/core/v8/V8StringResource.h |
| @@ -26,6 +26,7 @@ |
| #ifndef V8StringResource_h |
| #define V8StringResource_h |
| +#include "bindings/core/v8/ExceptionState.h" |
| #include "wtf/Threading.h" |
| #include "wtf/text/AtomicString.h" |
| #include "wtf/text/WTFString.h" |
| @@ -198,6 +199,40 @@ public: |
| bool prepare() |
| { |
| + if (prepareSimple()) |
|
haraken
2014/09/24 09:29:49
prepareFast ? (We normally add "Fast" for a fast p
Jens Widell
2014/09/24 10:00:19
Done.
|
| + return true; |
| + |
| + v8::TryCatch block; |
| + m_v8Object = m_v8Object->ToString(); |
| + // Handle the case where an exception is thrown as part of invoking toString on the object. |
| + if (block.HasCaught()) { |
| + block.ReThrow(); |
| + return false; |
| + } |
| + return true; |
| + } |
| + |
| + bool prepare(ExceptionState& exceptionState) |
| + { |
| + if (prepareSimple()) |
| + return true; |
| + |
| + v8::TryCatch block; |
| + m_v8Object = m_v8Object->ToString(); |
| + // Handle the case where an exception is thrown as part of invoking toString on the object. |
| + if (block.HasCaught()) { |
| + exceptionState.rethrowV8Exception(block.Exception()); |
| + return false; |
| + } |
| + return true; |
| + } |
| + |
| + operator String() const { return toString<String>(); } |
| + operator AtomicString() const { return toString<AtomicString>(); } |
| + |
| +private: |
| + bool prepareSimple() |
| + { |
| if (m_v8Object.IsEmpty()) |
| return true; |
| @@ -215,19 +250,9 @@ public: |
| } |
| m_mode = DoNotExternalize; |
| - v8::TryCatch block; |
| - m_v8Object = m_v8Object->ToString(); |
| - // Handle the case where an exception is thrown as part of invoking toString on the object. |
| - if (block.HasCaught()) { |
| - block.ReThrow(); |
| - return false; |
| - } |
| - return true; |
| + return false; |
| } |
| - operator String() const { return toString<String>(); } |
| - operator AtomicString() const { return toString<AtomicString>(); } |
| -private: |
| bool isValid() const; |
| String fallbackString() const; |