| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 { | 46 { |
| 47 MessageEvent* event = V8MessageEvent::toNative(info.Holder()); | 47 MessageEvent* event = V8MessageEvent::toNative(info.Holder()); |
| 48 | 48 |
| 49 v8::Handle<v8::Value> result; | 49 v8::Handle<v8::Value> result; |
| 50 switch (event->dataType()) { | 50 switch (event->dataType()) { |
| 51 case MessageEvent::DataTypeScriptValue: { | 51 case MessageEvent::DataTypeScriptValue: { |
| 52 ScriptValue scriptValue = event->dataAsScriptValue(); | 52 ScriptValue scriptValue = event->dataAsScriptValue(); |
| 53 if (scriptValue.hasNoValue()) | 53 if (scriptValue.hasNoValue()) |
| 54 result = v8Null(info.GetIsolate()); | 54 result = v8Null(info.GetIsolate()); |
| 55 else | 55 else |
| 56 result = v8::Local<v8::Value>::New(scriptValue.v8Value()); | 56 result = scriptValue.v8Value(); |
| 57 break; | 57 break; |
| 58 } | 58 } |
| 59 | 59 |
| 60 case MessageEvent::DataTypeSerializedScriptValue: | 60 case MessageEvent::DataTypeSerializedScriptValue: |
| 61 if (RefPtr<SerializedScriptValue> serializedValue = event->dataAsSeriali
zedScriptValue()) | 61 if (RefPtr<SerializedScriptValue> serializedValue = event->dataAsSeriali
zedScriptValue()) |
| 62 result = serializedValue->deserialize(info.GetIsolate(), event->port
s()); | 62 result = serializedValue->deserialize(info.GetIsolate(), event->port
s()); |
| 63 else | 63 else |
| 64 result = v8Null(info.GetIsolate()); | 64 result = v8Null(info.GetIsolate()); |
| 65 break; | 65 break; |
| 66 | 66 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 return v8::Undefined(); | 131 return v8::Undefined(); |
| 132 } | 132 } |
| 133 | 133 |
| 134 v8::Handle<v8::Value> V8MessageEvent::webkitInitMessageEventCallback(const v8::A
rguments& args) | 134 v8::Handle<v8::Value> V8MessageEvent::webkitInitMessageEventCallback(const v8::A
rguments& args) |
| 135 { | 135 { |
| 136 return initMessageEventCallback(args); | 136 return initMessageEventCallback(args); |
| 137 } | 137 } |
| 138 | 138 |
| 139 | 139 |
| 140 } // namespace WebCore | 140 } // namespace WebCore |
| OLD | NEW |