| 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 int targetOriginArgIndex = 1; | 259 int targetOriginArgIndex = 1; |
| 260 if (args.Length() > 2) { | 260 if (args.Length() > 2) { |
| 261 int transferablesArgIndex = 2; | 261 int transferablesArgIndex = 2; |
| 262 if (isLegacyTargetOriginDesignation(args[2])) { | 262 if (isLegacyTargetOriginDesignation(args[2])) { |
| 263 targetOriginArgIndex = 2; | 263 targetOriginArgIndex = 2; |
| 264 transferablesArgIndex = 1; | 264 transferablesArgIndex = 1; |
| 265 } | 265 } |
| 266 bool notASequence = false; | 266 bool notASequence = false; |
| 267 if (!extractTransferables(args[transferablesArgIndex], portArray, arrayB
ufferArray, notASequence, args.GetIsolate())) { | 267 if (!extractTransferables(args[transferablesArgIndex], portArray, arrayB
ufferArray, notASequence, args.GetIsolate())) { |
| 268 if (notASequence) | 268 if (notASequence) |
| 269 throwTypeError(ExceptionMessages::failedToExecute("postMessage",
"Window", ExceptionMessages::notASequenceType(transferablesArgIndex == 1 ? "Sec
ond" : "Third")), args.GetIsolate()); | 269 throwTypeError(ExceptionMessages::failedToExecute("postMessage",
"Window", ExceptionMessages::notASequenceTypeArgumentOrValue(transferablesArgIn
dex + 1)), args.GetIsolate()); |
| 270 return; | 270 return; |
| 271 } | 271 } |
| 272 } | 272 } |
| 273 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullChe
ck>, targetOrigin, args[targetOriginArgIndex]); | 273 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullChe
ck>, targetOrigin, args[targetOriginArgIndex]); |
| 274 | 274 |
| 275 bool didThrow = false; | 275 bool didThrow = false; |
| 276 RefPtr<SerializedScriptValue> message = | 276 RefPtr<SerializedScriptValue> message = |
| 277 SerializedScriptValue::create(args[0], &portArray, &arrayBufferArray, di
dThrow, args.GetIsolate()); | 277 SerializedScriptValue::create(args[0], &portArray, &arrayBufferArray, di
dThrow, args.GetIsolate()); |
| 278 if (didThrow) | 278 if (didThrow) |
| 279 return; | 279 return; |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 v8::Handle<v8::Context> context = frame->script().currentWorldContext(); | 543 v8::Handle<v8::Context> context = frame->script().currentWorldContext(); |
| 544 if (context.IsEmpty()) | 544 if (context.IsEmpty()) |
| 545 return v8Undefined(); | 545 return v8Undefined(); |
| 546 | 546 |
| 547 v8::Handle<v8::Object> global = context->Global(); | 547 v8::Handle<v8::Object> global = context->Global(); |
| 548 ASSERT(!global.IsEmpty()); | 548 ASSERT(!global.IsEmpty()); |
| 549 return global; | 549 return global; |
| 550 } | 550 } |
| 551 | 551 |
| 552 } // namespace WebCore | 552 } // namespace WebCore |
| OLD | NEW |