summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbinji@chromium.org <binji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-15 20:33:01 +0000
committerbinji@chromium.org <binji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-15 20:33:01 +0000
commit89c10b4dc2a736b643290cdad7c73d98fd1300eb (patch)
treeba65f675807b2d9ae38f0239136166aa665e6a8d
parentf8a02366995b68dd7133d150e42d99f91839425f (diff)
downloadchromium_src-89c10b4dc2a736b643290cdad7c73d98fd1300eb.zip
chromium_src-89c10b4dc2a736b643290cdad7c73d98fd1300eb.tar.gz
chromium_src-89c10b4dc2a736b643290cdad7c73d98fd1300eb.tar.bz2
[NaCl SDK] Don't redirect from index.html -> index_{toolchain}_{config}.html.
Use search parameters instead: "index.html?tc={toolchain}&config={config}". Redirects aren't allowed in packaged apps. BUG=none R=sbc@chromium.org NOTRY=true Review URL: https://chromiumcodereview.appspot.com/12261052 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182813 0039d316-1c4b-4281-b951-d872f2087c98
-rwxr-xr-xnative_client_sdk/src/build_tools/generate_make.py68
-rw-r--r--native_client_sdk/src/build_tools/redirect.html16
-rw-r--r--native_client_sdk/src/examples/common.js25
-rw-r--r--native_client_sdk/src/examples/debugging/index.html3
-rw-r--r--native_client_sdk/src/examples/dlopen/index.html6
-rw-r--r--native_client_sdk/src/examples/file_histogram/index.html7
-rw-r--r--native_client_sdk/src/examples/file_io/index.html7
-rw-r--r--native_client_sdk/src/examples/fullscreen_tumbler/index.html7
-rw-r--r--native_client_sdk/src/examples/gamepad/index.html7
-rw-r--r--native_client_sdk/src/examples/geturl/index.html6
-rw-r--r--native_client_sdk/src/examples/hello_nacl_io/index.html7
-rw-r--r--native_client_sdk/src/examples/hello_world/index.html6
-rw-r--r--native_client_sdk/src/examples/hello_world_gles/index.html7
-rw-r--r--native_client_sdk/src/examples/hello_world_instance3d/index.html7
-rw-r--r--native_client_sdk/src/examples/hello_world_interactive/index.html6
-rw-r--r--native_client_sdk/src/examples/hello_world_stdio/index.html8
-rw-r--r--native_client_sdk/src/examples/input_events/index.html7
-rw-r--r--native_client_sdk/src/examples/load_progress/index.html7
-rw-r--r--native_client_sdk/src/examples/mouselock/index.html7
-rw-r--r--native_client_sdk/src/examples/pi_generator/index.html6
-rw-r--r--native_client_sdk/src/examples/pong/index.html7
-rw-r--r--native_client_sdk/src/examples/sine_synth/index.html6
-rw-r--r--native_client_sdk/src/examples/websocket/index.html7
-rw-r--r--native_client_sdk/src/libraries/nacl_io_test/index.html4
-rw-r--r--native_client_sdk/src/tools/common.mk15
-rwxr-xr-xnative_client_sdk/src/tools/httpd.py2
26 files changed, 128 insertions, 133 deletions
diff --git a/native_client_sdk/src/build_tools/generate_make.py b/native_client_sdk/src/build_tools/generate_make.py
index bcaf33ff..55b4ec7 100755
--- a/native_client_sdk/src/build_tools/generate_make.py
+++ b/native_client_sdk/src/build_tools/generate_make.py
@@ -25,6 +25,12 @@ use_gyp = False
sys.path.append(os.path.join(SDK_SRC_DIR, 'tools'))
import getos
+def Trace(msg):
+ if Trace.verbose:
+ sys.stderr.write(str(msg) + '\n')
+Trace.verbose = False
+
+
def Replace(text, replacements):
for key, val in replacements.items():
if val is not None:
@@ -139,7 +145,6 @@ def GenerateRules(desc, tools):
configs = desc.get('CONFIGS', ['Debug', 'Release'])
for tc, enabled_arches in tools.iteritems():
- print tc
makeobj = MakeRules(tc)
arches = makeobj.GetArches()
rules += makeobj.BuildDirectoryRules(configs)
@@ -364,6 +369,7 @@ def ProcessHTML(srcroot, dstroot, desc, toolchains):
name = desc['NAME']
outdir = os.path.join(dstroot, desc['DEST'], name)
srcfile = os.path.join(srcroot, 'index.html')
+ dstfile = os.path.join(outdir, 'index.html')
tools = GetPlatforms(toolchains, desc['TOOLS'])
if use_gyp and getos.GetPlatform() != 'win':
@@ -371,27 +377,17 @@ def ProcessHTML(srcroot, dstroot, desc, toolchains):
else:
configs = ['Debug', 'Release']
- for tool in tools:
- for cfg in configs:
- dstfile = os.path.join(outdir, 'index_%s_%s.html' % (tool, cfg))
- print 'Writing from %s to %s' % (srcfile, dstfile)
- if use_gyp:
- path = "build/%s-%s" % (tool, cfg)
- else:
- path = "%s/%s" % (tool, cfg)
- replace = {
- '<path>': path,
- '<NAME>': name,
- '<TITLE>': desc['TITLE'],
- '<tc>': tool
- }
- WriteReplaced(srcfile, dstfile, replace)
-
- replace['<tc>'] = tools[0]
- replace['<config>'] = configs[0]
-
- srcfile = os.path.join(SDK_SRC_DIR, 'build_tools', 'redirect.html')
- dstfile = os.path.join(outdir, 'index.html')
+ if use_gyp:
+ path = "build/{tc}-{config}"
+ else:
+ path = "{tc}/{config}"
+
+ replace = {
+ '{{title}}': desc['TITLE'],
+ '{{attrs}}':
+ 'data-name="%s" data-tools="%s" data-configs="%s" data-path="%s"' % (
+ name, ' '.join(tools), ' '.join(configs), path),
+ }
WriteReplaced(srcfile, dstfile, replace)
@@ -402,7 +398,7 @@ def LoadProject(filename, toolchains):
if it matches the set of requested toolchains. Return None if the
project is filtered out."""
- print 'Processing %s...' % filename
+ Trace('Processing %s...' % filename)
# Default src directory is the directory the description was found in
desc = open(filename, 'r').read()
desc = eval(desc, {}, {})
@@ -433,7 +429,8 @@ def FindAndCopyFiles(src_files, root, search_dirs, dst_dir):
dst_file = os.path.join(dst_dir, src_name)
if os.path.exists(dst_file):
if os.stat(src_file).st_mtime <= os.stat(dst_file).st_mtime:
- print 'Skipping "%s", destination "%s" is newer.' % (src_file, dst_file)
+ Trace('Skipping "%s", destination "%s" is newer.' % (
+ src_file, dst_file))
continue
buildbot_common.CopyFile(src_file, dst_file)
@@ -553,22 +550,26 @@ def main(argv):
parser.add_option('--dstroot', help='Set root for destination.',
default=os.path.join(OUT_DIR, 'pepper_canary'))
parser.add_option('--master', help='Create master Makefile.',
- action='store_true', default=False)
+ action='store_true')
parser.add_option('--newlib', help='Create newlib examples.',
- action='store_true', default=False)
+ action='store_true')
parser.add_option('--glibc', help='Create glibc examples.',
- action='store_true', default=False)
+ action='store_true')
parser.add_option('--pnacl', help='Create pnacl examples.',
- action='store_true', default=False)
+ action='store_true')
parser.add_option('--host', help='Create host examples.',
- action='store_true', default=False)
+ action='store_true')
parser.add_option('--experimental', help='Create experimental examples.',
- action='store_true', default=False)
+ action='store_true')
+ parser.add_option('-v', '--verbose', help='Verbose output',
+ action='store_true')
toolchains = []
platform = getos.GetPlatform()
options, args = parser.parse_args(argv)
+ if options.verbose:
+ Trace.verbose = True
if options.newlib:
toolchains.append('newlib')
if options.glibc:
@@ -591,14 +592,14 @@ def main(argv):
for i, filename in enumerate(args):
if i:
# Print two newlines between each dsc file we process
- print '\n'
+ Trace('\n')
desc = LoadProject(filename, toolchains)
if not desc:
- print 'Skipping %s, not in [%s].' % (filename, ', '.join(toolchains))
+ Trace('Skipping %s, not in [%s].' % (filename, ', '.join(toolchains)))
continue
if desc.get('EXPERIMENTAL', False) and not options.experimental:
- print 'Skipping %s, experimental only.' % (filename,)
+ Trace('Skipping %s, experimental only.' % (filename,))
continue
srcroot = os.path.dirname(os.path.abspath(filename))
@@ -611,6 +612,7 @@ def main(argv):
# if this is an example, update landing page html file.
if desc['DEST'] == 'examples':
+ Trace('Adding desc: %s' % filename)
landing_page.AddDesc(desc)
# Create a list of projects for each DEST. This will be used to generate a
diff --git a/native_client_sdk/src/build_tools/redirect.html b/native_client_sdk/src/build_tools/redirect.html
deleted file mode 100644
index 007598b..0000000
--- a/native_client_sdk/src/build_tools/redirect.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<!DOCTYPE html>
-<html>
- <!--
- Copyright (c) 2012 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.
- -->
-<head>
- <meta http-equiv="Pragma" content="no-cache" />
- <meta http-equiv="Expires" content="-1" />
- <meta http-equiv="Refresh" content="0;url=index_<tc>_<config>.html" />
-</head>
-<body>
- Redirecting to default example: <tc> <config>
-</body>
-</html>
diff --git a/native_client_sdk/src/examples/common.js b/native_client_sdk/src/examples/common.js
index 890081f..bd0a6b2 100644
--- a/native_client_sdk/src/examples/common.js
+++ b/native_client_sdk/src/examples/common.js
@@ -255,9 +255,30 @@ document.addEventListener('DOMContentLoaded', function() {
loadFunction = window.domContentLoaded;
}
+ // From https://developer.mozilla.org/en-US/docs/DOM/window.location
+ var searchVars = {};
+ if (window.location.search.length > 1) {
+ var pairs = window.location.search.substr(1).split("&");
+ for (var key_ix = 0; key_ix < pairs.length; key_ix++) {
+ var keyValue = pairs[key_ix].split("=");
+ searchVars[unescape(keyValue[0])] =
+ keyValue.length > 1 ? unescape(keyValue[1]) : "";
+ }
+ }
+
if (loadFunction) {
- loadFunction(body.dataset.name, body.dataset.tc, body.dataset.path,
- body.dataset.width, body.dataset.height);
+ var toolchains = body.dataset.tools.split(' ');
+ var configs = body.dataset.configs.split(' ');
+
+ var tc = toolchains.indexOf(searchVars.tc) !== -1 ?
+ searchVars.tc : toolchains[0];
+ var config = configs.indexOf(searchVars.config) !== -1 ?
+ searchVars.config : configs[0];
+ var pathFormat = body.dataset.path;
+ var path = pathFormat.replace('{tc}', tc).replace('{config}', config);
+
+ loadFunction(body.dataset.name, tc, path, body.dataset.width,
+ body.dataset.height);
}
}
});
diff --git a/native_client_sdk/src/examples/debugging/index.html b/native_client_sdk/src/examples/debugging/index.html
index 59c2692..d5d518b 100644
--- a/native_client_sdk/src/examples/debugging/index.html
+++ b/native_client_sdk/src/examples/debugging/index.html
@@ -12,8 +12,7 @@
<script type="text/javascript" src="common.js"></script>
<script type="text/javascript" src="example.js"></script>
</head>
-<body data-name="<NAME>" data-tc="<tc>" data-path="<path>" data-width="100"
- data-height="100" data-custom-load="true">
+<body data-width="100" data-height="100" data-custom-load="true" {{attrs}}>
<h1>Native Client Debugging Example: Generating a Stack Trace.</h1>
<h2>How the example works</h2>
<p>This example shows how to trap an untrusted exception (such as a illegal
diff --git a/native_client_sdk/src/examples/dlopen/index.html b/native_client_sdk/src/examples/dlopen/index.html
index bbadea7..52be080 100644
--- a/native_client_sdk/src/examples/dlopen/index.html
+++ b/native_client_sdk/src/examples/dlopen/index.html
@@ -8,12 +8,12 @@ found in the LICENSE file.
<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
- <title><TITLE></title>
+ <title>{{title}}</title>
<script type="text/javascript" src="common.js"></script>
<script type="text/javascript" src="example.js"></script>
</head>
-<body data-name="<NAME>" data-tc="<tc>" data-path="<path>">
- <h1><TITLE></h1>
+<body {{attrs}}>
+ <h1>{{title}}</h1>
<h2>Status: <code id="statusField">NO-STATUS</code></h2>
<div>Magic eightball: type a question below, press the button, and get a
response.</div>
diff --git a/native_client_sdk/src/examples/file_histogram/index.html b/native_client_sdk/src/examples/file_histogram/index.html
index 904fa7b..74fb107 100644
--- a/native_client_sdk/src/examples/file_histogram/index.html
+++ b/native_client_sdk/src/examples/file_histogram/index.html
@@ -8,13 +8,12 @@
<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
- <title><TITLE></title>
+ <title>{{title}}</title>
<script type="text/javascript" src="common.js"></script>
<script type ="text/javascript" src="example.js"></script>
</head>
-<body data-name="<NAME>" data-tc="<tc>" data-path="<path>" data-width="256"
- data-height="256">
- <h1><TITLE></h1>
+<body data-width="256" data-height="256" {{attrs}}>
+ <h1>{{title}}</h1>
<h2>Status: <code id="statusField">NO-STATUS</code></h2>
<input type="file" id="fileInput" multiple>
<!-- The NaCl plugin will be embedded inside the element with id "listener".
diff --git a/native_client_sdk/src/examples/file_io/index.html b/native_client_sdk/src/examples/file_io/index.html
index ffffe3b..64767b2 100644
--- a/native_client_sdk/src/examples/file_io/index.html
+++ b/native_client_sdk/src/examples/file_io/index.html
@@ -8,13 +8,12 @@
<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
- <title><TITLE></title>
+ <title>{{title}}</title>
<script type="text/javascript" src="common.js"></script>
<script type="text/javascript" src="example.js"></script>
</head>
-<body data-name="<NAME>" data-tc="<tc>" data-path="<path>" data-width="200"
- data-height="200" data-custom-load="true">
- <h1><TITLE></h1>
+<body data-width="200" data-height="200" data-custom-load="true" {{attrs}}>
+ <h1>{{title}}</h1>
<h2>Status: <code id="statusField">NO-STATUS</code></h2>
<textarea id="fileEditor"
diff --git a/native_client_sdk/src/examples/fullscreen_tumbler/index.html b/native_client_sdk/src/examples/fullscreen_tumbler/index.html
index 1a04619..315743e 100644
--- a/native_client_sdk/src/examples/fullscreen_tumbler/index.html
+++ b/native_client_sdk/src/examples/fullscreen_tumbler/index.html
@@ -8,7 +8,7 @@ found in the LICENSE file.
<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
- <title><TITLE></title>
+ <title>{{title}}</title>
<script type="text/javascript" src="common.js"></script>
<script type="text/javascript" src="check_browser.js"></script>
<script type="text/javascript" src="bind.js"></script>
@@ -17,9 +17,8 @@ found in the LICENSE file.
<script type="text/javascript" src="vector3.js"></script>
<script type="text/javascript" src="trackball.js"></script>
</head>
-<body data-name="<NAME>" data-tc="<tc>" data-path="<path>" data-width="480"
- data-height="480">
- <h1><TITLE></h1>
+<body data-width="480" data-height="480" {{attrs}}>
+ <h1>{{title}}</h1>
<h2>Status: <code id="statusField">NO-STATUS</code></h2>
<p>
The Native Client module executed in this page draws a 3D cube
diff --git a/native_client_sdk/src/examples/gamepad/index.html b/native_client_sdk/src/examples/gamepad/index.html
index 48f88d5..108319b 100644
--- a/native_client_sdk/src/examples/gamepad/index.html
+++ b/native_client_sdk/src/examples/gamepad/index.html
@@ -8,12 +8,11 @@ found in the LICENSE file.
<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
- <title><TITLE></title>
+ <title>{{title}}</title>
<script type="text/javascript" src="common.js"></script>
</head>
-<body data-name="<NAME>" data-tc="<tc>" data-path="<path>" data-width="800"
- data-height="200">
- <h1><TITLE></h1>
+<body data-width="800" data-height="200" {{attrs}}>
+ <h1>{{title}}</h1>
<h2>Status: <code id="statusField">NO-STATUS</code></h2>
<!-- The NaCl plugin will be embedded inside the element with id "listener".
See common.js.-->
diff --git a/native_client_sdk/src/examples/geturl/index.html b/native_client_sdk/src/examples/geturl/index.html
index 7038f14..ceb42ad 100644
--- a/native_client_sdk/src/examples/geturl/index.html
+++ b/native_client_sdk/src/examples/geturl/index.html
@@ -8,12 +8,12 @@ found in the LICENSE file.
<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
- <title><TITLE></title>
+ <title>{{title}}</title>
<script type="text/javascript" src="common.js"></script>
<script type="text/javascript" src="example.js"></script>
</head>
-<body data-name="<NAME>" data-tc="<tc>" data-path="<path>">
- <h1><TITLE></h1>
+<body {{attrs}}>
+ <h1>{{title}}</h1>
<h2>Status: <code id="statusField">NO-STATUS</code></h2>
<table border=5 cellpadding=5% summary="A title and a result log">
<tr>
diff --git a/native_client_sdk/src/examples/hello_nacl_io/index.html b/native_client_sdk/src/examples/hello_nacl_io/index.html
index f122758..8695747 100644
--- a/native_client_sdk/src/examples/hello_nacl_io/index.html
+++ b/native_client_sdk/src/examples/hello_nacl_io/index.html
@@ -8,13 +8,12 @@ found in the LICENSE file.
<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
- <title><TITLE></title>
+ <title>{{title}}</title>
<script type="text/javascript" src="common.js"></script>
<script type="text/javascript" src="example.js"></script>
</head>
-<body data-name="<NAME>" data-tc="<tc>" data-path="<path>"
- data-custom-load="true">
- <h1><TITLE></h1>
+<body data-custom-load="true" {{attrs}}>
+ <h1>{{title}}</h1>
<h2>Status: <code id="statusField">NO-STATUS</code></h2>
<p>
This example shows how you can use standard C library file operation
diff --git a/native_client_sdk/src/examples/hello_world/index.html b/native_client_sdk/src/examples/hello_world/index.html
index 3fc523d..a91a547e 100644
--- a/native_client_sdk/src/examples/hello_world/index.html
+++ b/native_client_sdk/src/examples/hello_world/index.html
@@ -8,12 +8,12 @@ found in the LICENSE file.
<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
- <title><TITLE></title>
+ <title>{{title}}</title>
<script type="text/javascript" src="common.js"></script>
<script type="text/javascript" src="example.js"></script>
</head>
-<body data-name="<NAME>" data-tc="<tc>" data-path="<path>">
- <h1><TITLE></h1>
+<body {{attrs}}>
+ <h1>{{title}}</h1>
<h2>Status: <code id="statusField">NO-STATUS</code></h2>
<p>This example demonstrates a complete NaCl PPAPI application. In
source file hello_world.c contains the three required PPAPI functions
diff --git a/native_client_sdk/src/examples/hello_world_gles/index.html b/native_client_sdk/src/examples/hello_world_gles/index.html
index cfc9ddd..b07ff78 100644
--- a/native_client_sdk/src/examples/hello_world_gles/index.html
+++ b/native_client_sdk/src/examples/hello_world_gles/index.html
@@ -8,12 +8,11 @@ found in the LICENSE file.
<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
- <title><TITLE></title>
+ <title>{{title}}</title>
<script type="text/javascript" src="common.js"></script>
</head>
-<body data-name="<NAME>" data-tc="<tc>" data-path="<path>" data-width="640"
- data-height="480">
- <h1><TITLE></h1>
+<body data-width="640" data-height="480" {{attrs}}>
+ <h1>{{title}}</h1>
<h2>Status: <code id="statusField">NO-STATUS</code></h2>
<!-- The NaCl plugin will be embedded inside the element with id "listener".
See common.js.-->
diff --git a/native_client_sdk/src/examples/hello_world_instance3d/index.html b/native_client_sdk/src/examples/hello_world_instance3d/index.html
index cfc9ddd..b07ff78 100644
--- a/native_client_sdk/src/examples/hello_world_instance3d/index.html
+++ b/native_client_sdk/src/examples/hello_world_instance3d/index.html
@@ -8,12 +8,11 @@ found in the LICENSE file.
<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
- <title><TITLE></title>
+ <title>{{title}}</title>
<script type="text/javascript" src="common.js"></script>
</head>
-<body data-name="<NAME>" data-tc="<tc>" data-path="<path>" data-width="640"
- data-height="480">
- <h1><TITLE></h1>
+<body data-width="640" data-height="480" {{attrs}}>
+ <h1>{{title}}</h1>
<h2>Status: <code id="statusField">NO-STATUS</code></h2>
<!-- The NaCl plugin will be embedded inside the element with id "listener".
See common.js.-->
diff --git a/native_client_sdk/src/examples/hello_world_interactive/index.html b/native_client_sdk/src/examples/hello_world_interactive/index.html
index 74f1e6a..44e0b30 100644
--- a/native_client_sdk/src/examples/hello_world_interactive/index.html
+++ b/native_client_sdk/src/examples/hello_world_interactive/index.html
@@ -8,12 +8,12 @@
<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
- <title><TITLE></title>
+ <title>{{title}}</title>
<script type="text/javascript" src="common.js"></script>
<script type="text/javascript" src="example.js"></script>
</head>
-<body data-name="<NAME>" data-tc="<tc>" data-path="<path>">
- <h1><TITLE></h1>
+<body {{attrs}}>
+ <h1>{{title}}</h1>
<h2>Status: <code id="statusField">NO-STATUS</code></h2>
<!-- The NaCl plugin will be embedded inside the element with id "listener".
See common.js.-->
diff --git a/native_client_sdk/src/examples/hello_world_stdio/index.html b/native_client_sdk/src/examples/hello_world_stdio/index.html
index d7af88d..f317883 100644
--- a/native_client_sdk/src/examples/hello_world_stdio/index.html
+++ b/native_client_sdk/src/examples/hello_world_stdio/index.html
@@ -8,12 +8,12 @@ found in the LICENSE file.
<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
- <title><TITLE></title>
+ <title>{{title}}</title>
<script type="text/javascript" src="common.js"></script>
<script type="text/javascript" src="example.js"></script>
</head>
-<body data-name="<NAME>" data-tc="<tc>" data-path="<path>">
- <h1><TITLE></h1>
+<body {{attrs}}>
+ <h1>{{title}}</h1>
<h2>Status: <code id="statusField">NO-STATUS</code></h2>
<!-- The NaCl plugin will be embedded inside the element with id "listener".
See common.js.-->
@@ -34,4 +34,4 @@ found in the LICENSE file.
<p><b id='outputString'></b></p>
</pre>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/native_client_sdk/src/examples/input_events/index.html b/native_client_sdk/src/examples/input_events/index.html
index e0fa20c..a77af1f 100644
--- a/native_client_sdk/src/examples/input_events/index.html
+++ b/native_client_sdk/src/examples/input_events/index.html
@@ -6,15 +6,14 @@ Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<head>
- <title><TITLE></title>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
- <title><TITLE></title>
+ <title>{{title}}</title>
<script type="text/javascript" src="common.js"></script>
<script type="text/javascript" src="example.js"></script>
</head>
-<body data-name="<NAME>" data-tc="<tc>" data-path="<path>">
- <h1><TITLE></h1>
+<body {{attrs}}>
+ <h1>{{title}}</h1>
<h2>Status: <code id="statusField">NO-STATUS</code></h2>
<button id="killButton">Kill worker thread and queue</button>
diff --git a/native_client_sdk/src/examples/load_progress/index.html b/native_client_sdk/src/examples/load_progress/index.html
index e69b1d7..8b2c0b6 100644
--- a/native_client_sdk/src/examples/load_progress/index.html
+++ b/native_client_sdk/src/examples/load_progress/index.html
@@ -8,13 +8,12 @@ found in the LICENSE file.
<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
- <title><TITLE></title>
+ <title>{{title}}</title>
<script type="text/javascript" src="common.js"></script>
<script type="text/javascript" src="example.js"></script>
</head>
-<body data-name="<NAME>" data-tc="<tc>" data-path="<path>" data-width="256"
- data-height="256" data-custom-load="true">
- <h1><TITLE></h1>
+<body data-width="256" data-height="256" data-custom-load="true" {{attrs}}>
+ <h1>{{title}}</h1>
<h2>Status: <code id="statusField">NO-STATUS</code></h2>
<h2>Event Log</h2>
<div id="listener"></div>
diff --git a/native_client_sdk/src/examples/mouselock/index.html b/native_client_sdk/src/examples/mouselock/index.html
index e28c8c5..2e1cdeb 100644
--- a/native_client_sdk/src/examples/mouselock/index.html
+++ b/native_client_sdk/src/examples/mouselock/index.html
@@ -8,12 +8,11 @@ found in the LICENSE file.
<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
- <title><TITLE></title>
+ <title>{{title}}</title>
<script type="text/javascript" src="common.js"></script>
</head>
-<body data-name="<NAME>" data-tc="<tc>" data-path="<path>" data-width="300"
- data-height="300">
- <h1><TITLE></h1>
+<body data-width="300" data-height="300" {{attrs}}>
+ <h1>{{title}}</h1>
<h2>Status: <code id="statusField">NO-STATUS</code></h2>
<h1>Full-screen and Mouse-lock Example</h1>
<ul>
diff --git a/native_client_sdk/src/examples/pi_generator/index.html b/native_client_sdk/src/examples/pi_generator/index.html
index 24b08bf..7dc1df2 100644
--- a/native_client_sdk/src/examples/pi_generator/index.html
+++ b/native_client_sdk/src/examples/pi_generator/index.html
@@ -8,12 +8,12 @@ found in the LICENSE file.
<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
- <title><TITLE></title>
+ <title>{{title}}</title>
<script type="text/javascript" src="common.js"></script>
<script type="text/javascript" src="example.js"></script>
</head>
-<body data-name="<NAME>" data-tc="<tc>" data-path="<path>">
- <h1><TITLE></h1>
+<body {{attrs}}>
+ <h1>{{title}}</h1>
<h2>Status: <code id="statusField">NO-STATUS</code></h2>
<p>
The Native Client module executed in this page creates a thread that
diff --git a/native_client_sdk/src/examples/pong/index.html b/native_client_sdk/src/examples/pong/index.html
index db70108..8fca71e 100644
--- a/native_client_sdk/src/examples/pong/index.html
+++ b/native_client_sdk/src/examples/pong/index.html
@@ -8,13 +8,12 @@ found in the LICENSE file.
<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
- <title><TITLE></title>
+ <title>{{title}}</title>
<script type="text/javascript" src="common.js"></script>
<script type="text/javascript" src="example.js"></script>
</head>
-<body data-name="<NAME>" data-tc="<tc>" data-path="<path>" data-width="800"
- data-height="600">
- <h1><TITLE></h1>
+<body data-width="800" data-height="600" {{attrs}}>
+ <h1>{{title}}</h1>
<h2>Status: <code id="statusField">NO-STATUS</code></h2>
<!-- The NaCl plugin will be embedded inside the element with id "listener".
See common.js.-->
diff --git a/native_client_sdk/src/examples/sine_synth/index.html b/native_client_sdk/src/examples/sine_synth/index.html
index 2b66141..f2f66a3 100644
--- a/native_client_sdk/src/examples/sine_synth/index.html
+++ b/native_client_sdk/src/examples/sine_synth/index.html
@@ -8,12 +8,12 @@ found in the LICENSE file.
<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
- <title><TITLE></title>
+ <title>{{title}}</title>
<script type="text/javascript" src="common.js"></script>
<script type="text/javascript" src="example.js"></script>
</head>
-<body data-name="<NAME>" data-tc="<tc>" data-path="<path>">
- <h1><TITLE></h1>
+<body {{attrs}}>
+ <h1>{{title}}</h1>
<h2>Status: <code id="statusField">NO-STATUS</code></h2>
<p>Click the button to start and stop the sine wave playing.</p>
diff --git a/native_client_sdk/src/examples/websocket/index.html b/native_client_sdk/src/examples/websocket/index.html
index 2048454..2bd2b18 100644
--- a/native_client_sdk/src/examples/websocket/index.html
+++ b/native_client_sdk/src/examples/websocket/index.html
@@ -6,15 +6,14 @@ Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<head>
- <title><TITLE></title>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
- <title><TITLE></title>
+ <title>{{title}}</title>
<script type="text/javascript" src="common.js"></script>
<script type="text/javascript" src="example.js"></script>
</head>
-<body data-name="<NAME>" data-tc="<tc>" data-path="<path>">
- <h1><TITLE></h1>
+<body {{attrs}}>
+ <h1>{{title}}</h1>
<h2>Status: <code id="statusField">NO-STATUS</code></h2>
<div>Set a server URL, then push "Connect" button to establish a connection.
<br>"Send" button sends text message on the left text area.
diff --git a/native_client_sdk/src/libraries/nacl_io_test/index.html b/native_client_sdk/src/libraries/nacl_io_test/index.html
index 5d2cf08..4e47334 100644
--- a/native_client_sdk/src/libraries/nacl_io_test/index.html
+++ b/native_client_sdk/src/libraries/nacl_io_test/index.html
@@ -8,11 +8,11 @@ found in the LICENSE file.
<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
- <title><TITLE></title>
+ <title>{{title}}</title>
<script type="text/javascript" src="common.js"></script>
<script type="text/javascript" src="example.js"></script>
</head>
-<body data-name="<NAME>" data-tc="<tc>" data-path="<path>">
+<body {{attrs}}>
<h1><TITLE></h1>
<h2>Status: <code id="statusField">NO-STATUS</code></h2>
<!-- The NaCl plugin will be embedded inside the element with id "listener".
diff --git a/native_client_sdk/src/tools/common.mk b/native_client_sdk/src/tools/common.mk
index 302cbdd..12f050d 100644
--- a/native_client_sdk/src/tools/common.mk
+++ b/native_client_sdk/src/tools/common.mk
@@ -288,16 +288,16 @@ PPAPI_DEBUG=$(abspath $(OSNAME)/Debug/$(TARGET)$(HOST_EXT));application/x-ppapi-
PPAPI_RELEASE=$(abspath $(OSNAME)/Release/$(TARGET)$(HOST_EXT));application/x-ppapi-release
-PAGE?=index_$(TOOLCHAIN)_$(CONFIG).html
+PAGE?=index.html
+PAGE_TC_CONFIG="$(PAGE)?tc=$(TOOLCHAIN)&config=$(CONFIG)"
RUN: LAUNCH
LAUNCH: CHECK_FOR_CHROME all
ifeq (,$(wildcard $(PAGE)))
- $(warning No valid HTML page found at $(PAGE))
- $(error Make sure TOOLCHAIN and CONFIG are properly set)
+ $(error No valid HTML page found at $(PAGE))
endif
- $(RUN_PY) -C $(CURDIR) -P $(PAGE) $(addprefix -E ,$(CHROME_ENV)) -- \
- $(CHROME_PATH) $(CHROME_ARGS) \
+ $(RUN_PY) -C $(CURDIR) -P $(PAGE_TC_CONFIG) \
+ $(addprefix -E ,$(CHROME_ENV)) -- $(CHROME_PATH) $(CHROME_ARGS) \
--register-pepper-plugins="$(PPAPI_DEBUG),$(PPAPI_RELEASE)"
@@ -307,6 +307,7 @@ GDB_ARGS+=-D $(CURDIR)/$(OUTDIR)/$(TARGET)_$(SYSARCH).nexe
DEBUG: CHECK_FOR_CHROME all
$(RUN_PY) $(GDB_ARGS) \
- -C $(CURDIR) -P $(PAGE) $(addprefix -E ,$(CHROME_ENV)) -- \
- $(CHROME_PATH) $(CHROME_ARGS) --enable-nacl-debug \
+ -C $(CURDIR) -P $(PAGE_TC_CONFIG) \
+ $(addprefix -E ,$(CHROME_ENV)) -- $(CHROME_PATH) $(CHROME_ARGS) \
+ --enable-nacl-debug \
--register-pepper-plugins="$(PPAPI_DEBUG),$(PPAPI_RELEASE)"
diff --git a/native_client_sdk/src/tools/httpd.py b/native_client_sdk/src/tools/httpd.py
index 7354565..88d8f98 100755
--- a/native_client_sdk/src/tools/httpd.py
+++ b/native_client_sdk/src/tools/httpd.py
@@ -136,7 +136,7 @@ class PluggableHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
_, _, _, query, _ = urlparse.urlsplit(self.path)
if query:
params = urlparse.parse_qs(query)
- if '1' in params.get('quit', None):
+ if '1' in params.get('quit', []):
self._SendNothingAndDie()
return