Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: assets/js/XMLHttpRequest.jsm

Issue 8771172: adblockplusandroid: Initialise members on the instance, not the prototype (Closed)
Patch Set: Created Nov. 14, 2012, 11:10 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 XMLHttpRequest = function() 2 XMLHttpRequest = function()
3 { 3 {
4 this.headers = {}; 4 this.headers = {};
5 this.responseHeaders = {}; 5 this.responseHeaders = {};
6 this.progressEventListeners = [];
7 this.loadendEventListeners = [];
8 this.loadEventListeners = [];
9 this.errorEventListeners = [];
10 this.abortEventListeners = [];
11 this.aborted = false;
12 this.async = true;
13 this.readyState = XMLHttpRequest.UNSENT;
14 this.responseText = "";
15 this.status = 0;
6 }; 16 };
7 17
8 XMLHttpRequest.UNSENT = 0; 18 XMLHttpRequest.UNSENT = 0;
9 XMLHttpRequest.OPEN = 1; 19 XMLHttpRequest.OPEN = 1;
10 XMLHttpRequest.HEADERS_RECEIVED = 2; 20 XMLHttpRequest.HEADERS_RECEIVED = 2;
11 XMLHttpRequest.LOADING = 3; 21 XMLHttpRequest.LOADING = 3;
12 XMLHttpRequest.DONE = 4; 22 XMLHttpRequest.DONE = 4;
13 23
14 XMLHttpRequest.prototype = 24 XMLHttpRequest.prototype =
15 { 25 {
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 else if (type == "error") 146 else if (type == "error")
137 listeners = this.errorEventListeners; 147 listeners = this.errorEventListeners;
138 else if (type == "abort") 148 else if (type == "abort")
139 listeners = this.abortEventListeners; 149 listeners = this.abortEventListeners;
140 150
141 for (var i = 0; i < listeners.length; i++) 151 for (var i = 0; i < listeners.length; i++)
142 { 152 {
143 var listener = listeners[i]; 153 var listener = listeners[i];
144 listener(); 154 listener();
145 } 155 }
146 }, 156 }»
147 progressEventListeners: [],
148 loadendEventListeners: [],
149 loadEventListeners: [],
150 errorEventListeners: [],
151 abortEventListeners: [],
152 aborted: false,
153 async: true,
154 readyState: XMLHttpRequest.UNSENT,
155 responseText: "",
156 status: 0
157 }; 157 };
158 158
159 XMLHttpRequest.prototype.channel = 159 XMLHttpRequest.prototype.channel =
160 { 160 {
161 status: -1, 161 status: -1,
162 notificationCallbacks: {}, 162 notificationCallbacks: {},
163 loadFlags: 0, 163 loadFlags: 0,
164 INHIBIT_CACHING: 0, 164 INHIBIT_CACHING: 0,
165 VALIDATE_ALWAYS: 0, 165 VALIDATE_ALWAYS: 0,
166 QueryInterface: function() 166 QueryInterface: function()
167 { 167 {
168 return this; 168 return this;
169 } 169 }
170 }; 170 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld