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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/audits/AuditController.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 * Copyright (C) 2013 Samsung Electronics. All rights reserved. 3 * Copyright (C) 2013 Samsung Electronics. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 var results = []; 63 var results = [];
64 var mainResourceURL = target.inspectedURL(); 64 var mainResourceURL = target.inspectedURL();
65 var categoriesDone = 0; 65 var categoriesDone = 0;
66 66
67 function categoryDoneCallback() { 67 function categoryDoneCallback() {
68 if (++categoriesDone !== categories.length) 68 if (++categoriesDone !== categories.length)
69 return; 69 return;
70 resultCallback(mainResourceURL, results); 70 resultCallback(mainResourceURL, results);
71 } 71 }
72 72
73 var networkLog = SDK.NetworkLog.fromTarget(target); 73 var requests = SDK.networkLog.requestsForTarget(target).slice();
74 var requests = networkLog ? networkLog.requests().slice() : [];
75 var compositeProgress = new Common.CompositeProgress(this._progress); 74 var compositeProgress = new Common.CompositeProgress(this._progress);
76 var subprogresses = []; 75 var subprogresses = [];
77 for (var i = 0; i < categories.length; ++i) 76 for (var i = 0; i < categories.length; ++i)
78 subprogresses.push(new Common.ProgressProxy(compositeProgress.createSubPro gress(), categoryDoneCallback)); 77 subprogresses.push(new Common.ProgressProxy(compositeProgress.createSubPro gress(), categoryDoneCallback));
79 for (var i = 0; i < categories.length; ++i) { 78 for (var i = 0; i < categories.length; ++i) {
80 if (this._progress.isCanceled()) { 79 if (this._progress.isCanceled()) {
81 subprogresses[i].done(); 80 subprogresses[i].done();
82 continue; 81 continue;
83 } 82 }
84 var category = categories[i]; 83 var category = categories[i];
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 var callback = this._pageReloadCallback; 154 var callback = this._pageReloadCallback;
156 delete this._pageReloadCallback; 155 delete this._pageReloadCallback;
157 callback(); 156 callback();
158 } 157 }
159 } 158 }
160 159
161 clearResults() { 160 clearResults() {
162 this._auditsPanel.clearResults(); 161 this._auditsPanel.clearResults();
163 } 162 }
164 }; 163 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698