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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 if (isUndefinedOrNull(value)) { | 69 if (isUndefinedOrNull(value)) { |
70 ports.resize(0); | 70 ports.resize(0); |
71 arrayBuffers.resize(0); | 71 arrayBuffers.resize(0); |
72 return true; | 72 return true; |
73 } | 73 } |
74 | 74 |
75 uint32_t length = 0; | 75 uint32_t length = 0; |
76 if (value->IsArray()) { | 76 if (value->IsArray()) { |
77 v8::Local<v8::Array> array = v8::Local<v8::Array>::Cast(value); | 77 v8::Local<v8::Array> array = v8::Local<v8::Array>::Cast(value); |
78 length = array->Length(); | 78 length = array->Length(); |
79 } else { | 79 } else if (toV8Sequence(value, length, isolate).IsEmpty()) { |
80 if (toV8Sequence(value, length, notASequence, isolate).IsEmpty()) | 80 notASequence = true; |
81 return false; | 81 return false; |
82 } | 82 } |
83 | 83 |
84 v8::Local<v8::Object> transferrables = v8::Local<v8::Object>::Cast(value); | 84 v8::Local<v8::Object> transferrables = v8::Local<v8::Object>::Cast(value); |
85 | 85 |
86 // Validate the passed array of transferrables. | 86 // Validate the passed array of transferrables. |
87 for (unsigned int i = 0; i < length; ++i) { | 87 for (unsigned int i = 0; i < length; ++i) { |
88 v8::Local<v8::Value> transferrable = transferrables->Get(i); | 88 v8::Local<v8::Value> transferrable = transferrables->Get(i); |
89 // Validation of non-null objects, per HTML5 spec 10.3.3. | 89 // Validation of non-null objects, per HTML5 spec 10.3.3. |
90 if (isUndefinedOrNull(transferrable)) { | 90 if (isUndefinedOrNull(transferrable)) { |
91 setDOMException(DataCloneError, isolate); | 91 setDOMException(DataCloneError, isolate); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 | 172 |
173 ExecutionContext* getExecutionContext() | 173 ExecutionContext* getExecutionContext() |
174 { | 174 { |
175 if (WorkerScriptController* controller = WorkerScriptController::controllerF
orContext()) | 175 if (WorkerScriptController* controller = WorkerScriptController::controllerF
orContext()) |
176 return &controller->workerGlobalScope(); | 176 return &controller->workerGlobalScope(); |
177 | 177 |
178 return currentDocument(); | 178 return currentDocument(); |
179 } | 179 } |
180 | 180 |
181 } // namespace WebCore | 181 } // namespace WebCore |
OLD | NEW |