Index: chrome/browser/resources/file_manager/foreground/js/metadata/metadata_cache.js |
diff --git a/chrome/browser/resources/file_manager/foreground/js/metadata/metadata_cache.js b/chrome/browser/resources/file_manager/foreground/js/metadata/metadata_cache.js |
index b86fb357d3e1197dcd57e10a4cc1ebc023302d27..47ded8dc73c1d066bbf8e9596b62c15d26689a9b 100644 |
--- a/chrome/browser/resources/file_manager/foreground/js/metadata/metadata_cache.js |
+++ b/chrome/browser/resources/file_manager/foreground/js/metadata/metadata_cache.js |
@@ -875,15 +875,11 @@ function ContentProvider() { |
this.urlFilter_ = /.*/; |
var path = document.location.pathname; |
- var workerPath = document.location.origin + |
- path.substring(0, path.lastIndexOf('/') + 1) + |
- 'foreground/js/metadata/metadata_dispatcher.js'; |
- |
- this.dispatcher_ = new SharedWorker(workerPath).port; |
- this.dispatcher_.start(); |
- |
- this.dispatcher_.onmessage = this.onMessage_.bind(this); |
- this.dispatcher_.postMessage({verb: 'init'}); |
+ var dispatcher = new SharedWorker(ContentProvider.WORKER_SCRIPT).port; |
+ dispatcher.start(); |
yoshiki
2014/04/23 07:08:39
I think, it's better to put start() after adding m
hirono
2014/04/23 08:13:15
Done.
|
+ dispatcher.onmessage = this.onMessage_.bind(this); |
+ dispatcher.postMessage({verb: 'init'}); |
+ this.dispatcher_ = dispatcher; |
// Initialization is not complete until the Worker sends back the |
// 'initialized' message. See below. |
@@ -894,6 +890,14 @@ function ContentProvider() { |
this.callbacks_ = {}; |
} |
+/** |
+ * Path of a worker script. |
+ * @type {string} |
yoshiki
2014/04/23 07:08:39
@const
hirono
2014/04/23 08:13:15
Done.
|
+ */ |
+ContentProvider.WORKER_SCRIPT = |
+ 'chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj/' + |
+ 'foreground/js/metadata_dispatcher.js'; |
+ |
ContentProvider.prototype = { |
__proto__: MetadataProvider.prototype |
}; |