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

Unified Diff: Source/devtools/front_end/bindings/TempFile.js

Issue 712593002: DevTools: DevTools opened for an old version of chrome or webview can't record cpu/heap profile. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: worker name was changed Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/bindings/TempFile.js
diff --git a/Source/devtools/front_end/bindings/TempFile.js b/Source/devtools/front_end/bindings/TempFile.js
index a9674a87f2ae9005f86aae2d7f3ea849e5940e1c..09f48cff81b4bd5731a39af11804be97f0bb507a 100644
--- a/Source/devtools/front_end/bindings/TempFile.js
+++ b/Source/devtools/front_end/bindings/TempFile.js
@@ -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 = {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698