| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 }; |
| OLD | NEW |