Commit f7d550e8 authored by loislo@chromium.org's avatar loislo@chromium.org

DevTools: DevTools opened for an old version of chrome or webview can't record cpu/heap profile.

The reason of that is a difference in URL for TempStorageSharedWorker between the host and the device front-ends
If DevTools window for a host page was opened before DevTools window for a device then the second DevTools
window will fail to run the shared worker and vice versa.

BUG=430794

Review URL: https://codereview.chromium.org/712593002

git-svn-id: svn://svn.chromium.org/blink/trunk@185012 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent b72568dc
......@@ -363,11 +363,18 @@ WebInspector.DeferredTempFile.prototype = {
*/
WebInspector.TempStorageCleaner = function()
{
this._worker = Runtime.startSharedWorker("temp_storage_shared_worker", "TempStorage");
this._worker.onerror = this._handleError.bind(this);
this._callbacks = [];
this._worker.port.onmessage = this._handleMessage.bind(this);
this._worker.port.onerror = this._handleError.bind(this);
try {
this._worker = Runtime.startSharedWorker("temp_storage_shared_worker", "TempStorageCleaner");
this._worker.onerror = this._handleError.bind(this);
this._callbacks = [];
this._worker.port.onmessage = this._handleMessage.bind(this);
this._worker.port.onerror = this._handleError.bind(this);
} catch (e) {
if (e.name === "URLMismatchError")
console.log("Shared worker wasn't started due to url difference. " + e);
else
throw e;
}
}
WebInspector.TempStorageCleaner.prototype = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment