| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NET_HTTP_HTTP_RESPONSE_HEADERS_H_ | 5 #ifndef NET_HTTP_HTTP_RESPONSE_HEADERS_H_ |
| 6 #define NET_HTTP_HTTP_RESPONSE_HEADERS_H_ | 6 #define NET_HTTP_HTTP_RESPONSE_HEADERS_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <string> | 11 #include <string> |
| 12 #include <unordered_set> |
| 12 #include <vector> | 13 #include <vector> |
| 13 | 14 |
| 14 #include "base/containers/hash_tables.h" | |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 17 #include "base/strings/string_piece.h" | 17 #include "base/strings/string_piece.h" |
| 18 #include "net/base/net_export.h" | 18 #include "net/base/net_export.h" |
| 19 #include "net/http/http_version.h" | 19 #include "net/http/http_version.h" |
| 20 #include "net/log/net_log.h" | 20 #include "net/log/net_log.h" |
| 21 | 21 |
| 22 namespace base { | 22 namespace base { |
| 23 class Pickle; | 23 class Pickle; |
| 24 class PickleIterator; | 24 class PickleIterator; |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 // to exist but could not be parsed. Otherwise, it defaults to 200 if the | 317 // to exist but could not be parsed. Otherwise, it defaults to 200 if the |
| 318 // response code is not found in the raw headers. | 318 // response code is not found in the raw headers. |
| 319 int response_code() const { return response_code_; } | 319 int response_code() const { return response_code_; } |
| 320 | 320 |
| 321 // Returns the raw header string. | 321 // Returns the raw header string. |
| 322 const std::string& raw_headers() const { return raw_headers_; } | 322 const std::string& raw_headers() const { return raw_headers_; } |
| 323 | 323 |
| 324 private: | 324 private: |
| 325 friend class base::RefCountedThreadSafe<HttpResponseHeaders>; | 325 friend class base::RefCountedThreadSafe<HttpResponseHeaders>; |
| 326 | 326 |
| 327 typedef base::hash_set<std::string> HeaderSet; | 327 using HeaderSet = std::unordered_set<std::string>; |
| 328 | 328 |
| 329 // The members of this structure point into raw_headers_. | 329 // The members of this structure point into raw_headers_. |
| 330 struct ParsedHeader; | 330 struct ParsedHeader; |
| 331 typedef std::vector<ParsedHeader> HeaderList; | 331 typedef std::vector<ParsedHeader> HeaderList; |
| 332 | 332 |
| 333 HttpResponseHeaders(); | 333 HttpResponseHeaders(); |
| 334 ~HttpResponseHeaders(); | 334 ~HttpResponseHeaders(); |
| 335 | 335 |
| 336 // Initializes from the given raw headers. | 336 // Initializes from the given raw headers. |
| 337 void Parse(const std::string& raw_input); | 337 void Parse(const std::string& raw_input); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 | 422 |
| 423 // The normalized http version (consistent with what GetStatusLine() returns). | 423 // The normalized http version (consistent with what GetStatusLine() returns). |
| 424 HttpVersion http_version_; | 424 HttpVersion http_version_; |
| 425 | 425 |
| 426 DISALLOW_COPY_AND_ASSIGN(HttpResponseHeaders); | 426 DISALLOW_COPY_AND_ASSIGN(HttpResponseHeaders); |
| 427 }; | 427 }; |
| 428 | 428 |
| 429 } // namespace net | 429 } // namespace net |
| 430 | 430 |
| 431 #endif // NET_HTTP_HTTP_RESPONSE_HEADERS_H_ | 431 #endif // NET_HTTP_HTTP_RESPONSE_HEADERS_H_ |
| OLD | NEW |