OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * Copyright (C) 2011 Apple Inc. All Rights Reserved. | 3 * Copyright (C) 2011 Apple Inc. All Rights Reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 String requestMethod() const { return m_requestMethod; } | 52 String requestMethod() const { return m_requestMethod; } |
53 void setRequestMethod(const String& method) { m_requestMethod = method; } | 53 void setRequestMethod(const String& method) { m_requestMethod = method; } |
54 | 54 |
55 KURL url() const { return m_url; } | 55 KURL url() const { return m_url; } |
56 void setURL(const KURL& url) { m_url = url; } | 56 void setURL(const KURL& url) { m_url = url; } |
57 | 57 |
58 const Vector<unsigned char>& body() const { return m_body; } | 58 const Vector<unsigned char>& body() const { return m_body; } |
59 | 59 |
60 const HTTPHeaderMap& headerFields() const { return m_headerFields; } | 60 const HTTPHeaderMap& headerFields() const { return m_headerFields; } |
61 void addHeaderField(const AtomicString& name, const String& value) { m_heade
rFields.add(name, value); } | 61 void addHeaderField(const AtomicString& name, const AtomicString& value) { m
_headerFields.add(name, value); } |
62 void addHeaderField(const char* name, const String& value) { m_headerFields.
add(name, value); } | 62 void addHeaderField(const char* name, const AtomicString& value) { m_headerF
ields.add(name, value); } |
63 | 63 |
64 protected: | 64 protected: |
65 HTTPRequest(); | 65 HTTPRequest(); |
66 HTTPRequest(const String& requestMethod, const KURL&, HTTPVersion); | 66 HTTPRequest(const String& requestMethod, const KURL&, HTTPVersion); |
67 | 67 |
68 // Parsing helpers. | 68 // Parsing helpers. |
69 size_t parseRequestLine(const char* data, size_t length, String& failureReas
on); | 69 size_t parseRequestLine(const char* data, size_t length, String& failureReas
on); |
70 size_t parseHeaders(const char* data, size_t length, String& failureReason); | 70 size_t parseHeaders(const char* data, size_t length, String& failureReason); |
71 size_t parseRequestBody(const char* data, size_t length); | 71 size_t parseRequestBody(const char* data, size_t length); |
72 | 72 |
73 KURL m_url; | 73 KURL m_url; |
74 HTTPVersion m_httpVersion; | 74 HTTPVersion m_httpVersion; |
75 String m_requestMethod; | 75 String m_requestMethod; |
76 HTTPHeaderMap m_headerFields; | 76 HTTPHeaderMap m_headerFields; |
77 Vector<unsigned char> m_body; | 77 Vector<unsigned char> m_body; |
78 }; | 78 }; |
79 | 79 |
80 } // namespace WebCore | 80 } // namespace WebCore |
81 | 81 |
82 #endif // HTTPRequest_h | 82 #endif // HTTPRequest_h |
OLD | NEW |