Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(295)

Side by Side Diff: Source/bindings/core/v8/SerializedScriptValue.cpp

Issue 397733004: Allow assertions to be enabled in Blink Release builds. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/bindings/core/v8/DOMWrapperWorld.cpp ('k') | Source/bindings/core/v8/V8PerIsolateData.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 536
537 void writeArrayBuffer(const ArrayBuffer& arrayBuffer) 537 void writeArrayBuffer(const ArrayBuffer& arrayBuffer)
538 { 538 {
539 append(ArrayBufferTag); 539 append(ArrayBufferTag);
540 doWriteArrayBuffer(arrayBuffer); 540 doWriteArrayBuffer(arrayBuffer);
541 } 541 }
542 542
543 void writeArrayBufferView(const ArrayBufferView& arrayBufferView) 543 void writeArrayBufferView(const ArrayBufferView& arrayBufferView)
544 { 544 {
545 append(ArrayBufferViewTag); 545 append(ArrayBufferViewTag);
546 #ifndef NDEBUG 546 #if ENABLE(ASSERT)
547 const ArrayBuffer& arrayBuffer = *arrayBufferView.buffer(); 547 const ArrayBuffer& arrayBuffer = *arrayBufferView.buffer();
548 ASSERT(static_cast<const uint8_t*>(arrayBuffer.data()) + arrayBufferView .byteOffset() == 548 ASSERT(static_cast<const uint8_t*>(arrayBuffer.data()) + arrayBufferView .byteOffset() ==
549 static_cast<const uint8_t*>(arrayBufferView.baseAddress())); 549 static_cast<const uint8_t*>(arrayBufferView.baseAddress()));
550 #endif 550 #endif
551 ArrayBufferView::ViewType type = arrayBufferView.type(); 551 ArrayBufferView::ViewType type = arrayBufferView.type();
552 552
553 if (type == ArrayBufferView::TypeInt8) 553 if (type == ArrayBufferView::TypeInt8)
554 append(ByteArrayTag); 554 append(ByteArrayTag);
555 else if (type == ArrayBufferView::TypeUint8Clamped) 555 else if (type == ArrayBufferView::TypeUint8Clamped)
556 append(UnsignedByteClampedArrayTag); 556 append(UnsignedByteClampedArrayTag);
(...skipping 2499 matching lines...) Expand 10 before | Expand all | Expand 10 after
3056 // If the allocated memory was not registered before, then this class is lik ely 3056 // 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 3057 // 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. 3058 // current v8 context is not guaranteed. Avoid calling v8 then.
3059 if (m_externallyAllocatedMemory) { 3059 if (m_externallyAllocatedMemory) {
3060 ASSERT(v8::Isolate::GetCurrent()); 3060 ASSERT(v8::Isolate::GetCurrent());
3061 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(-m_exte rnallyAllocatedMemory); 3061 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(-m_exte rnallyAllocatedMemory);
3062 } 3062 }
3063 } 3063 }
3064 3064
3065 } // namespace WebCore 3065 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/DOMWrapperWorld.cpp ('k') | Source/bindings/core/v8/V8PerIsolateData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698