Title: [161216] trunk/Tools
- Revision
- 161216
- Author
- [email protected]
- Date
- 2014-01-02 12:06:32 -0800 (Thu, 02 Jan 2014)
Log Message
Accessing Trac from build.webkit.org/dashboard should enable XMLHttpRequest.withCredentials
https://bugs.webkit.org/show_bug.cgi?id=126391
Reviewed by Dan Bernstein.
Make it conditional, as trac.webkit.org doesn't work when withCredentials is enabled.
One can request credentials use via Initialization.js.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Trac.js:
(Trac):
(Trac.prototype.update):
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Utilities.js:
(loadXML):
Modified Paths
Diff
Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Trac.js (161215 => 161216)
--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Trac.js 2014-01-02 20:03:36 UTC (rev 161215)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Trac.js 2014-01-02 20:06:32 UTC (rev 161216)
@@ -23,13 +23,15 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-Trac = function(baseURL)
+Trac = function(baseURL, options)
{
BaseObject.call(this);
console.assert(baseURL);
this.baseURL = baseURL;
+ this._needsAuthentication = (typeof options === "object") && options[Trac.NeedsAuthentication] === true;
+
this.recordedCommits = []; // Will be sorted in ascending order.
this.update();
@@ -38,6 +40,7 @@
BaseObject.addConstructorFunctions(Trac);
+Trac.NeedsAuthentication = "needsAuthentication";
Trac.UpdateInterval = 45000; // 45 seconds
Trac.Event = {
@@ -130,6 +133,6 @@
this.recordedCommits = this.recordedCommits.concat(newCommits.reverse());
this.dispatchEventToListeners(Trac.Event.NewCommitsRecorded, {newCommits: newCommits});
- }.bind(this));
+ }.bind(this), this._needsAuthentication ? { withCredentials: true } : {});
}
};
Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Utilities.js (161215 => 161216)
--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Utilities.js 2014-01-02 20:03:36 UTC (rev 161215)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Utilities.js 2014-01-02 20:06:32 UTC (rev 161216)
@@ -50,7 +50,7 @@
request.send();
};
-function loadXML(url, callback) {
+function loadXML(url, callback, options) {
console.assert(url);
if (!(callback instanceof Function))
@@ -67,9 +67,8 @@
};
request.open("GET", url);
- // FIXME: It's not nice that one of the loading helpers here enables credentials, and
- // others don't. Credentials are needed for some trac installations.
- request.withCredentials = true;
+ if ((typeof options === "object") && options.hasOwnProperty("withCredentials"))
+ request.withCredentials = options.withCredentials;
request.send();
};
Modified: trunk/Tools/ChangeLog (161215 => 161216)
--- trunk/Tools/ChangeLog 2014-01-02 20:03:36 UTC (rev 161215)
+++ trunk/Tools/ChangeLog 2014-01-02 20:06:32 UTC (rev 161216)
@@ -1,3 +1,19 @@
+2014-01-02 Alexey Proskuryakov <[email protected]>
+
+ Accessing Trac from build.webkit.org/dashboard should enable XMLHttpRequest.withCredentials
+ https://bugs.webkit.org/show_bug.cgi?id=126391
+
+ Reviewed by Dan Bernstein.
+
+ Make it conditional, as trac.webkit.org doesn't work when withCredentials is enabled.
+ One can request credentials use via Initialization.js.
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Trac.js:
+ (Trac):
+ (Trac.prototype.update):
+ * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Utilities.js:
+ (loadXML):
+
2014-01-02 Commit Queue <[email protected]>
Unreviewed, rolling out r160846.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes