Bug 903511 - Rename "GripClient" to "ObjectClient". r=fitzgen
authorAnup Allamsetty <allamsetty.anup@gmail.com>
Tue, 13 Aug 2013 12:08:30 -0400
changeset 142541 ab760067683b2c7ebace814bba54765b315100d3
parent 142540 94369a32a3acf8436b462d7b3812e0ddc5d6f1e7
child 142542 1155941227094c57da76c877d5370e0b49ef5a59
push id32443
push userMs2ger@gmail.com
push dateWed, 14 Aug 2013 12:48:34 +0000
treeherdermozilla-inbound@c2050f734802 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfitzgen
bugs903511
milestone26.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 903511 - Rename "GripClient" to "ObjectClient". r=fitzgen
browser/devtools/debugger/debugger-view.js
browser/devtools/scratchpad/scratchpad.js
browser/devtools/shared/widgets/VariablesViewController.jsm
browser/devtools/webconsole/webconsole.js
toolkit/devtools/client/dbg-client.jsm
toolkit/devtools/webconsole/test/test_bug819670_getter_throws.html
toolkit/devtools/webconsole/test/test_object_actor.html
toolkit/devtools/webconsole/test/test_object_actor_native_getters.html
toolkit/devtools/webconsole/test/test_object_actor_native_getters_lenient_this.html
--- a/browser/devtools/debugger/debugger-view.js
+++ b/browser/devtools/debugger/debugger-view.js
@@ -126,17 +126,17 @@ let DebuggerView = {
       onlyEnumVisible: Prefs.variablesOnlyEnumVisible,
       searchEnabled: Prefs.variablesSearchboxVisible,
       eval: DebuggerController.StackFrames.evaluate,
       lazyEmpty: true
     });
 
     // Attach a controller that handles interfacing with the debugger protocol.
     VariablesViewController.attach(this.Variables, {
-      getGripClient: aObject => gThreadClient.pauseGrip(aObject)
+      getObjectClient: aObject => gThreadClient.pauseGrip(aObject)
     });
 
     // Relay events from the VariablesView.
     this.Variables.on("fetched", (aEvent, aType) => {
       switch (aType) {
         case "variables":
           window.dispatchEvent(document, "Debugger:FetchedVariables");
           break;
--- a/browser/devtools/scratchpad/scratchpad.js
+++ b/browser/devtools/scratchpad/scratchpad.js
@@ -33,17 +33,17 @@ Cu.import("resource://gre/modules/osfile
 Cu.import("resource:///modules/devtools/ViewHelpers.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "VariablesView",
   "resource:///modules/devtools/VariablesView.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "VariablesViewController",
   "resource:///modules/devtools/VariablesViewController.jsm");
 
-XPCOMUtils.defineLazyModuleGetter(this, "GripClient",
+XPCOMUtils.defineLazyModuleGetter(this, "ObjectClient",
   "resource://gre/modules/devtools/dbg-client.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "WebConsoleUtils",
   "resource://gre/modules/devtools/WebConsoleUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "DebuggerServer",
   "resource://gre/modules/devtools/dbg-server.jsm");
 
@@ -485,18 +485,18 @@ var Scratchpad = {
 
       if (aError) {
         this.writeAsErrorComment(aError.exception).then(resolve, reject);
       }
       else if (VariablesView.isPrimitive({ value: aResult })) {
         this._writePrimitiveAsComment(aResult).then(resolve, reject);
       }
       else {
-        let gripClient = new GripClient(this.debuggerClient, aResult);
-        gripClient.getDisplayString(aResponse => {
+        let objectClient = new ObjectClient(this.debuggerClient, aResult);
+        objectClient.getDisplayString(aResponse => {
           if (aResponse.error) {
             reportError("display", aResponse);
             reject(aResponse);
           }
           else {
             let string = aResponse.displayString;
             if (string && string.type == "null") {
               string = "Exception: " +
@@ -579,26 +579,26 @@ var Scratchpad = {
   {
     let deferred = promise.defer();
 
     if (VariablesView.isPrimitive({ value: aError })) {
       deferred.resolve(aError);
     }
     else {
       let reject = aReason => deferred.reject(aReason);
-      let gripClient = new GripClient(this.debuggerClient, aError);
+      let objectClient = new ObjectClient(this.debuggerClient, aError);
 
       // Because properties on Error objects are lazily added, this roundabout
       // way of getting all the properties is required, rather than simply
       // using getPrototypeAndProperties. See bug 724768.
       let names = ["message", "stack", "fileName", "lineNumber"];
       let promises = names.map(aName => {
         let deferred = promise.defer();
 
-        gripClient.getProperty(aName, aResponse => {
+        objectClient.getProperty(aName, aResponse => {
           if (aResponse.error) {
             deferred.reject(aResponse);
           }
           else {
             deferred.resolve({
               name: aName,
               descriptor: aResponse.descriptor
             });
@@ -607,17 +607,17 @@ var Scratchpad = {
 
         return deferred.promise;
       });
 
       {
         // We also need to use getPrototypeAndProperties to retrieve any
         // safeGetterValues in case this is a DOM error.
         let deferred = promise.defer();
-        gripClient.getPrototypeAndProperties(aResponse => {
+        objectClient.getPrototypeAndProperties(aResponse => {
           if (aResponse.error) {
             deferred.reject(aResponse);
           }
           else {
             deferred.resolve(aResponse);
           }
         });
         promises.push(deferred.promise);
@@ -661,17 +661,17 @@ var Scratchpad = {
         }
 
         stack = stack ? "\n" + stack.replace(/\n$/, "") : "";
 
         if (typeof error.message == "string") {
           deferred.resolve(error.message + stack);
         }
         else {
-          gripClient.getDisplayString(aResult => {
+          objectClient.getDisplayString(aResult => {
             if (aResult.error) {
               deferred.reject(aResult);
             }
             else if (aResult.displayString.type == "null") {
               deferred.resolve(stack);
             }
             else {
               deferred.resolve(aResult.displayString + stack);
@@ -1762,18 +1762,18 @@ ScratchpadSidebar.prototype = {
 
         this.variablesView = new VariablesView(container, {
           searchEnabled: true,
           searchPlaceholder: this._scratchpad.strings
                              .GetStringFromName("propertiesFilterPlaceholder")
         });
 
         VariablesViewController.attach(this.variablesView, {
-          getGripClient: aGrip => {
-            return new GripClient(this._scratchpad.debuggerClient, aGrip);
+          getObjectClient: aGrip => {
+            return new ObjectClient(this._scratchpad.debuggerClient, aGrip);
           },
           getLongStringClient: aActor => {
             return this._scratchpad.webConsoleClient.longString(aActor);
           },
           releaseActor: aActor => {
             this._scratchpad.debuggerClient.release(aActor);
           }
         });
--- a/browser/devtools/shared/widgets/VariablesViewController.jsm
+++ b/browser/devtools/shared/widgets/VariablesViewController.jsm
@@ -37,27 +37,27 @@ this.EXPORTED_SYMBOLS = ["VariablesViewC
  * Controller for a VariablesView that handles interfacing with the debugger
  * protocol. Is able to populate scopes and variables via the protocol as well
  * as manage actor lifespans.
  *
  * @param VariablesView aView
  *        The view to attach to.
  * @param object aOptions
  *        Options for configuring the controller. Supported options:
- *        - getGripClient: callback for creating an object grip client
+ *        - getObjectClient: callback for creating an object grip client
  *        - getLongStringClient: callback for creating a long string grip client
  *        - releaseActor: callback for releasing an actor when it's no longer needed
  *        - overrideValueEvalMacro: callback for creating an overriding eval macro
  *        - getterOrSetterEvalMacro: callback for creating a getter/setter eval macro
  *        - simpleValueEvalMacro: callback for creating a simple value eval macro
  */
 function VariablesViewController(aView, aOptions) {
   this.addExpander = this.addExpander.bind(this);
 
-  this._getGripClient = aOptions.getGripClient;
+  this._getObjectClient = aOptions.getObjectClient;
   this._getLongStringClient = aOptions.getLongStringClient;
   this._releaseActor = aOptions.releaseActor;
 
   if (aOptions.overrideValueEvalMacro) {
     this._overrideValueEvalMacro = aOptions.overrideValueEvalMacro;
   }
   if (aOptions.getterOrSetterEvalMacro) {
     this._getterOrSetterEvalMacro = aOptions.getterOrSetterEvalMacro;
@@ -127,17 +127,17 @@ VariablesViewController.prototype = {
    * @param Scope aTarget
    *        The Scope where the properties will be placed into.
    * @param object aGrip
    *        The grip to use to populate the target.
    */
   _populateFromObject: function(aTarget, aGrip) {
     let deferred = promise.defer();
 
-    this._getGripClient(aGrip).getPrototypeAndProperties(aResponse => {
+    this._getObjectClient(aGrip).getPrototypeAndProperties(aResponse => {
       let { ownProperties, prototype } = aResponse;
       // safeGetterValues is new and isn't necessary defined on old actors
       let safeGetterValues = aResponse.safeGetterValues || {};
       let sortable = VariablesView.isSortable(aGrip.class);
 
       // Merge the safe getter values into one object such that we can use it
       // in VariablesView.
       for (let name of Object.keys(safeGetterValues)) {
--- a/browser/devtools/webconsole/webconsole.js
+++ b/browser/devtools/webconsole/webconsole.js
@@ -21,17 +21,17 @@ loader.lazyGetter(this, "AutocompletePop
 loader.lazyGetter(this, "ToolSidebar",
                   () => require("devtools/framework/sidebar").ToolSidebar);
 loader.lazyGetter(this, "NetworkPanel",
                   () => require("devtools/webconsole/network-panel").NetworkPanel);
 loader.lazyGetter(this, "ConsoleOutput",
                   () => require("devtools/webconsole/console-output").ConsoleOutput);
 loader.lazyGetter(this, "Messages",
                   () => require("devtools/webconsole/console-output").Messages);
-loader.lazyImporter(this, "GripClient", "resource://gre/modules/devtools/dbg-client.jsm");
+loader.lazyImporter(this, "ObjectClient", "resource://gre/modules/devtools/dbg-client.jsm");
 loader.lazyImporter(this, "VariablesView", "resource:///modules/devtools/VariablesView.jsm");
 loader.lazyImporter(this, "VariablesViewController", "resource:///modules/devtools/VariablesViewController.jsm");
 
 const STRINGS_URI = "chrome://browser/locale/devtools/webconsole.properties";
 let l10n = new WebConsoleUtils.l10n(STRINGS_URI);
 
 
 // The XUL namespace.
@@ -3417,18 +3417,18 @@ JSTerm.prototype = {
     let view = new VariablesView(aOptions.container);
     view.searchPlaceholder = l10n.getStr("propertiesFilterPlaceholder");
     view.emptyText = l10n.getStr("emptyPropertiesList");
     view.searchEnabled = !aOptions.hideFilterInput;
     view.lazyEmpty = this._lazyVariablesView;
     view.lazyAppend = this._lazyVariablesView;
 
     VariablesViewController.attach(view, {
-      getGripClient: aGrip => {
-        return new GripClient(this.hud.proxy.client, aGrip);
+      getObjectClient: aGrip => {
+        return new ObjectClient(this.hud.proxy.client, aGrip);
       },
       getLongStringClient: aGrip => {
         return this.webConsoleClient.longString(aGrip);
       },
       releaseActor: aActor => {
         this.hud._releaseObject(aActor);
       },
       simpleValueEvalMacro: simpleValueEvalMacro,
--- a/toolkit/devtools/client/dbg-client.jsm
+++ b/toolkit/devtools/client/dbg-client.jsm
@@ -10,17 +10,17 @@ const Cc = Components.classes;
 const Cu = Components.utils;
 const Cr = Components.results;
 
 this.EXPORTED_SYMBOLS = ["DebuggerTransport",
                          "DebuggerClient",
                          "RootClient",
                          "debuggerSocketConnect",
                          "LongStringClient",
-                         "GripClient"];
+                         "ObjectClient"];
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/NetUtil.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/Timer.jsm");
 let promise = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js").Promise;
 const { defer, resolve, reject } = promise;
 
@@ -1513,27 +1513,27 @@ ThreadClient.prototype = {
   _clearFrames: function TC_clearFrames() {
     if (this._frameCache.length > 0) {
       this._frameCache = [];
       this.notify("framescleared");
     }
   },
 
   /**
-   * Return a GripClient object for the given object grip.
+   * Return a ObjectClient object for the given object grip.
    *
    * @param aGrip object
    *        A pause-lifetime object grip returned by the protocol.
    */
   pauseGrip: function TC_pauseGrip(aGrip) {
     if (aGrip.actor in this._pauseGrips) {
       return this._pauseGrips[aGrip.actor];
     }
 
-    let client = new GripClient(this._client, aGrip);
+    let client = new ObjectClient(this._client, aGrip);
     this._pauseGrips[aGrip.actor] = client;
     return client;
   },
 
   /**
    * Get or create a long string client, checking the grip client cache if it
    * already exists.
    *
@@ -1576,37 +1576,37 @@ ThreadClient.prototype = {
   },
 
   /**
    * Clear and invalidate all the grip clients from the given cache.
    *
    * @param aGripCacheName
    *        The property name of the grip cache we want to clear.
    */
-  _clearGripClients: function TC_clearGrips(aGripCacheName) {
+  _clearObjectClients: function TC_clearGrips(aGripCacheName) {
     for each (let grip in this[aGripCacheName]) {
       grip.valid = false;
     }
     this[aGripCacheName] = {};
   },
 
   /**
    * Invalidate pause-lifetime grip clients and clear the list of current grip
    * clients.
    */
   _clearPauseGrips: function TC_clearPauseGrips() {
-    this._clearGripClients("_pauseGrips");
+    this._clearObjectClients("_pauseGrips");
   },
 
   /**
    * Invalidate thread-lifetime grip clients and clear the list of current grip
    * clients.
    */
   _clearThreadGrips: function TC_clearPauseGrips() {
-    this._clearGripClients("_threadGrips");
+    this._clearObjectClients("_threadGrips");
   },
 
   /**
    * Handle thread state change by doing necessary cleanup and notifying all
    * registered listeners.
    */
   _onThreadState: function TC_onThreadState(aPacket) {
     this._state = ThreadStateTypes[aPacket.type];
@@ -1753,24 +1753,24 @@ eventSource(TraceClient.prototype);
 /**
  * Grip clients are used to retrieve information about the relevant object.
  *
  * @param aClient DebuggerClient
  *        The debugger client parent.
  * @param aGrip object
  *        A pause-lifetime object grip returned by the protocol.
  */
-function GripClient(aClient, aGrip)
+function ObjectClient(aClient, aGrip)
 {
   this._grip = aGrip;
   this._client = aClient;
   this.request = this._client.request;
 }
 
-GripClient.prototype = {
+ObjectClient.prototype = {
   get actor() { return this._grip.actor },
   get _transport() { return this._client._transport; },
 
   valid: true,
 
   get isFrozen() this._grip.frozen,
   get isSealed() this._grip.sealed,
   get isExtensible() this._grip.extensible,
--- a/toolkit/devtools/webconsole/test/test_bug819670_getter_throws.html
+++ b/toolkit/devtools/webconsole/test/test_bug819670_getter_throws.html
@@ -36,17 +36,17 @@ function onEvaluate(aState, aResponse)
       actor: /[a-z]/,
     },
   });
 
   ok(!aResponse.exception, "no eval exception");
   ok(!aResponse.helperResult, "no helper result");
 
   onInspect = onInspect.bind(null, aState);
-  let client = new GripClient(aState.dbgClient, aResponse.result);
+  let client = new ObjectClient(aState.dbgClient, aResponse.result);
   client.getPrototypeAndProperties(onInspect);
 }
 
 function onInspect(aState, aResponse)
 {
   ok(!aResponse.error, "no response error");
 
   let expectedProps = {
--- a/toolkit/devtools/webconsole/test/test_object_actor.html
+++ b/toolkit/devtools/webconsole/test/test_object_actor.html
@@ -149,17 +149,17 @@ function onConsoleCall(aState, aType, aP
   });
 
   aState.dbgClient.removeListener("consoleAPICall", onConsoleCall);
 
   info("inspecting object properties");
   let args = aPacket.message.arguments;
   onProperties = onProperties.bind(null, aState);
 
-  let client = new GripClient(aState.dbgClient, args[1]);
+  let client = new ObjectClient(aState.dbgClient, args[1]);
   client.getPrototypeAndProperties(onProperties);
 }
 
 function onProperties(aState, aResponse)
 {
   let props = aResponse.ownProperties;
   is(Object.keys(props).length, Object.keys(expectedProps).length,
      "number of enumerable properties");
--- a/toolkit/devtools/webconsole/test/test_object_actor_native_getters.html
+++ b/toolkit/devtools/webconsole/test/test_object_actor_native_getters.html
@@ -70,17 +70,17 @@ function onConsoleCall(aState, aType, aP
   });
 
   aState.dbgClient.removeListener("consoleAPICall", onConsoleCall);
 
   info("inspecting object properties");
   let args = aPacket.message.arguments;
   onProperties = onProperties.bind(null, aState);
 
-  let client = new GripClient(aState.dbgClient, args[1]);
+  let client = new ObjectClient(aState.dbgClient, args[1]);
   client.getPrototypeAndProperties(onProperties);
 }
 
 function onProperties(aState, aResponse)
 {
   let props = aResponse.ownProperties;
   let keys = Object.keys(props);
   info(keys.length + " ownProperties: " + keys);
--- a/toolkit/devtools/webconsole/test/test_object_actor_native_getters_lenient_this.html
+++ b/toolkit/devtools/webconsole/test/test_object_actor_native_getters_lenient_this.html
@@ -49,17 +49,17 @@ function onConsoleCall(aState, aType, aP
   });
 
   aState.dbgClient.removeListener("consoleAPICall", onConsoleCall);
 
   info("inspecting object properties");
   let args = aPacket.message.arguments;
   onProperties = onProperties.bind(null, aState);
 
-  let client = new GripClient(aState.dbgClient, args[1]);
+  let client = new ObjectClient(aState.dbgClient, args[1]);
   client.getPrototypeAndProperties(onProperties);
 }
 
 function onProperties(aState, aResponse)
 {
   let props = aResponse.ownProperties;
   let keys = Object.keys(props);
   info(keys.length + " ownProperties: " + keys);