| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 | 725 |
| 726 /** | 726 /** |
| 727 * @return {!Promise.<undefined>} | 727 * @return {!Promise.<undefined>} |
| 728 */ | 728 */ |
| 729 _loadScripts: function() | 729 _loadScripts: function() |
| 730 { | 730 { |
| 731 if (!this._descriptor.scripts) | 731 if (!this._descriptor.scripts) |
| 732 return Promise.resolve(); | 732 return Promise.resolve(); |
| 733 | 733 |
| 734 if (Runtime.isReleaseMode()) { | 734 if (Runtime.isReleaseMode()) { |
| 735 var base = this._descriptor.remote && Runtime._remoteBase || undefin
ed; | 735 var useRemote = this._descriptor.remote && Runtime.experiments.isEna
bled("remoteModules"); |
| 736 var base = useRemote && Runtime._remoteBase || undefined; |
| 736 return loadScriptsPromise([this._name + "_module.js"], base); | 737 return loadScriptsPromise([this._name + "_module.js"], base); |
| 737 } | 738 } |
| 738 | 739 |
| 739 return loadScriptsPromise(this._descriptor.scripts.map(this._modularizeU
RL, this)); | 740 return loadScriptsPromise(this._descriptor.scripts.map(this._modularizeU
RL, this)); |
| 740 }, | 741 }, |
| 741 | 742 |
| 742 /** | 743 /** |
| 743 * @param {string} resourceName | 744 * @param {string} resourceName |
| 744 */ | 745 */ |
| 745 _modularizeURL: function(resourceName) | 746 _modularizeURL: function(resourceName) |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1052 window.localStorage[key] = settings[key]; | 1053 window.localStorage[key] = settings[key]; |
| 1053 } catch(e) { | 1054 } catch(e) { |
| 1054 // Ignore malformed settings. | 1055 // Ignore malformed settings. |
| 1055 } | 1056 } |
| 1056 } | 1057 } |
| 1057 })();} | 1058 })();} |
| 1058 | 1059 |
| 1059 | 1060 |
| 1060 // This must be constructed after the query parameters have been parsed. | 1061 // This must be constructed after the query parameters have been parsed. |
| 1061 Runtime.experiments = new Runtime.ExperimentsSupport(); | 1062 Runtime.experiments = new Runtime.ExperimentsSupport(); |
| 1063 Runtime.experiments.register("remoteModules", "Remote Modules", true); |
| 1062 | 1064 |
| 1063 /** | 1065 /** |
| 1064 * @type {?string} | 1066 * @type {?string} |
| 1065 */ | 1067 */ |
| 1066 Runtime._remoteBase = Runtime.queryParam("remoteBase"); | 1068 Runtime._remoteBase = Runtime.queryParam("remoteBase"); |
| 1067 | 1069 |
| 1068 /** @type {!Runtime} */ | 1070 /** @type {!Runtime} */ |
| 1069 var runtime; | 1071 var runtime; |
| OLD | NEW |