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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/HAREntry.js

Issue 2749043005: [DevTools] Make NetworkLog a singleton, and not an SDKModel (Closed)
Patch Set: review comments addressed Created 3 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 time: this._request.timing ? SDK.HAREntry._toMilliseconds(this._request.du ration) : 0, 66 time: this._request.timing ? SDK.HAREntry._toMilliseconds(this._request.du ration) : 0,
67 request: this._buildRequest(), 67 request: this._buildRequest(),
68 response: this._buildResponse(), 68 response: this._buildResponse(),
69 cache: {}, // Not supported yet. 69 cache: {}, // Not supported yet.
70 timings: this._buildTimings(), 70 timings: this._buildTimings(),
71 serverIPAddress: ipAddress 71 serverIPAddress: ipAddress
72 }; 72 };
73 73
74 if (this._request.connectionId !== '0') 74 if (this._request.connectionId !== '0')
75 entry.connection = this._request.connectionId; 75 entry.connection = this._request.connectionId;
76 var page = SDK.NetworkLog.pageLoadForRequest(this._request); 76 var page = SDK.networkLog.pageLoadForRequest(this._request);
77 if (page) 77 if (page)
78 entry.pageref = 'page_' + page.id; 78 entry.pageref = 'page_' + page.id;
79 return entry; 79 return entry;
80 } 80 }
81 81
82 /** 82 /**
83 * @return {!Object} 83 * @return {!Object}
84 */ 84 */
85 _buildRequest() { 85 _buildRequest() {
86 var headersText = this._request.requestHeadersText(); 86 var headersText = this._request.requestHeadersText();
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 } 298 }
299 299
300 /** 300 /**
301 * @return {!Array.<!Object>} 301 * @return {!Array.<!Object>}
302 */ 302 */
303 _buildPages() { 303 _buildPages() {
304 var seenIdentifiers = {}; 304 var seenIdentifiers = {};
305 var pages = []; 305 var pages = [];
306 for (var i = 0; i < this._requests.length; ++i) { 306 for (var i = 0; i < this._requests.length; ++i) {
307 var request = this._requests[i]; 307 var request = this._requests[i];
308 var page = SDK.NetworkLog.pageLoadForRequest(request); 308 var page = SDK.networkLog.pageLoadForRequest(request);
309 if (!page || seenIdentifiers[page.id]) 309 if (!page || seenIdentifiers[page.id])
310 continue; 310 continue;
311 seenIdentifiers[page.id] = true; 311 seenIdentifiers[page.id] = true;
312 pages.push(this._convertPage(page, request)); 312 pages.push(this._convertPage(page, request));
313 } 313 }
314 return pages; 314 return pages;
315 } 315 }
316 316
317 /** 317 /**
318 * @param {!SDK.PageLoad} page 318 * @param {!SDK.PageLoad} page
(...skipping 25 matching lines...) Expand all
344 * @param {number} time 344 * @param {number} time
345 * @return {number} 345 * @return {number}
346 */ 346 */
347 _pageEventTime(page, time) { 347 _pageEventTime(page, time) {
348 var startTime = page.startTime; 348 var startTime = page.startTime;
349 if (time === -1 || startTime === -1) 349 if (time === -1 || startTime === -1)
350 return -1; 350 return -1;
351 return SDK.HAREntry._toMilliseconds(time - startTime); 351 return SDK.HAREntry._toMilliseconds(time - startTime);
352 } 352 }
353 }; 353 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698