Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/CookieParser.js

Issue 2823103002: [Devtools] Fixed cookie size from being off by 1 byte (Closed)
Patch Set: [Devtools] Fixed cookie size from being off by 1 byte Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/network/network-cookies-pane-expected.txt ('k') | 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 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 this._flushCookie(); 101 this._flushCookie();
102 return this._cookies; 102 return this._cookies;
103 } 103 }
104 104
105 /** 105 /**
106 * @param {string|undefined} headerValue 106 * @param {string|undefined} headerValue
107 * @return {boolean} 107 * @return {boolean}
108 */ 108 */
109 _initialize(headerValue) { 109 _initialize(headerValue) {
110 this._input = headerValue; 110 this._input = headerValue;
111 // We add a \n because the actual header will not exist without a \n at the end. The parser will add
112 // \n between each header, but will not add one at the end (because cookies are a special case header).
113 if (this._input)
114 this._input += '\n';
111 if (typeof headerValue !== 'string') 115 if (typeof headerValue !== 'string')
112 return false; 116 return false;
113 this._cookies = []; 117 this._cookies = [];
114 this._lastCookie = null; 118 this._lastCookie = null;
115 this._originalInputLength = this._input.length; 119 this._originalInputLength = this._input.length;
116 return true; 120 return true;
117 } 121 }
118 122
119 _flushCookie() { 123 _flushCookie() {
120 if (this._lastCookie) 124 if (this._lastCookie)
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 } 351 }
348 }; 352 };
349 353
350 /** 354 /**
351 * @enum {number} 355 * @enum {number}
352 */ 356 */
353 SDK.Cookie.Type = { 357 SDK.Cookie.Type = {
354 Request: 0, 358 Request: 0,
355 Response: 1 359 Response: 1
356 }; 360 };
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/network/network-cookies-pane-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698