Chromium Code Reviews| 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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 255 // postMessage(message, {sequence of transferrables}, targetOrigin); | 255 // postMessage(message, {sequence of transferrables}, targetOrigin); |
| 256 MessagePortArray portArray; | 256 MessagePortArray portArray; |
| 257 ArrayBufferArray arrayBufferArray; | 257 ArrayBufferArray arrayBufferArray; |
| 258 int targetOriginArgIndex = 1; | 258 int targetOriginArgIndex = 1; |
| 259 if (args.Length() > 2) { | 259 if (args.Length() > 2) { |
| 260 int transferablesArgIndex = 2; | 260 int transferablesArgIndex = 2; |
| 261 if (isLegacyTargetOriginDesignation(args[2])) { | 261 if (isLegacyTargetOriginDesignation(args[2])) { |
| 262 targetOriginArgIndex = 2; | 262 targetOriginArgIndex = 2; |
| 263 transferablesArgIndex = 1; | 263 transferablesArgIndex = 1; |
| 264 } | 264 } |
| 265 if (!extractTransferables(args[transferablesArgIndex], portArray, arrayB ufferArray, args.GetIsolate())) | 265 String typeErrorMessage(transferablesArgIndex == 1 ? "Second argument is not a sequence type" : "Third argument is not a sequence type"); |
|
Mike West
2013/10/21 06:51:22
Ditto.
| |
| 266 if (!extractTransferables(args[transferablesArgIndex], portArray, arrayB ufferArray, args.GetIsolate(), typeErrorMessage)) | |
| 266 return; | 267 return; |
| 267 } | 268 } |
| 268 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullChe ck>, targetOrigin, args[targetOriginArgIndex]); | 269 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullChe ck>, targetOrigin, args[targetOriginArgIndex]); |
| 269 | 270 |
| 270 bool didThrow = false; | 271 bool didThrow = false; |
| 271 RefPtr<SerializedScriptValue> message = | 272 RefPtr<SerializedScriptValue> message = |
| 272 SerializedScriptValue::create(args[0], &portArray, &arrayBufferArray, di dThrow, args.GetIsolate()); | 273 SerializedScriptValue::create(args[0], &portArray, &arrayBufferArray, di dThrow, args.GetIsolate()); |
| 273 if (didThrow) | 274 if (didThrow) |
| 274 return; | 275 return; |
| 275 | 276 |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 538 v8::Handle<v8::Context> context = frame->script()->currentWorldContext(); | 539 v8::Handle<v8::Context> context = frame->script()->currentWorldContext(); |
| 539 if (context.IsEmpty()) | 540 if (context.IsEmpty()) |
| 540 return v8Undefined(); | 541 return v8Undefined(); |
| 541 | 542 |
| 542 v8::Handle<v8::Object> global = context->Global(); | 543 v8::Handle<v8::Object> global = context->Global(); |
| 543 ASSERT(!global.IsEmpty()); | 544 ASSERT(!global.IsEmpty()); |
| 544 return global; | 545 return global; |
| 545 } | 546 } |
| 546 | 547 |
| 547 } // namespace WebCore | 548 } // namespace WebCore |
| OLD | NEW |