OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 2904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2915 if (visited.contains(arrayBuffers[i].get())) | 2915 if (visited.contains(arrayBuffers[i].get())) |
2916 continue; | 2916 continue; |
2917 visited.add(arrayBuffers[i].get()); | 2917 visited.add(arrayBuffers[i].get()); |
2918 | 2918 |
2919 bool result = arrayBuffers[i]->transfer(contents->at(i)); | 2919 bool result = arrayBuffers[i]->transfer(contents->at(i)); |
2920 if (!result) { | 2920 if (!result) { |
2921 exceptionState.throwDOMException(DataCloneError, "ArrayBuffer at ind
ex " + String::number(i) + " could not be transferred."); | 2921 exceptionState.throwDOMException(DataCloneError, "ArrayBuffer at ind
ex " + String::number(i) + " could not be transferred."); |
2922 return nullptr; | 2922 return nullptr; |
2923 } | 2923 } |
2924 | 2924 |
2925 neuterArrayBufferInAllWorlds(arrayBuffers[i].get()); | 2925 if (!arrayBuffers[i]->isShared()) { |
| 2926 neuterArrayBufferInAllWorlds(arrayBuffers[i].get()); |
| 2927 } |
2926 } | 2928 } |
2927 return contents.release(); | 2929 return contents.release(); |
2928 } | 2930 } |
2929 | 2931 |
2930 SerializedScriptValue::SerializedScriptValue(v8::Handle<v8::Value> value, Messag
ePortArray* messagePorts, ArrayBufferArray* arrayBuffers, WebBlobInfoArray* blob
Info, ExceptionState& exceptionState, v8::Isolate* isolate) | 2932 SerializedScriptValue::SerializedScriptValue(v8::Handle<v8::Value> value, Messag
ePortArray* messagePorts, ArrayBufferArray* arrayBuffers, WebBlobInfoArray* blob
Info, ExceptionState& exceptionState, v8::Isolate* isolate) |
2931 : m_externallyAllocatedMemory(0) | 2933 : m_externallyAllocatedMemory(0) |
2932 { | 2934 { |
2933 Writer writer; | 2935 Writer writer; |
2934 Serializer::Status status; | 2936 Serializer::Status status; |
2935 String errorMessage; | 2937 String errorMessage; |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3056 // If the allocated memory was not registered before, then this class is lik
ely | 3058 // If the allocated memory was not registered before, then this class is lik
ely |
3057 // used in a context other then Worker's onmessage environment and the prese
nce of | 3059 // used in a context other then Worker's onmessage environment and the prese
nce of |
3058 // current v8 context is not guaranteed. Avoid calling v8 then. | 3060 // current v8 context is not guaranteed. Avoid calling v8 then. |
3059 if (m_externallyAllocatedMemory) { | 3061 if (m_externallyAllocatedMemory) { |
3060 ASSERT(v8::Isolate::GetCurrent()); | 3062 ASSERT(v8::Isolate::GetCurrent()); |
3061 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(-m_exte
rnallyAllocatedMemory); | 3063 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(-m_exte
rnallyAllocatedMemory); |
3062 } | 3064 } |
3063 } | 3065 } |
3064 | 3066 |
3065 } // namespace WebCore | 3067 } // namespace WebCore |
OLD | NEW |