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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/common/Worker.js

Issue 2516833002: DevTools: launch worker runtimes with all the queryParams of the main page runtime. (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/Runtime.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 19 matching lines...) Expand all
30 30
31 /** 31 /**
32 * @unrestricted 32 * @unrestricted
33 */ 33 */
34 Common.Worker = class { 34 Common.Worker = class {
35 /** 35 /**
36 * @param {string} appName 36 * @param {string} appName
37 */ 37 */
38 constructor(appName) { 38 constructor(appName) {
39 var url = appName + '.js'; 39 var url = appName + '.js';
40 var remoteBase = Runtime.queryParam('remoteBase'); 40 url += Runtime.queryParamsString();
41 if (remoteBase)
42 url += '?remoteBase=' + remoteBase;
43 41
44 /** @type {!Promise<!Worker>} */ 42 /** @type {!Promise<!Worker>} */
45 this._workerPromise = new Promise(fulfill => { 43 this._workerPromise = new Promise(fulfill => {
46 this._worker = new Worker(url); 44 this._worker = new Worker(url);
47 this._worker.onmessage = onMessage.bind(this); 45 this._worker.onmessage = onMessage.bind(this);
48 46
49 /** 47 /**
50 * @param {!Event} event 48 * @param {!Event} event
51 * @this {Common.Worker} 49 * @this {Common.Worker}
52 */ 50 */
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 this._workerPromise.then(worker => worker.onmessage = listener); 85 this._workerPromise.then(worker => worker.onmessage = listener);
88 } 86 }
89 87
90 /** 88 /**
91 * @param {?function(!Event)} listener 89 * @param {?function(!Event)} listener
92 */ 90 */
93 set onerror(listener) { 91 set onerror(listener) {
94 this._workerPromise.then(worker => worker.onerror = listener); 92 this._workerPromise.then(worker => worker.onerror = listener);
95 } 93 }
96 }; 94 };
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/Runtime.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698