google/closure-library — pull request #304 by gingerik (2014-07-03 07:43:51+00:00)
Title: Set XhrIoPool's superClass as final call

**What steps will reproduce the problem?**
Create a goog.net.XhrManager object with some default header(s) and a `minCount > 0`:
> var headers = new goog.structs.Map();
> headers.set('X-Custom-Header', 'This text should reach the server');
> var minCount = 1;
> var xhrManager = new goog.net.XhrManager(0, headers, minCount);

Send a request to the server
> xhrManager.send('req','server.php');

**What is the expected output? What do you see instead?**
The expected HTTP request message is (I removed any additional headers
that are not influenced by the sample code):
> GET /server.php HTTP/1.1
> X-Custom-Header: This text should reach the server

However, the transmitted message is:
> GET /server.php HTTP/1.1

**Cause**
This error is caused by the `goog.net.XhrIoPool` calling its superClass `goog.structs.PriorityPool` constructor, before storing the default headers. The constructor will immediately create `minCount` objects, lacking the default headers. (See also the comments on line 51 - 54 in `closure/goog/structs/prioritypool.js`.)