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

Side by Side Diff: third_party/WebKit/Source/core/dom/DOMDataView.cpp

Issue 1854423002: ASSERT -> {DCHECK|DCHECK_XX}, ENABLE(ASSERT) -> DCHECK_IS_ON() in dom (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mark svg/as-image/svg-nested.html crash on win Created 4 years, 8 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/dom/DOMDataView.h" 5 #include "core/dom/DOMDataView.h"
6 6
7 #include "bindings/core/v8/DOMDataStore.h" 7 #include "bindings/core/v8/DOMDataStore.h"
8 #include "bindings/core/v8/V8ArrayBuffer.h" 8 #include "bindings/core/v8/V8ArrayBuffer.h"
9 #include "platform/CheckedInt.h" 9 #include "platform/CheckedInt.h"
10 #include "wtf/ArrayBufferView.h" 10 #include "wtf/ArrayBufferView.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 return adoptRef(new DOMDataView(dataView.release(), buffer.release())); 53 return adoptRef(new DOMDataView(dataView.release(), buffer.release()));
54 } 54 }
55 55
56 v8::Local<v8::Object> DOMDataView::wrap(v8::Isolate* isolate, v8::Local<v8::Obje ct> creationContext) 56 v8::Local<v8::Object> DOMDataView::wrap(v8::Isolate* isolate, v8::Local<v8::Obje ct> creationContext)
57 { 57 {
58 // It's possible that no one except for the new wrapper owns this object at 58 // It's possible that no one except for the new wrapper owns this object at
59 // this moment, so we have to prevent GC to collect this object until the 59 // this moment, so we have to prevent GC to collect this object until the
60 // object gets associated with the wrapper. 60 // object gets associated with the wrapper.
61 RefPtr<DOMDataView> protect(this); 61 RefPtr<DOMDataView> protect(this);
62 62
63 ASSERT(!DOMDataStore::containsWrapper(this, isolate)); 63 DCHECK(!DOMDataStore::containsWrapper(this, isolate));
64 64
65 const WrapperTypeInfo* wrapperTypeInfo = this->wrapperTypeInfo(); 65 const WrapperTypeInfo* wrapperTypeInfo = this->wrapperTypeInfo();
66 v8::Local<v8::Value> v8Buffer = toV8(buffer(), creationContext, isolate); 66 v8::Local<v8::Value> v8Buffer = toV8(buffer(), creationContext, isolate);
67 if (v8Buffer.IsEmpty()) 67 if (v8Buffer.IsEmpty())
68 return v8::Local<v8::Object>(); 68 return v8::Local<v8::Object>();
69 ASSERT(v8Buffer->IsArrayBuffer()); 69 DCHECK(v8Buffer->IsArrayBuffer());
70 70
71 v8::Local<v8::Object> wrapper = v8::DataView::New(v8Buffer.As<v8::ArrayBuffe r>(), byteOffset(), byteLength()); 71 v8::Local<v8::Object> wrapper = v8::DataView::New(v8Buffer.As<v8::ArrayBuffe r>(), byteOffset(), byteLength());
72 72
73 return associateWithWrapper(isolate, wrapperTypeInfo, wrapper); 73 return associateWithWrapper(isolate, wrapperTypeInfo, wrapper);
74 } 74 }
75 75
76 } // namespace blink 76 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/DOMArrayBufferView.h ('k') | third_party/WebKit/Source/core/dom/DOMException.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698