| 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 for (size_t i = 0; i < imageBitmaps.size(); ++i) { | 219 for (size_t i = 0; i < imageBitmaps.size(); ++i) { |
| 220 if (imageBitmaps[i]->isNeutered()) { | 220 if (imageBitmaps[i]->isNeutered()) { |
| 221 exceptionState.throwDOMException( | 221 exceptionState.throwDOMException( |
| 222 DataCloneError, "ImageBitmap at index " + String::number(i) + | 222 DataCloneError, "ImageBitmap at index " + String::number(i) + |
| 223 " is already detached."); | 223 " is already detached."); |
| 224 return nullptr; | 224 return nullptr; |
| 225 } | 225 } |
| 226 } | 226 } |
| 227 | 227 |
| 228 std::unique_ptr<ImageBitmapContentsArray> contents = | 228 std::unique_ptr<ImageBitmapContentsArray> contents = |
| 229 wrapUnique(new ImageBitmapContentsArray); | 229 WTF::wrapUnique(new ImageBitmapContentsArray); |
| 230 HeapHashSet<Member<ImageBitmap>> visited; | 230 HeapHashSet<Member<ImageBitmap>> visited; |
| 231 for (size_t i = 0; i < imageBitmaps.size(); ++i) { | 231 for (size_t i = 0; i < imageBitmaps.size(); ++i) { |
| 232 if (visited.contains(imageBitmaps[i])) | 232 if (visited.contains(imageBitmaps[i])) |
| 233 continue; | 233 continue; |
| 234 visited.add(imageBitmaps[i]); | 234 visited.add(imageBitmaps[i]); |
| 235 contents->push_back(imageBitmaps[i]->transfer()); | 235 contents->push_back(imageBitmaps[i]->transfer()); |
| 236 } | 236 } |
| 237 return contents; | 237 return contents; |
| 238 } | 238 } |
| 239 | 239 |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 if (arrayBuffer->isNeutered()) { | 407 if (arrayBuffer->isNeutered()) { |
| 408 size_t index = std::distance(arrayBuffers.begin(), it); | 408 size_t index = std::distance(arrayBuffers.begin(), it); |
| 409 exceptionState.throwDOMException( | 409 exceptionState.throwDOMException( |
| 410 DataCloneError, "ArrayBuffer at index " + String::number(index) + | 410 DataCloneError, "ArrayBuffer at index " + String::number(index) + |
| 411 " is already neutered."); | 411 " is already neutered."); |
| 412 return nullptr; | 412 return nullptr; |
| 413 } | 413 } |
| 414 } | 414 } |
| 415 | 415 |
| 416 std::unique_ptr<ArrayBufferContentsArray> contents = | 416 std::unique_ptr<ArrayBufferContentsArray> contents = |
| 417 wrapUnique(new ArrayBufferContentsArray(arrayBuffers.size())); | 417 WTF::wrapUnique(new ArrayBufferContentsArray(arrayBuffers.size())); |
| 418 | 418 |
| 419 HeapHashSet<Member<DOMArrayBufferBase>> visited; | 419 HeapHashSet<Member<DOMArrayBufferBase>> visited; |
| 420 for (auto it = arrayBuffers.begin(); it != arrayBuffers.end(); ++it) { | 420 for (auto it = arrayBuffers.begin(); it != arrayBuffers.end(); ++it) { |
| 421 DOMArrayBufferBase* arrayBuffer = *it; | 421 DOMArrayBufferBase* arrayBuffer = *it; |
| 422 if (visited.contains(arrayBuffer)) | 422 if (visited.contains(arrayBuffer)) |
| 423 continue; | 423 continue; |
| 424 visited.add(arrayBuffer); | 424 visited.add(arrayBuffer); |
| 425 | 425 |
| 426 size_t index = std::distance(arrayBuffers.begin(), it); | 426 size_t index = std::distance(arrayBuffers.begin(), it); |
| 427 if (arrayBuffer->isShared()) { | 427 if (arrayBuffer->isShared()) { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 void SerializedScriptValue::registerMemoryAllocatedWithCurrentScriptContext() { | 465 void SerializedScriptValue::registerMemoryAllocatedWithCurrentScriptContext() { |
| 466 if (m_externallyAllocatedMemory) | 466 if (m_externallyAllocatedMemory) |
| 467 return; | 467 return; |
| 468 | 468 |
| 469 m_externallyAllocatedMemory = static_cast<intptr_t>(dataLengthInBytes()); | 469 m_externallyAllocatedMemory = static_cast<intptr_t>(dataLengthInBytes()); |
| 470 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory( | 470 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory( |
| 471 m_externallyAllocatedMemory); | 471 m_externallyAllocatedMemory); |
| 472 } | 472 } |
| 473 | 473 |
| 474 } // namespace blink | 474 } // namespace blink |
| OLD | NEW |