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

Side by Side Diff: Source/devtools/front_end/sdk/DOMModel.js

Issue 614323003: DevTools: enable by default disableAgentsWhenProfile experiment (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: unnecessary line was removed Created 6 years, 2 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2009, 2010 Google Inc. All rights reserved.
3 * Copyright (C) 2009 Joseph Pecoraro 3 * Copyright (C) 2009 Joseph Pecoraro
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 930 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 this._idToDOMNode = {}; 941 this._idToDOMNode = {};
942 /** @type {?WebInspector.DOMDocument} */ 942 /** @type {?WebInspector.DOMDocument} */
943 this._document = null; 943 this._document = null;
944 /** @type {!Object.<number, boolean>} */ 944 /** @type {!Object.<number, boolean>} */
945 this._attributeLoadNodeIds = {}; 945 this._attributeLoadNodeIds = {};
946 target.registerDOMDispatcher(new WebInspector.DOMDispatcher(this)); 946 target.registerDOMDispatcher(new WebInspector.DOMDispatcher(this));
947 947
948 this._defaultHighlighter = new WebInspector.DefaultDOMNodeHighlighter(this._ agent); 948 this._defaultHighlighter = new WebInspector.DefaultDOMNodeHighlighter(this._ agent);
949 this._highlighter = this._defaultHighlighter; 949 this._highlighter = this._defaultHighlighter;
950 950
951 if (Runtime.experiments.isEnabled("disableAgentsWhenProfile"))
952 WebInspector.profilingLock().addEventListener(WebInspector.Lock.Events.S tateChanged, this._profilingStateChanged, this);
953
954 this._agent.enable(); 951 this._agent.enable();
955 } 952 }
956 953
957 WebInspector.DOMModel.Events = { 954 WebInspector.DOMModel.Events = {
958 AttrModified: "AttrModified", 955 AttrModified: "AttrModified",
959 AttrRemoved: "AttrRemoved", 956 AttrRemoved: "AttrRemoved",
960 CharacterDataModified: "CharacterDataModified", 957 CharacterDataModified: "CharacterDataModified",
961 NodeInserted: "NodeInserted", 958 NodeInserted: "NodeInserted",
962 NodeInspected: "NodeInspected", 959 NodeInspected: "NodeInspected",
963 NodeRemoved: "NodeRemoved", 960 NodeRemoved: "NodeRemoved",
964 DocumentUpdated: "DocumentUpdated", 961 DocumentUpdated: "DocumentUpdated",
965 ChildNodeCountUpdated: "ChildNodeCountUpdated", 962 ChildNodeCountUpdated: "ChildNodeCountUpdated",
966 UndoRedoRequested: "UndoRedoRequested", 963 UndoRedoRequested: "UndoRedoRequested",
967 UndoRedoCompleted: "UndoRedoCompleted", 964 UndoRedoCompleted: "UndoRedoCompleted",
968 } 965 }
969 966
970 WebInspector.DOMModel.prototype = { 967 WebInspector.DOMModel.prototype = {
971 _profilingStateChanged: function() 968 suspendModel: function()
972 { 969 {
973 if (WebInspector.profilingLock().isAcquired()) 970 this._agent.disable();
974 this._agent.disable(); 971 },
975 else 972
976 this._agent.enable(); 973 resumeModel: function()
974 {
975 this._agent.enable();
977 }, 976 },
978 977
979 /** 978 /**
980 * @param {function(!WebInspector.DOMDocument)=} callback 979 * @param {function(!WebInspector.DOMDocument)=} callback
981 */ 980 */
982 requestDocument: function(callback) 981 requestDocument: function(callback)
983 { 982 {
984 if (this._document) { 983 if (this._document) {
985 if (callback) 984 if (callback)
986 callback(this._document); 985 callback(this._document);
(...skipping 972 matching lines...) Expand 10 before | Expand all | Expand 10 after
1959 * @param {boolean} inspectUAShadowDOM 1958 * @param {boolean} inspectUAShadowDOM
1960 * @param {!DOMAgent.HighlightConfig} config 1959 * @param {!DOMAgent.HighlightConfig} config
1961 * @param {function(?Protocol.Error)=} callback 1960 * @param {function(?Protocol.Error)=} callback
1962 */ 1961 */
1963 setInspectModeEnabled: function(enabled, inspectUAShadowDOM, config, callbac k) 1962 setInspectModeEnabled: function(enabled, inspectUAShadowDOM, config, callbac k)
1964 { 1963 {
1965 WebInspector.overridesSupport.setTouchEmulationSuspended(enabled); 1964 WebInspector.overridesSupport.setTouchEmulationSuspended(enabled);
1966 this._agent.setInspectModeEnabled(enabled, inspectUAShadowDOM, config, c allback); 1965 this._agent.setInspectModeEnabled(enabled, inspectUAShadowDOM, config, c allback);
1967 } 1966 }
1968 } 1967 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698