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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js

Issue 2563883005: [DevTools] clean console on navigation as early as possible (Closed)
Patch Set: Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js
index 606fd984d62372b5ac663166a2b884f39a4dc099..a6fea2b6de4ba42baa3005102a26978dd4291279 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js
@@ -204,8 +204,6 @@ SDK.ResourceTreeModel = class extends SDK.SDKModel {
this.dispatchEventToListeners(SDK.ResourceTreeModel.Events.MainFrameNavigated, frame);
if (Common.moduleSetting('preserveConsoleLog').get())
Common.console.log(Common.UIString('Navigated to %s', frame.url));
- else
- this.target().consoleModel.clear();
}
if (addedOrigin)
this._securityOriginManager.addSecurityOrigin(addedOrigin);
@@ -239,6 +237,21 @@ SDK.ResourceTreeModel = class extends SDK.SDKModel {
}
/**
+ * @param {!Protocol.Page.FrameId} frameId
+ */
+ _frameStartedLoading(frameId) {
+ // Do nothing unless cached resource tree is processed - it will overwrite everything.
+ if (!this._cachedResourcesProcessed)
+ return;
+
+ var frame = this._frames.get(frameId);
+ if (frame && !frame.isMainFrame())
+ return;
+ if (!Common.moduleSetting('preserveConsoleLog').get())
+ this.target().consoleModel.clear();
+ }
+
+ /**
* @param {!Common.Event} event
*/
_onRequestFinished(event) {
@@ -788,6 +801,7 @@ SDK.PageDispatcher = class {
* @param {!Protocol.Page.FrameId} frameId
*/
frameStartedLoading(frameId) {
+ this._resourceTreeModel._frameStartedLoading(frameId);
}
/**
« 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