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

Unified Diff: native_client_sdk/src/examples/common.js

Issue 11823042: Add args to DidCreate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: native_client_sdk/src/examples/common.js
diff --git a/native_client_sdk/src/examples/common.js b/native_client_sdk/src/examples/common.js
index 257773c9e8c4c244b2175ed2ca639d047eb855e5..f5287124afcaaf973030f4f7d861d21f0b351b94 100644
--- a/native_client_sdk/src/examples/common.js
+++ b/native_client_sdk/src/examples/common.js
@@ -19,14 +19,23 @@ var common = (function () {
* @param {string} path Directory name where .nmf file can be found.
* @param {number} width The width to create the plugin.
* @param {number} height The height to create the plugin.
+ * @param {args} optional dictionary of args to send to DidCreateInstance
binji 2013/01/10 19:45:56 nit: @param {Object} args ...
*/
- function createNaClModule(name, tool, path, width, height) {
+ function createNaClModule(name, tool, path, width, height, args) {
var moduleEl = document.createElement('embed');
moduleEl.setAttribute('name', 'nacl_module');
moduleEl.setAttribute('id', 'nacl_module');
moduleEl.setAttribute('width', width);
moduleEl.setAttribute('height',height);
moduleEl.setAttribute('src', path + '/' + name + '.nmf');
+
+ // Add any optional arguments
+ if (args) {
+ for (var key in args) {
+ moduleEl.setAttribute(key, args[key])
+ }
+ }
+
// For NaCL modules use application/x-nacl.
var mimetype = 'application/x-nacl';
var isHost = tool == 'win' || tool == 'linux' || tool == 'mac';
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698