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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/main/Main.js

Issue 2457723004: DevTools: do not wait for filesystems to create connection. (Closed)
Patch Set: Created 4 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
« 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 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). 3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com).
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 * @suppressGlobalPropertiesCheck 133 * @suppressGlobalPropertiesCheck
134 */ 134 */
135 _createAppUI: function() 135 _createAppUI: function()
136 { 136 {
137 console.time("Main._createAppUI"); 137 console.time("Main._createAppUI");
138 138
139 WebInspector.viewManager = new WebInspector.ViewManager(); 139 WebInspector.viewManager = new WebInspector.ViewManager();
140 140
141 // Request filesystems early, we won't create connections until callback is fired. Things will happen in parallel. 141 // Request filesystems early, we won't create connections until callback is fired. Things will happen in parallel.
142 WebInspector.isolatedFileSystemManager = new WebInspector.IsolatedFileSy stemManager(); 142 WebInspector.isolatedFileSystemManager = new WebInspector.IsolatedFileSy stemManager();
143 WebInspector.isolatedFileSystemManager.waitForFileSystems()
144 .then(this._didInitializeFileSystemManager.bind(this));
145 143
146 var themeSetting = WebInspector.settings.createSetting("uiTheme", "defau lt"); 144 var themeSetting = WebInspector.settings.createSetting("uiTheme", "defau lt");
147 WebInspector.initializeUIUtils(document, themeSetting); 145 WebInspector.initializeUIUtils(document, themeSetting);
148 themeSetting.addChangeListener(WebInspector.reload.bind(WebInspector)); 146 themeSetting.addChangeListener(WebInspector.reload.bind(WebInspector));
149 147
150 WebInspector.installComponentRootStyles(/** @type {!Element} */ (documen t.body)); 148 WebInspector.installComponentRootStyles(/** @type {!Element} */ (documen t.body));
151 149
152 this._addMainEventListeners(document); 150 this._addMainEventListeners(document);
153 151
154 var canDock = !!Runtime.queryParam("can_dock"); 152 var canDock = !!Runtime.queryParam("can_dock");
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 241
244 /** 242 /**
245 * @param {string} value 243 * @param {string} value
246 * @param {!WebInspector.QueryParamHandler} handler 244 * @param {!WebInspector.QueryParamHandler} handler
247 */ 245 */
248 function handleQueryParam(value, handler) 246 function handleQueryParam(value, handler)
249 { 247 {
250 handler.handleQueryParam(value); 248 handler.handleQueryParam(value);
251 } 249 }
252 250
253 this._appUIShown = true; 251 // Allow UI cycles to repaint prior to creating connection.
254 if (this._fileSystemManagerInitialized) { 252 setTimeout(this._initializeTarget.bind(this), 0);
255 // Allow UI cycles to repaint prior to creating connection.
256 setTimeout(this._initializeTarget.bind(this), 0);
257 }
258 console.timeEnd("Main._showAppUI"); 253 console.timeEnd("Main._showAppUI");
259 }, 254 },
260 255
261 _didInitializeFileSystemManager: function()
262 {
263 this._fileSystemManagerInitialized = true;
264 if (this._appUIShown)
265 this._initializeTarget();
266 },
267
268 _initializeTarget: function() 256 _initializeTarget: function()
269 { 257 {
270 console.time("Main._initializeTarget"); 258 console.time("Main._initializeTarget");
271 WebInspector.targetManager.connectToMainTarget(webSocketConnectionLost); 259 WebInspector.targetManager.connectToMainTarget(webSocketConnectionLost);
272 260
273 InspectorFrontendHost.readyForTest(); 261 InspectorFrontendHost.readyForTest();
274 // Asynchronously run the extensions. 262 // Asynchronously run the extensions.
275 setTimeout(this._lateInitialization.bind(this), 100); 263 setTimeout(this._lateInitialization.bind(this), 100);
276 console.timeEnd("Main._initializeTarget"); 264 console.timeEnd("Main._initializeTarget");
277 265
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after
1083 * @override 1071 * @override
1084 * @return {?Element} 1072 * @return {?Element}
1085 */ 1073 */
1086 settingElement: function() 1074 settingElement: function()
1087 { 1075 {
1088 return WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIStri ng("Show rulers"), WebInspector.moduleSetting("showMetricsRulers")); 1076 return WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIStri ng("Show rulers"), WebInspector.moduleSetting("showMetricsRulers"));
1089 } 1077 }
1090 }; 1078 };
1091 1079
1092 new WebInspector.Main(); 1080 new WebInspector.Main();
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