Chromium Code Reviews| 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..5a2fc7f50f912de32127899e35d9619c0c4d8d4d 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", "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); |
| + } catch (e) { |
| + if (e.name !== "URLMismatchError") |
|
yurys
2014/11/07 14:50:06
Invert the condition?
loislo
2014/11/07 14:51:46
Done.
|
| + console.log("Shared worker wasn't started due to url difference. " + e); |
| + else |
| + throw e; |
| + } |
| } |
| WebInspector.TempStorageCleaner.prototype = { |