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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/persistence/Persistence.js

Issue 2784733002: DevTools: prepare tests for Persistence2.0 release (Closed)
Patch Set: address comments + three special tests Created 3 years, 8 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
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/persistence/DefaultMapping.js ('k') | 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 * @unrestricted 5 * @unrestricted
6 */ 6 */
7 Persistence.Persistence = class extends Common.Object { 7 Persistence.Persistence = class extends Common.Object {
8 /** 8 /**
9 * @param {!Workspace.Workspace} workspace 9 * @param {!Workspace.Workspace} workspace
10 * @param {!Bindings.BreakpointManager} breakpointManager 10 * @param {!Bindings.BreakpointManager} breakpointManager
(...skipping 14 matching lines...) Expand all
25 Components.Linkifier.setLinkDecorator(linkDecorator); 25 Components.Linkifier.setLinkDecorator(linkDecorator);
26 this._mapping = 26 this._mapping =
27 new Persistence.Automapping(workspace, this._validateBinding.bind(this ), this._onBindingRemoved.bind(this)); 27 new Persistence.Automapping(workspace, this._validateBinding.bind(this ), this._onBindingRemoved.bind(this));
28 } else { 28 } else {
29 this._mapping = new Persistence.DefaultMapping( 29 this._mapping = new Persistence.DefaultMapping(
30 workspace, fileSystemMapping, this._validateBinding.bind(this), this._ onBindingRemoved.bind(this)); 30 workspace, fileSystemMapping, this._validateBinding.bind(this), this._ onBindingRemoved.bind(this));
31 } 31 }
32 } 32 }
33 33
34 /** 34 /**
35 * @param {function(function(!Persistence.PersistenceBinding), function(!Persi stence.PersistenceBinding)):{dispose: function()}} mappingFactory
36 */
37 _setMappingForTest(mappingFactory) {
38 this._mapping.dispose();
39 this._mapping = mappingFactory(this._validateBinding.bind(this), this._onBin dingRemoved.bind(this));
40 }
41
42 /**
35 * @param {!Persistence.PersistenceBinding} binding 43 * @param {!Persistence.PersistenceBinding} binding
36 */ 44 */
37 _validateBinding(binding) { 45 _validateBinding(binding) {
38 if (!Runtime.experiments.isEnabled('persistenceValidation') || binding.netwo rk.contentType().isFromSourceMap() || 46 if (!Runtime.experiments.isEnabled('persistenceValidation') || binding.netwo rk.contentType().isFromSourceMap() ||
39 !binding.fileSystem.contentType().isTextType()) { 47 !binding.fileSystem.contentType().isTextType()) {
40 this._establishBinding(binding); 48 this._establishBinding(binding);
41 return; 49 return;
42 } 50 }
43 51
44 Promise.all([binding.network.requestContent(), binding.fileSystem.requestCon tent()]).then(onContents.bind(this)); 52 Promise.all([binding.network.requestContent(), binding.fileSystem.requestCon tent()]).then(onContents.bind(this));
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 constructor(network, fileSystem, exactMatch) { 385 constructor(network, fileSystem, exactMatch) {
378 this.network = network; 386 this.network = network;
379 this.fileSystem = fileSystem; 387 this.fileSystem = fileSystem;
380 this.exactMatch = exactMatch; 388 this.exactMatch = exactMatch;
381 this._removed = false; 389 this._removed = false;
382 } 390 }
383 }; 391 };
384 392
385 /** @type {!Persistence.Persistence} */ 393 /** @type {!Persistence.Persistence} */
386 Persistence.persistence; 394 Persistence.persistence;
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/persistence/DefaultMapping.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698