OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2009, 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2011 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 28 matching lines...) Expand all Loading... | |
39 #include "wtf/ArrayBuffer.h" | 39 #include "wtf/ArrayBuffer.h" |
40 | 40 |
41 namespace WebCore { | 41 namespace WebCore { |
42 | 42 |
43 void V8MessagePort::postMessageMethodCustom(const v8::FunctionCallbackInfo<v8::V alue>& args) | 43 void V8MessagePort::postMessageMethodCustom(const v8::FunctionCallbackInfo<v8::V alue>& args) |
44 { | 44 { |
45 MessagePort* messagePort = V8MessagePort::toNative(args.Holder()); | 45 MessagePort* messagePort = V8MessagePort::toNative(args.Holder()); |
46 MessagePortArray portArray; | 46 MessagePortArray portArray; |
47 ArrayBufferArray arrayBufferArray; | 47 ArrayBufferArray arrayBufferArray; |
48 if (args.Length() > 1) { | 48 if (args.Length() > 1) { |
49 if (!extractTransferables(args[1], portArray, arrayBufferArray, args.Get Isolate())) | 49 if (!extractTransferables(args[1], portArray, arrayBufferArray, |
50 args.GetIsolate(), "Second argument is not a sequence type")) | |
Mike West
2013/10/21 06:51:22
Same comments here as V8DedicatedWorkerGlobalScope
| |
50 return; | 51 return; |
51 } | 52 } |
52 bool didThrow = false; | 53 bool didThrow = false; |
53 RefPtr<SerializedScriptValue> message = | 54 RefPtr<SerializedScriptValue> message = |
54 SerializedScriptValue::create(args[0], | 55 SerializedScriptValue::create(args[0], |
55 &portArray, | 56 &portArray, |
56 &arrayBufferArray, | 57 &arrayBufferArray, |
57 didThrow, | 58 didThrow, |
58 args.GetIsolate()); | 59 args.GetIsolate()); |
59 if (didThrow) | 60 if (didThrow) |
60 return; | 61 return; |
61 ExceptionState es(args.GetIsolate()); | 62 ExceptionState es(args.GetIsolate()); |
62 messagePort->postMessage(message.release(), &portArray, es); | 63 messagePort->postMessage(message.release(), &portArray, es); |
63 es.throwIfNeeded(); | 64 es.throwIfNeeded(); |
64 } | 65 } |
65 | 66 |
66 } // namespace WebCore | 67 } // namespace WebCore |
OLD | NEW |