Changeset 70137 in webkit
- Timestamp:
- Oct 20, 2010 2:14:09 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r70132 r70137 1 2010-10-19 Andrey Kosyakov <caseq@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: expose request/response cookies in HAR 6 https://bugs.webkit.org/show_bug.cgi?id=47894 7 8 * http/tests/inspector/inspector-test.js: 9 (dumpObject): Handle null objects as a special case (display null instead of empty object) 10 * http/tests/inspector/inspector-test2.js: 11 (initialize_InspectorTest.InspectorTest.addObject): Ditto. 12 * http/tests/inspector/resource-har-conversion-expected.txt: 13 * http/tests/inspector/resource-har-conversion.html: 14 * inspector/cookie-parser-expected.txt: Added. 15 * inspector/cookie-parser.html: Added. 16 1 17 2010-10-20 Shinichiro Hamaji <hamaji@chromium.org> 2 18 -
trunk/LayoutTests/http/tests/inspector/inspector-test.js
r65053 r70137 54 54 if (nondeterministicProps && prop in nondeterministicProps) 55 55 output(prefixWithName + "<" + typeof propValue + ">"); 56 else if (propValue === null) 57 output(prefixWithName + "null"); 56 58 else if (typeof propValue === "object") 57 59 dumpObject(propValue, nondeterministicProps, prefix + " ", prefixWithName); -
trunk/LayoutTests/http/tests/inspector/inspector-test2.js
r67721 r70137 62 62 if (nondeterministicProps && prop in nondeterministicProps) 63 63 InspectorTest.addResult(prefixWithName + "<" + typeof propValue + ">"); 64 else if (propValue === null) 65 InspectorTest.addResult(prefixWithName + "null"); 64 66 else if (typeof propValue === "object") 65 67 InspectorTest.addObject(propValue, nondeterministicProps, prefix + " ", prefixWithName); -
trunk/LayoutTests/http/tests/inspector/resource-har-conversion-expected.txt
r67474 r70137 13 13 headersSize : -1 14 14 bodySize : <number> 15 cookies : { 16 0 : { 17 name : "a" 18 value : "b" 19 path : "/path" 20 domain : "example.com" 21 expires : null 22 httpOnly : false 23 secure : false 24 } 25 1 : { 26 name : "a1" 27 value : "b1" 28 path : undefined 29 domain : undefined 30 expires : null 31 httpOnly : false 32 secure : false 33 } 34 2 : { 35 name : "c1" 36 value : "d1" 37 path : undefined 38 domain : undefined 39 expires : null 40 httpOnly : false 41 secure : false 42 } 43 } 15 44 } 16 45 response : { … … 25 54 headersSize : -1 26 55 bodySize : <number> 56 cookies : { 57 0 : { 58 name : "x" 59 value : "y" 60 path : "/path" 61 domain : "example.com" 62 expires : null 63 httpOnly : true 64 secure : true 65 } 66 1 : { 67 name : "x1" 68 value : "y1" 69 path : undefined 70 domain : undefined 71 expires : null 72 httpOnly : false 73 secure : false 74 } 75 2 : { 76 name : "z2" 77 value : "y2" 78 path : undefined 79 domain : undefined 80 expires : null 81 httpOnly : false 82 secure : false 83 } 84 } 27 85 } 28 86 timings : <object> -
trunk/LayoutTests/http/tests/inspector/resource-har-conversion.html
r66735 r70137 13 13 } 14 14 15 function addCookieHeadersToResource(resource) 16 { 17 resource.requestHeaders = { 18 "Cookie": "a=b; $Path=/path; $Domain=example.com; a1=b1\nc1=d1" 19 }; 20 resource.responseHeaders = { 21 "Set-Cookie": "x=y; Path=/path; Domain=example.com; Discard; httpOnly; Secure; Version=1\nx1=y1\nz2=y2" 22 }; 23 } 24 25 function findResourceByURL(url) 26 { 27 for (var resource in WebInspector.resources) { 28 if (url.test(WebInspector.resources[resource].url)) 29 return WebInspector.resources[resource]; 30 } 31 } 32 15 33 InspectorTest.enableResourceTracking(function() { 16 34 InjectedScriptAccess.getDefault().evaluate("doXHR()", "console", function() { 35 addCookieHeadersToResource(findResourceByURL(/inspector-test2\.js$/)); 17 36 var resources = Object.keys(WebInspector.resources).map(getHAR).sort(InspectorTest.resourceURLComparer); 18 37 InspectorTest.addObject(resources, InspectorTest.HARNondeterministicPropertiesWithSize); -
trunk/WebCore/ChangeLog
r70136 r70137 1 2010-10-19 Andrey Kosyakov <caseq@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: expose request/response cookies in HAR 6 https://bugs.webkit.org/show_bug.cgi?id=47894 7 8 Test: inspector/cookie-parser.html 9 10 * WebCore.gypi: 11 * WebCore.vcproj/WebCore.vcproj: 12 * inspector/front-end/CookieParser.js: Added. 13 * inspector/front-end/HAREntry.js: 14 (WebInspector.HAREntry.prototype._buildRequest): 15 (WebInspector.HAREntry.prototype._buildResponse): 16 (WebInspector.HAREntry.prototype._buildCookies): 17 (WebInspector.HAREntry.prototype._buildCookie): 18 * inspector/front-end/Resource.js: Parse Cookie/Set-Cookie headers and expose cookies. 19 (WebInspector.Resource.prototype.set requestHeaders): 20 (WebInspector.Resource.prototype.get requestCookies): 21 (WebInspector.Resource.prototype.set responseHeaders): 22 (WebInspector.Resource.prototype.get responseCookies): 23 (WebInspector.Resource.prototype._parseRequestCookies): 24 (WebInspector.Resource.prototype._parseResponseCookies): 25 * inspector/front-end/WebKit.qrc: 26 * inspector/front-end/inspector.html: 27 1 28 2010-10-20 Nikolas Zimmermann <nzimmermann@rim.com> 2 29 -
trunk/WebCore/WebCore.gypi
r70135 r70137 4359 4359 'inspector/front-end/ContextMenu.js', 4360 4360 'inspector/front-end/CookieItemsView.js', 4361 'inspector/front-end/CookieParser.js', 4361 4362 'inspector/front-end/CSSCompletions.js', 4362 4363 'inspector/front-end/CSSStyleModel.js', -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r70135 r70137 63459 63459 </File> 63460 63460 <File 63461 RelativePath="..\inspector\front-end\CookieItemsView.js" 63462 > 63463 </File> 63464 <File 63465 RelativePath="..\inspector\front-end\CookieParser.js" 63466 > 63467 </File> 63468 <File 63461 63469 RelativePath="..\inspector\front-end\CSSStyleModel.js" 63462 63470 > -
trunk/WebCore/inspector/front-end/HAREntry.js
r70046 r70137 57 57 url: this._resource.url, 58 58 // httpVersion: "HTTP/1.1" -- Not available. 59 // cookies: [] -- Not available.60 59 headers: this._buildHeaders(this._resource.requestHeaders), 61 60 headersSize: -1, // Not available. … … 66 65 if (this._resource.requestFormData) 67 66 res.postData = this._buildPostData(); 67 if (this._resource.requestCookies) 68 res.cookies = this._buildCookies(this._resource.requestCookies); 68 69 return res; 69 70 }, … … 71 72 _buildResponse: function() 72 73 { 73 return{74 var res = { 74 75 status: this._resource.statusCode, 75 76 statusText: this._resource.statusText, 76 77 // "httpVersion": "HTTP/1.1" -- Not available. 77 // "cookies": [], -- Not available.78 78 headers: this._buildHeaders(this._resource.responseHeaders), 79 79 content: this._buildContent(), … … 82 82 bodySize: this._resource.resourceSize 83 83 }; 84 if (this._resource.responseCookies) 85 res.cookies = this._buildCookies(this._resource.responseCookies); 86 return res; 84 87 }, 85 88 … … 151 154 }, 152 155 156 _buildCookies: function(cookies) 157 { 158 return cookies.map(this._buildCookie.bind(this)); 159 }, 160 161 _buildCookie: function(cookie) 162 { 163 164 return { 165 name: cookie.name, 166 value: cookie.value, 167 path: cookie.path, 168 domain: cookie.domain, 169 expires: cookie.expires(new Date(this._resource.startTime * 1000)), 170 httpOnly: cookie.httpOnly, 171 secure: cookie.secure 172 }; 173 }, 174 153 175 _interval: function(start, end) 154 176 { -
trunk/WebCore/inspector/front-end/Resource.js
r70045 r70137 351 351 this._requestHeaders = x; 352 352 delete this._sortedRequestHeaders; 353 delete this._requestCookies; 353 354 354 355 this.dispatchEventToListeners("requestHeaders changed"); … … 373 374 }, 374 375 376 get requestCookies() 377 { 378 if (!this._requestCookies) 379 this._requestCookies = WebInspector.CookieParser.parseCookie(this.requestHeaderValue("Cookie")); 380 return this._requestCookies; 381 }, 382 375 383 get requestFormData() 376 384 { … … 393 401 this._responseHeaders = x; 394 402 delete this._sortedResponseHeaders; 403 delete this._responseCookies; 395 404 396 405 this.dispatchEventToListeners("responseHeaders changed"); … … 413 422 { 414 423 return this._headerValue(this.responseHeaders, headerName); 424 }, 425 426 get responseCookies() 427 { 428 if (!this._responseCookies) 429 this._responseCookies = WebInspector.CookieParser.parseSetCookie(this.responseHeaderValue("Set-Cookie")); 430 return this._responseCookies; 415 431 }, 416 432 -
trunk/WebCore/inspector/front-end/WebKit.qrc
r69948 r70137 21 21 <file>ContextMenu.js</file> 22 22 <file>CookieItemsView.js</file> 23 <file>CookieParser.js</file> 23 24 <file>CSSCompletions.js</file> 24 25 <file>CSSStyleModel.js</file> -
trunk/WebCore/inspector/front-end/inspector.html
r69948 r70137 145 145 <script type="text/javascript" src="ShortcutsHelp.js"></script> 146 146 <script type="text/javascript" src="HAREntry.js"></script> 147 <script type="text/javascript" src="CookieParser.js"></script> 147 148 </head> 148 149 <body class="detached"> -
trunk/WebKit/chromium/ChangeLog
r70081 r70137 1 2010-10-19 Andrey Kosyakov <caseq@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: expose request/response cookies in HAR 6 https://bugs.webkit.org/show_bug.cgi?id=47894 7 8 * src/WebResourceRawHeaders.cpp: 9 (WebKit::addHeader): paste coalescent headers using "\n: as a separator instead of ", " 10 1 11 2010-10-19 Tony Chang <tony@chromium.org> 2 12 -
trunk/WebKit/chromium/src/WebResourceRawHeaders.cpp
r69295 r70137 70 70 pair<HTTPHeaderMap::iterator, bool> result = map->add(name, value); 71 71 if (!result.second) 72 result.first->second += String(" ,") + value;72 result.first->second += String("\n") + value; 73 73 } 74 74
Note: See TracChangeset
for help on using the changeset viewer.