OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009 Google Inc. 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 case NPVariantType_Void: | 93 case NPVariantType_Void: |
94 return v8::Undefined(isolate); | 94 return v8::Undefined(isolate); |
95 case NPVariantType_String: { | 95 case NPVariantType_String: { |
96 NPString src = NPVARIANT_TO_STRING(*variant); | 96 NPString src = NPVARIANT_TO_STRING(*variant); |
97 return v8::String::NewFromUtf8(isolate, src.UTF8Characters, v8::String::
kNormalString, src.UTF8Length); | 97 return v8::String::NewFromUtf8(isolate, src.UTF8Characters, v8::String::
kNormalString, src.UTF8Length); |
98 } | 98 } |
99 case NPVariantType_Object: { | 99 case NPVariantType_Object: { |
100 NPObject* object = NPVARIANT_TO_OBJECT(*variant); | 100 NPObject* object = NPVARIANT_TO_OBJECT(*variant); |
101 if (V8NPObject* v8Object = npObjectToV8NPObject(object)) | 101 if (V8NPObject* v8Object = npObjectToV8NPObject(object)) |
102 return v8::Local<v8::Object>::New(isolate, v8Object->v8Object); | 102 return v8::Local<v8::Object>::New(isolate, v8Object->v8Object); |
103 return createV8ObjectForNPObject(object, owner, isolate); | 103 return createV8ObjectForNPObject(isolate, object, owner); |
104 } | 104 } |
105 default: | 105 default: |
106 return v8::Undefined(isolate); | 106 return v8::Undefined(isolate); |
107 } | 107 } |
108 } | 108 } |
109 | 109 |
110 // Helper function to create an NPN String Identifier from a v8 string. | 110 // Helper function to create an NPN String Identifier from a v8 string. |
111 NPIdentifier getStringIdentifier(v8::Handle<v8::String> str) | 111 NPIdentifier getStringIdentifier(v8::Handle<v8::String> str) |
112 { | 112 { |
113 const int kStackBufferSize = 100; | 113 const int kStackBufferSize = 100; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 ExceptionCatcher::~ExceptionCatcher() | 162 ExceptionCatcher::~ExceptionCatcher() |
163 { | 163 { |
164 if (!m_tryCatch.HasCaught()) | 164 if (!m_tryCatch.HasCaught()) |
165 return; | 165 return; |
166 | 166 |
167 if (topHandler) | 167 if (topHandler) |
168 topHandler->handler(topHandler->data, *v8::String::Utf8Value(m_tryCatch.
Exception())); | 168 topHandler->handler(topHandler->data, *v8::String::Utf8Value(m_tryCatch.
Exception())); |
169 } | 169 } |
170 | 170 |
171 } // namespace blink | 171 } // namespace blink |
OLD | NEW |