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

Side by Side Diff: Source/devtools/front_end/sdk/CSSStyleModel.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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 this._styleLoader = new WebInspector.CSSStyleModel.ComputedStyleLoader(this) ; 42 this._styleLoader = new WebInspector.CSSStyleModel.ComputedStyleLoader(this) ;
43 this._domModel.addEventListener(WebInspector.DOMModel.Events.UndoRedoRequest ed, this._undoRedoRequested, this); 43 this._domModel.addEventListener(WebInspector.DOMModel.Events.UndoRedoRequest ed, this._undoRedoRequested, this);
44 this._domModel.addEventListener(WebInspector.DOMModel.Events.UndoRedoComplet ed, this._undoRedoCompleted, this); 44 this._domModel.addEventListener(WebInspector.DOMModel.Events.UndoRedoComplet ed, this._undoRedoCompleted, this);
45 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Eve ntTypes.MainFrameNavigated, this._mainFrameNavigated, this); 45 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Eve ntTypes.MainFrameNavigated, this._mainFrameNavigated, this);
46 target.registerCSSDispatcher(new WebInspector.CSSDispatcher(this)); 46 target.registerCSSDispatcher(new WebInspector.CSSDispatcher(this));
47 this._agent.enable(this._wasEnabled.bind(this)); 47 this._agent.enable(this._wasEnabled.bind(this));
48 /** @type {!StringMap.<!WebInspector.CSSStyleSheetHeader>} */ 48 /** @type {!StringMap.<!WebInspector.CSSStyleSheetHeader>} */
49 this._styleSheetIdToHeader = new StringMap(); 49 this._styleSheetIdToHeader = new StringMap();
50 /** @type {!StringMap.<!Object.<!PageAgent.FrameId, !Array.<!CSSAgent.StyleS heetId>>>} */ 50 /** @type {!StringMap.<!Object.<!PageAgent.FrameId, !Array.<!CSSAgent.StyleS heetId>>>} */
51 this._styleSheetIdsForURL = new StringMap(); 51 this._styleSheetIdsForURL = new StringMap();
52
53 if (Runtime.experiments.isEnabled("disableAgentsWhenProfile"))
54 WebInspector.profilingLock().addEventListener(WebInspector.Lock.Events.S tateChanged, this._profilingStateChanged, this);
55 } 52 }
56 53
57 WebInspector.CSSStyleModel.PseudoStatePropertyName = "pseudoState"; 54 WebInspector.CSSStyleModel.PseudoStatePropertyName = "pseudoState";
58 55
59 /** 56 /**
60 * @param {!WebInspector.CSSStyleModel} cssModel 57 * @param {!WebInspector.CSSStyleModel} cssModel
61 * @param {!Array.<!CSSAgent.RuleMatch>|undefined} matchArray 58 * @param {!Array.<!CSSAgent.RuleMatch>|undefined} matchArray
62 * @return {!Array.<!WebInspector.CSSRule>} 59 * @return {!Array.<!WebInspector.CSSRule>}
63 */ 60 */
64 WebInspector.CSSStyleModel.parseRuleMatchArrayPayload = function(cssModel, match Array) 61 WebInspector.CSSStyleModel.parseRuleMatchArrayPayload = function(cssModel, match Array)
(...skipping 11 matching lines...) Expand all
76 ModelWasEnabled: "ModelWasEnabled", 73 ModelWasEnabled: "ModelWasEnabled",
77 StyleSheetAdded: "StyleSheetAdded", 74 StyleSheetAdded: "StyleSheetAdded",
78 StyleSheetChanged: "StyleSheetChanged", 75 StyleSheetChanged: "StyleSheetChanged",
79 StyleSheetRemoved: "StyleSheetRemoved", 76 StyleSheetRemoved: "StyleSheetRemoved",
80 MediaQueryResultChanged: "MediaQueryResultChanged", 77 MediaQueryResultChanged: "MediaQueryResultChanged",
81 } 78 }
82 79
83 WebInspector.CSSStyleModel.MediaTypes = ["all", "braille", "embossed", "handheld ", "print", "projection", "screen", "speech", "tty", "tv"]; 80 WebInspector.CSSStyleModel.MediaTypes = ["all", "braille", "embossed", "handheld ", "print", "projection", "screen", "speech", "tty", "tv"];
84 81
85 WebInspector.CSSStyleModel.prototype = { 82 WebInspector.CSSStyleModel.prototype = {
86 _profilingStateChanged: function() 83 suspendModel: function()
87 { 84 {
88 if (WebInspector.profilingLock().isAcquired()) { 85 this._agent.disable();
89 this._agent.disable(); 86 this._isEnabled = false;
90 this._isEnabled = false; 87 this._resetStyleSheets();
91 this._resetStyleSheets(); 88 },
92 } else { 89
93 this._agent.enable(this._wasEnabled.bind(this)); 90 resumeModel: function()
94 } 91 {
92 this._agent.enable(this._wasEnabled.bind(this));
95 }, 93 },
96 94
97 /** 95 /**
98 * @param {function(!Array.<!WebInspector.CSSMedia>)} userCallback 96 * @param {function(!Array.<!WebInspector.CSSMedia>)} userCallback
99 */ 97 */
100 getMediaQueries: function(userCallback) 98 getMediaQueries: function(userCallback)
101 { 99 {
102 /** 100 /**
103 * @param {?Protocol.Error} error 101 * @param {?Protocol.Error} error
104 * @param {?Array.<!CSSAgent.CSSMedia>} payload 102 * @param {?Array.<!CSSAgent.CSSMedia>} payload
(...skipping 1611 matching lines...) Expand 10 before | Expand all | Expand 10 after
1716 for (var i = 0; i < callbacks.length; ++i) 1714 for (var i = 0; i < callbacks.length; ++i)
1717 callbacks[i](computedStyle); 1715 callbacks[i](computedStyle);
1718 } 1716 }
1719 } 1717 }
1720 } 1718 }
1721 1719
1722 /** 1720 /**
1723 * @type {!WebInspector.CSSStyleModel} 1721 * @type {!WebInspector.CSSStyleModel}
1724 */ 1722 */
1725 WebInspector.cssModel; 1723 WebInspector.cssModel;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698