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

Side by Side Diff: chrome/browser/resources/file_manager/foreground/js/metadata/metadata_dispatcher.js

Issue 39123003: [Files.app] Split the JavaScript files into subdirectories: common, background, and foreground (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed test failure. Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 'use strict'; 5 'use strict';
6 6
7 // All of these scripts could be imported with a single call to importScripts, 7 // All of these scripts could be imported with a single call to importScripts,
8 // but then load and compile time errors would all be reported from the same 8 // but then load and compile time errors would all be reported from the same
9 // line. 9 // line.
10 importScripts('metadata_parser.js'); 10 importScripts('metadata_parser.js');
11 importScripts('byte_reader.js'); 11 importScripts('byte_reader.js');
12 importScripts('../util.js'); 12 importScripts('../../../common/js/util.js');
13 13
14 /** 14 /**
15 * Dispatches metadata requests to the correct parser. 15 * Dispatches metadata requests to the correct parser.
16 * 16 *
17 * @param {Object} port Worker port. 17 * @param {Object} port Worker port.
18 * @constructor 18 * @constructor
19 */ 19 */
20 function MetadataDispatcher(port) { 20 function MetadataDispatcher(port) {
21 this.port_ = port; 21 this.port_ = port;
22 this.port_.onmessage = this.onMessage.bind(this); 22 this.port_.onmessage = this.onMessage.bind(this);
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 if (global.constructor.name == 'SharedWorkerGlobalScope') { 217 if (global.constructor.name == 'SharedWorkerGlobalScope') {
218 global.addEventListener('connect', function(e) { 218 global.addEventListener('connect', function(e) {
219 var port = e.ports[0]; 219 var port = e.ports[0];
220 new MetadataDispatcher(port); 220 new MetadataDispatcher(port);
221 port.start(); 221 port.start();
222 }); 222 });
223 } else { 223 } else {
224 // Non-shared worker. 224 // Non-shared worker.
225 new MetadataDispatcher(global); 225 new MetadataDispatcher(global);
226 } 226 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698