summaryrefslogtreecommitdiffstats
path: root/remoting/webapp
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-30 01:33:30 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-30 01:33:30 +0000
commitdef3789385f0d3ec0a0046ddbb686a47496663d3 (patch)
treeab4807e9dab7f4931dbc622708ec242d31c2578a /remoting/webapp
parent68957916094e7d2eabaccab37ca70da3aff44499 (diff)
downloadchromium_src-def3789385f0d3ec0a0046ddbb686a47496663d3.zip
chromium_src-def3789385f0d3ec0a0046ddbb686a47496663d3.tar.gz
chromium_src-def3789385f0d3ec0a0046ddbb686a47496663d3.tar.bz2
Build remoting for PNaCl
BUG=276739 R=jamiewalch@chromium.org Review URL: https://codereview.chromium.org/234023003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267030 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/webapp')
-rwxr-xr-xremoting/webapp/build-webapp.py5
-rw-r--r--remoting/webapp/client_session.js13
-rw-r--r--remoting/webapp/manifest.json.jinja213
-rw-r--r--remoting/webapp/plugin_settings.js3
-rw-r--r--remoting/webapp/remoting_client_pnacl.nmf10
5 files changed, 42 insertions, 2 deletions
diff --git a/remoting/webapp/build-webapp.py b/remoting/webapp/build-webapp.py
index 7f4a62c..01ffbe9 100755
--- a/remoting/webapp/build-webapp.py
+++ b/remoting/webapp/build-webapp.py
@@ -189,6 +189,11 @@ def buildWebApp(buildtype, version, mimetype, destination, zip_path,
findAndReplace(os.path.join(destination, 'plugin_settings.js'),
'HOST_PLUGIN_MIMETYPE', hostPluginMimeType)
+ # Set client plugin type.
+ client_plugin = 'pnacl' if webapp_type == 'v2_pnacl' else 'native'
+ findAndReplace(os.path.join(destination, 'plugin_settings.js'),
+ "'CLIENT_PLUGIN_TYPE'", "'" + client_plugin + "'")
+
# Allow host names for google services/apis to be overriden via env vars.
oauth2AccountsHost = os.environ.get(
'OAUTH2_ACCOUNTS_HOST', 'https://accounts.google.com')
diff --git a/remoting/webapp/client_session.js b/remoting/webapp/client_session.js
index 22f67b9..4165dd4 100644
--- a/remoting/webapp/client_session.js
+++ b/remoting/webapp/client_session.js
@@ -350,8 +350,17 @@ remoting.ClientSession.prototype.createClientPlugin_ =
document.createElement('embed');
plugin.id = id;
- plugin.src = 'about://none';
- plugin.type = 'application/vnd.chromium.remoting-viewer';
+ if (remoting.settings.CLIENT_PLUGIN_TYPE == 'pnacl') {
+ plugin.src = 'remoting_client_pnacl.nmf';
+ plugin.type = 'application/x-pnacl';
+ } else if (remoting.settings.CLIENT_PLUGIN_TYPE == 'nacl') {
+ plugin.src = 'remoting_client_nacl.nmf';
+ plugin.type = 'application/x-nacl';
+ } else {
+ plugin.src = 'about://none';
+ plugin.type = 'application/vnd.chromium.remoting-viewer';
+ }
+
plugin.width = 0;
plugin.height = 0;
plugin.tabIndex = 0; // Required, otherwise focus() doesn't work.
diff --git a/remoting/webapp/manifest.json.jinja2 b/remoting/webapp/manifest.json.jinja2
index 9ae27be..81c676b 100644
--- a/remoting/webapp/manifest.json.jinja2
+++ b/remoting/webapp/manifest.json.jinja2
@@ -59,6 +59,19 @@
"contextMenus",
"overrideEscFullscreen"
{% endif %}
+{% if webapp_type == 'v2_pnacl' %}
+ ,{
+ "socket": [
+ "tcp-connect",
+ "tcp-listen",
+ "udp-send-to",
+ "udp-bind",
+ "udp-multicast-membership",
+ "resolve-host",
+ "network-state"
+ ]
+ }
+{% endif %}
],
{% if webapp_type == 'v1' %}
diff --git a/remoting/webapp/plugin_settings.js b/remoting/webapp/plugin_settings.js
index 8d0a166..2d1f264 100644
--- a/remoting/webapp/plugin_settings.js
+++ b/remoting/webapp/plugin_settings.js
@@ -54,3 +54,6 @@ remoting.Settings.prototype.THIRD_PARTY_AUTH_REDIRECT_URI =
// Whether to use MediaSource API for video rendering.
remoting.Settings.prototype.USE_MEDIA_SOURCE_RENDERING = false;
+
+// 'native', 'nacl' or 'pnacl'.
+remoting.Settings.prototype.CLIENT_PLUGIN_TYPE = 'CLIENT_PLUGIN_TYPE';
diff --git a/remoting/webapp/remoting_client_pnacl.nmf b/remoting/webapp/remoting_client_pnacl.nmf
new file mode 100644
index 0000000..8181c0a
--- /dev/null
+++ b/remoting/webapp/remoting_client_pnacl.nmf
@@ -0,0 +1,10 @@
+{
+ "program": {
+ "portable": {
+ "pnacl-translate": {
+ "url": "remoting_client_plugin_newlib.pexe",
+ "optlevel": 2
+ }
+ }
+ }
+}