Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Bug 787972 removing out of date documentation for old globals module #551

Merged
merged 1 commit into from over 1 year ago

2 participants

Erik Vold wbamberg
Erik Vold
Collaborator

No description provided.

Erik Vold erikvold merged commit d62017d into from October 05, 2012
Erik Vold erikvold closed this October 05, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 0 additions and 100 deletions. Show diff stats Hide diff stats

  1. 100  packages/api-utils/docs/globals.md
100  packages/api-utils/docs/globals.md
Source Rendered
... ...
@@ -1,100 +0,0 @@
1  
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
2  
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
3  
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
4  
-
5  
-Globals in this section are subject to change in the future and/or are likely
6  
-to be of interest to SDK module developers, rather than add-on developers.
7  
-
8  
-## Components ##
9  
-
10  
-To access the infamous and powerful `Components` object, see the
11  
-[Chrome Authority](dev-guide/tutorials/chrome.html) documentation.
12  
-
13  
-## \_\_url\_\_ ##
14  
-
15  
-The `__url__` global is a string identifying the URL from which the code has
16  
-been retrieved.  If the code has no identifiable URL, this value may be `null`.
17  
-
18  
-## packaging ##
19  
-
20  
-<span class="aside">
21  
-For more information on packaging, see the [Package Specification][] appendix.
22  
-</span>
23  
-
24  
-The `packaging` global contains methods and metadata related to
25  
-the packages available in the current environment.
26  
-
27  
-<code>packaging.**getURLForData**(*path*)</code>
28  
-
29  
-Given a unix-style path relative to the calling package's `data`
30  
-directory, returns an absolute URL to the file or directory.
31  
-
32  
-By "calling package", we mean the package in which the caller's source
33  
-code resides.
34  
-
35  
-Thus, for example, if a package contains a resource at
36  
-`data/mydata.dat` and a module at `lib/foo.js`, the module at
37  
-`lib/foo.js` may make the following call to retrieve an absolute URL
38  
-to `data/mydata.dat`:
39  
-
40  
-    var myDataURL = packaging.getURLForData("/mydata.dat");
41  
-
42  
-If the calling package has no `data` directory, an exception is
43  
-thrown.
44  
-
45  
-## memory ##
46  
-
47  
-`memory` is an object that exposes functionality to track
48  
-objects of interest and help diagnose and prevent memory leaks.
49  
-
50  
-<code>memory.**track**(*object*, [*bin*])</code>
51  
-
52  
-Marks *object* for being tracked, and categorizes it with the given
53  
-bin name. If *bin* isn't specified, the memory tracker attempts to
54  
-infer a bin name by first checking the object's
55  
-`constructor.name`; if that fails or results in the generic
56  
-`Object`, the stack is inspected and the name of the current
57  
-function being executed&mdash;which is assumed to be a constructor
58  
-function&mdash;is used. If that fails, then the object is placed in a
59  
-bin named `generic`.
60  
-
61  
-<code>memory.**getObjects**([*bin*])</code>
62  
-
63  
-Returns an `Array` containing information about tracked objects
64  
-that have been categorized with the given bin name. If *bin* isn't
65  
-provided, information about all live tracked objects are returned.
66  
-
67  
-Each element of the array is an object with the following keys:
68  
-
69  
-<table>
70  
-  <tr>
71  
-    <td><code>weakref</code></td>
72  
-    <td>A weak reference to the object being tracked. Call
73  
-    <code>get()</code> on this object to retrieve its strong reference; if
74  
-    a strong reference to the object no longer exists, <code>get()</code>
75  
-    will return <code>null</code>.</td>
76  
-  </tr>
77  
-  <tr>
78  
-    <td><code>created</code></td>
79  
-    <td>A <code>Date</code> representing the date and time that
80  
-    <code>memory.track()</code> was called on the object being
81  
-    tracked.</td>
82  
-  </tr>
83  
-  <tr>
84  
-    <td><code>filename</code></td>
85  
-    <td>The name of the file that called <code>memory.track()</code> on
86  
-    the object being tracked.</td>
87  
-  </tr>
88  
-  <tr>
89  
-    <td><code>lineNo</code></td>
90  
-    <td>The line number of the file that called
91  
-    <code>memory.track()</code> on the object being tracked.</td>
92  
-  </tr>
93  
-</table>
94  
-
95  
-<code>memory.**getBins**()</code>
96  
-
97  
-Returns an `Array` containing the names of all bins that aren't
98  
-currently empty.
99  
-
100  
-  [Package Specification]: dev-guide/package-spec.html
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.