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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 } | 79 } |
80 | 80 |
81 SerializedScriptValue::SerializedScriptValue() | 81 SerializedScriptValue::SerializedScriptValue() |
82 : m_externallyAllocatedMemory(0) | 82 : m_externallyAllocatedMemory(0) |
83 { | 83 { |
84 } | 84 } |
85 | 85 |
86 static void acculumateArrayBuffersForAllWorlds(v8::Isolate* isolate, DOMArrayBuf
fer* object, Vector<v8::Local<v8::ArrayBuffer>, 4>& buffers) | 86 static void acculumateArrayBuffersForAllWorlds(v8::Isolate* isolate, DOMArrayBuf
fer* object, Vector<v8::Local<v8::ArrayBuffer>, 4>& buffers) |
87 { | 87 { |
88 if (isMainThread()) { | 88 if (isMainThread()) { |
89 Vector<RefPtr<DOMWrapperWorld> > worlds; | 89 Vector<RefPtr<DOMWrapperWorld>> worlds; |
90 DOMWrapperWorld::allWorldsInMainThread(worlds); | 90 DOMWrapperWorld::allWorldsInMainThread(worlds); |
91 for (size_t i = 0; i < worlds.size(); i++) { | 91 for (size_t i = 0; i < worlds.size(); i++) { |
92 v8::Handle<v8::Object> wrapper = worlds[i]->domDataStore().get(objec
t, isolate); | 92 v8::Handle<v8::Object> wrapper = worlds[i]->domDataStore().get(objec
t, isolate); |
93 if (!wrapper.IsEmpty()) | 93 if (!wrapper.IsEmpty()) |
94 buffers.append(v8::Handle<v8::ArrayBuffer>::Cast(wrapper)); | 94 buffers.append(v8::Handle<v8::ArrayBuffer>::Cast(wrapper)); |
95 } | 95 } |
96 } else { | 96 } else { |
97 v8::Handle<v8::Object> wrapper = DOMWrapperWorld::current(isolate).domDa
taStore().get(object, isolate); | 97 v8::Handle<v8::Object> wrapper = DOMWrapperWorld::current(isolate).domDa
taStore().get(object, isolate); |
98 if (!wrapper.IsEmpty()) | 98 if (!wrapper.IsEmpty()) |
99 buffers.append(v8::Handle<v8::ArrayBuffer>::Cast(wrapper)); | 99 buffers.append(v8::Handle<v8::ArrayBuffer>::Cast(wrapper)); |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(-m_exte
rnallyAllocatedMemory); | 228 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(-m_exte
rnallyAllocatedMemory); |
229 } | 229 } |
230 } | 230 } |
231 | 231 |
232 void SerializedScriptValue::transferArrayBuffers(v8::Isolate* isolate, ArrayBuff
erArray& arrayBuffers, ExceptionState& exceptionState) | 232 void SerializedScriptValue::transferArrayBuffers(v8::Isolate* isolate, ArrayBuff
erArray& arrayBuffers, ExceptionState& exceptionState) |
233 { | 233 { |
234 m_arrayBufferContentsArray = createArrayBuffers(isolate, arrayBuffers, excep
tionState); | 234 m_arrayBufferContentsArray = createArrayBuffers(isolate, arrayBuffers, excep
tionState); |
235 } | 235 } |
236 | 236 |
237 } // namespace blink | 237 } // namespace blink |
OLD | NEW |