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

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

Issue 18133010: Update metadata_dispatcher.js to check for SharedWorkerGlobalScope only (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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');
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 ]; 207 ];
208 208
209 nextStep(); 209 nextStep();
210 }; 210 };
211 211
212 // Webworker spec says that the worker global object is called self. That's 212 // Webworker spec says that the worker global object is called self. That's
213 // a terrible name since we use it all over the chrome codebase to capture 213 // a terrible name since we use it all over the chrome codebase to capture
214 // the 'this' keyword in lambdas. 214 // the 'this' keyword in lambdas.
215 var global = self; 215 var global = self;
216 216
217 // TODO(cdumez): Remove support for SharedWorkerContext name after Blink is 217 if (global.constructor.name == 'SharedWorkerGlobalScope') {
218 // rolled.
219 if (global.constructor.name == 'SharedWorkerContext' ||
220 global.constructor.name == 'SharedWorkerGlobalScope') {
221 global.addEventListener('connect', function(e) { 218 global.addEventListener('connect', function(e) {
222 var port = e.ports[0]; 219 var port = e.ports[0];
223 new MetadataDispatcher(port); 220 new MetadataDispatcher(port);
224 port.start(); 221 port.start();
225 }); 222 });
226 } else { 223 } else {
227 // Non-shared worker. 224 // Non-shared worker.
228 new MetadataDispatcher(global); 225 new MetadataDispatcher(global);
229 } 226 }
OLDNEW
« 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