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

Unified Diff: third_party/WebKit/LayoutTests/fast/wasm/wasm-limits-worker.js

Issue 2702953002: [wasm] Block compile/instantiate of large array buffers (Closed)
Patch Set: Updated after V8 side landed Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/wasm/wasm-limits-worker.js
diff --git a/third_party/WebKit/LayoutTests/fast/wasm/wasm-limits-worker.js b/third_party/WebKit/LayoutTests/fast/wasm/wasm-limits-worker.js
new file mode 100644
index 0000000000000000000000000000000000000000..404c8c4ea1b3c713d6dd18f465eec9b3ce354380
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/wasm/wasm-limits-worker.js
@@ -0,0 +1,21 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+this.importScripts("wasm-constants.js");
+this.importScripts("wasm-module-builder.js");
+this.importScripts("wasm-limits-tests-common.js");
+
+onmessage = function(limit) {
+ var buffer = createTestBuffers(limit).large;
+ var m = undefined;
+ var i = undefined;
+ try {
+ m = new WebAssembly.Module(buffer);
+ i = new WebAssembly.Instance(m);
+ } catch (e) {
+ postMessage(false);
+ }
+ postMessage(m instanceof WebAssembly.Module &&
+ i instanceof WebAssembly.Instance);
+}

Powered by Google App Engine
This is Rietveld 408576698