Bug 1034181 - Rename UsageReportActor to CSSUsageActor; r=harth
authorJoe Walker <jwalker@mozilla.com>
Thu, 10 Jul 2014 14:37:17 +0100
changeset 214087 e6135b31091bf234d6016bb97ff16483429cdc67
parent 214086 ed3d46b267f5ea31caf0ea9a6886444888e1e6d5
child 214088 d5733ac865af05d2af3ec34cc186d03d98f3cae9
push id3857
push userraliiev@mozilla.com
push dateTue, 02 Sep 2014 16:39:23 +0000
treeherdermozilla-beta@5638b907b505 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersharth
bugs1034181
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1034181 - Rename UsageReportActor to CSSUsageActor; r=harth
browser/devtools/styleeditor/styleeditor.xul
toolkit/devtools/server/actors/csscoverage.js
--- a/browser/devtools/styleeditor/styleeditor.xul
+++ b/browser/devtools/styleeditor/styleeditor.xul
@@ -163,17 +163,17 @@
     </xul:box>   <!-- .splitview-root -->
 
     <xul:box class="csscoverage-template" hidden="true">
       <xul:toolbar class="devtools-toolbar csscoverage-toolbar">
         <xul:button class="devtools-toolbarbutton csscoverage-toolbarbutton"
             label="&csscoverage.backButton;"
             onclick="${onback}"/>
       </xul:toolbar>
-      <!-- The data for this comes from UsageReportActor.createPageReport -->
+      <!-- The data for this comes from CSSUsageActor.createPageReport -->
       <div class="csscoverage-report-container">
         <div class="csscoverage-report-content">
           <div class="csscoverage-report-summary">
             <div class="csscoverage-report-chart"/>
           </div>
           <div class="csscoverage-report-unused">
             <h2>&csscoverage.unused;</h2>
             <p>&csscoverage.noMatches;</p>
--- a/toolkit/devtools/server/actors/csscoverage.js
+++ b/toolkit/devtools/server/actors/csscoverage.js
@@ -39,18 +39,18 @@ const l10n = exports.l10n = {
     if (this._stringBundle == null) {
       this._stringBundle = Services.strings.createBundle(this._URI);
     }
     return this._stringBundle.GetStringFromName(msg);
   }
 };
 
 /**
- * UsageReport manages the collection of CSS usage data.
- * The core of a UsageReport is a JSON-able data structure called _knownRules
+ * CSSUsage manages the collection of CSS usage data.
+ * The core of a CSSUsage is a JSON-able data structure called _knownRules
  * which looks like this:
  * This records the CSSStyleRules and their usage.
  * The format is:
  *     Map({
  *       <CSS-URL>|<START-LINE>|<START-COLUMN>: {
  *         selectorText: <CSSStyleRule.selectorText>,
  *         test: <simplify(CSSStyleRule.selectorText)>,
  *         cssText: <CSSStyleRule.cssText>,
@@ -69,18 +69,18 @@ const l10n = exports.l10n = {
  *         cssText: "p.quote { color: red; }",
  *         isUsed: true,
  *         presentOn: Set([ "http://eg.com/page1.html", ... ]),
  *         preLoadOn: Set([ "http://eg.com/page1.html" ]),
  *         isError: false,
  *       }, ...
  *     });
  */
-let UsageReportActor = protocol.ActorClass({
-  typeName: "usageReport",
+let CSSUsageActor = protocol.ActorClass({
+  typeName: "cssUsage",
 
   events: {
     "state-change" : {
       type: "stateChange",
       stateChange: Arg(0, "json")
     }
   },
 
@@ -472,17 +472,17 @@ let UsageReportActor = protocol.ActorCla
    */
   _testOnly_visitedPages: method(function() {
     return [...this._visitedPages];
   }, {
     response: { value: RetVal("array:string") }
   }),
 });
 
-exports.UsageReportActor = UsageReportActor;
+exports.CSSUsageActor = CSSUsageActor;
 
 /**
  * Generator that filters the CSSRules out of _getAllRules so it only
  * iterates over the CSSStyleRules
  */
 function* getAllSelectorRules(document) {
   for (let rule of getAllRules(document)) {
     if (rule.type === CSSRule.STYLE_RULE && rule.selectorText !== "") {
@@ -726,22 +726,22 @@ const sheetToUrl = exports.sheetToUrl = 
  * so we only allow one.
  */
 let isRunning = false;
 let notification;
 let target;
 let chromeWindow;
 
 /**
- * Front for UsageReportActor
+ * Front for CSSUsageActor
  */
-const UsageReportFront = protocol.FrontClass(UsageReportActor, {
+const CSSUsageFront = protocol.FrontClass(CSSUsageActor, {
   initialize: function(client, form) {
     protocol.Front.prototype.initialize.call(this, client, form);
-    this.actorID = form.usageReportActor;
+    this.actorID = form.cssUsageActor;
     this.manage(this);
   },
 
   _onStateChange: protocol.preEvent("state-change", function(ev) {
     isRunning = ev.isRunning;
     ev.target = target;
 
     if (isRunning) {
@@ -801,40 +801,40 @@ const UsageReportFront = protocol.FrontC
   /**
    * We count STARTING and STOPPING as 'running'
    */
   isRunning: function() {
     return isRunning;
   }
 });
 
-exports.UsageReportFront = UsageReportFront;
+exports.CSSUsageFront = CSSUsageFront;
 
 /**
  * Registration / De-registration
  */
 exports.register = function(handle) {
-  handle.addGlobalActor(UsageReportActor, "usageReportActor");
-  handle.addTabActor(UsageReportActor, "usageReportActor");
+  handle.addGlobalActor(CSSUsageActor, "cssUsageActor");
+  handle.addTabActor(CSSUsageActor, "cssUsageActor");
 };
 
 exports.unregister = function(handle) {
-  handle.removeGlobalActor(UsageReportActor, "usageReportActor");
-  handle.removeTabActor(UsageReportActor, "usageReportActor");
+  handle.removeGlobalActor(CSSUsageActor, "cssUsageActor");
+  handle.removeTabActor(CSSUsageActor, "cssUsageActor");
 };
 
 const knownFronts = new WeakMap();
 
 /**
- * Create a UsageReportFront only when needed (returns a promise)
+ * Create a CSSUsageFront only when needed (returns a promise)
  * For notes on target.makeRemote(), see
  * https://bugzilla.mozilla.org/show_bug.cgi?id=1016330#c7
  */
 const getUsage = exports.getUsage = function(target) {
   return target.makeRemote().then(() => {
     let front = knownFronts.get(target.client)
-    if (front == null && target.form.usageReportActor != null) {
-      front = new UsageReportFront(target.client, target.form);
+    if (front == null && target.form.cssUsageActor != null) {
+      front = new CSSUsageFront(target.client, target.form);
       knownFronts.set(target.client, front);
     }
     return front;
   });
 };