by staticassertion · 7y ago · 0 comments
Apparently, when the language is C++, the value is somewhere above many millions of dollars, and we don't know what it is.
Can we reasonably expect that price to be lower with language X? For many reasons, I would argue 'yes'.
If all you want is to keep users safe then it'd be easy - ban JavaScript wholesale. Bam, done, instantly made the web safer & faster. Don't even need to deal with the huge security can of worms that is WebGL, either.
But safety is rarely the exclusive factor in play, now is it? Things like memory usage efficiency & performance also play large roles here.
The only semi-proven way to not get owned at this point is to never go online.
DOMArrayBuffer* result = DOMArrayBuffer::Create(raw_data_->ToArrayBuffer());
...
raw_data_.reset();
...
return result;
I'd imagine the effort/time/money it would take to replace those raw pointers with memory safe substitutes [2][3][4] (and enforce the ban going forward) would be relatively modest. Performance shouldn't be an issue [5].[1] shameless plug: https://github.com/duneroadrunner/SaferCPlusPlus
[2] https://github.com/duneroadrunner/SaferCPlusPlus#registered-...
[3] https://github.com/duneroadrunner/SaferCPlusPlus#norad-point...
[4] https://github.com/duneroadrunner/SaferCPlusPlus#scope-point...
[5] https://github.com/duneroadrunner/SaferCPlusPlus-BenchmarksG...
[1] https://chromium.googlesource.com/chromium/src/+/master/thir...
The ArrayBuffer itself also uses reference counters rather than the GC base classes from Oilpan. https://chromium.googlesource.com/chromium/src/+/refs/heads/...
See also https://chromium.googlesource.com/chromium/src/+/refs/heads/... and https://chromium.googlesource.com/chromium/src/+/refs/heads/...
https://github.com/chromium/chromium/blob/ba9748e78ec7e9c0d5...