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 2308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2319 | 2319 |
2320 SerializedScriptValue::SerializedScriptValue() | 2320 SerializedScriptValue::SerializedScriptValue() |
2321 : m_externallyAllocatedMemory(0) | 2321 : m_externallyAllocatedMemory(0) |
2322 { | 2322 { |
2323 } | 2323 } |
2324 | 2324 |
2325 static void neuterArrayBufferInAllWorlds(ArrayBuffer* object) | 2325 static void neuterArrayBufferInAllWorlds(ArrayBuffer* object) |
2326 { | 2326 { |
2327 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 2327 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
2328 if (isMainThread()) { | 2328 if (isMainThread()) { |
2329 Vector<RefPtr<DOMWrapperWorld> > worlds; | 2329 Vector<DOMWrapperWorld*> worlds; |
2330 DOMWrapperWorld::allWorldsInMainThread(worlds); | 2330 DOMWrapperWorld::allWorldsInMainThread(worlds); |
2331 for (size_t i = 0; i < worlds.size(); i++) { | 2331 for (size_t i = 0; i < worlds.size(); i++) { |
2332 v8::Handle<v8::Object> wrapper = worlds[i]->domDataStore().get<V8Arr
ayBuffer>(object, isolate); | 2332 v8::Handle<v8::Object> wrapper = worlds[i]->domDataStore().get<V8Arr
ayBuffer>(object, isolate); |
2333 if (!wrapper.IsEmpty()) { | 2333 if (!wrapper.IsEmpty()) { |
2334 ASSERT(wrapper->IsArrayBuffer()); | 2334 ASSERT(wrapper->IsArrayBuffer()); |
2335 v8::Handle<v8::ArrayBuffer>::Cast(wrapper)->Neuter(); | 2335 v8::Handle<v8::ArrayBuffer>::Cast(wrapper)->Neuter(); |
2336 } | 2336 } |
2337 } | 2337 } |
2338 } else { | 2338 } else { |
2339 v8::Handle<v8::Object> wrapper = WorkerScriptController::controllerForCo
ntext(isolate)->world()->domDataStore().get<V8ArrayBuffer>(object, isolate); | 2339 v8::Handle<v8::Object> wrapper = WorkerScriptController::controllerForCo
ntext(isolate)->world()->domDataStore().get<V8ArrayBuffer>(object, isolate); |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2503 // If the allocated memory was not registered before, then this class is lik
ely | 2503 // If the allocated memory was not registered before, then this class is lik
ely |
2504 // used in a context other then Worker's onmessage environment and the prese
nce of | 2504 // used in a context other then Worker's onmessage environment and the prese
nce of |
2505 // current v8 context is not guaranteed. Avoid calling v8 then. | 2505 // current v8 context is not guaranteed. Avoid calling v8 then. |
2506 if (m_externallyAllocatedMemory) { | 2506 if (m_externallyAllocatedMemory) { |
2507 ASSERT(v8::Isolate::GetCurrent()); | 2507 ASSERT(v8::Isolate::GetCurrent()); |
2508 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(-m_exte
rnallyAllocatedMemory); | 2508 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(-m_exte
rnallyAllocatedMemory); |
2509 } | 2509 } |
2510 } | 2510 } |
2511 | 2511 |
2512 } // namespace WebCore | 2512 } // namespace WebCore |
OLD | NEW |