OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 // A delegate class of WebURLLoaderImpl that handles multipart/x-mixed-replace | 5 // A delegate class of WebURLLoaderImpl that handles multipart/x-mixed-replace |
6 // data. We special case multipart/x-mixed-replace because WebCore expects a | 6 // data. We special case multipart/x-mixed-replace because WebCore expects a |
7 // separate didReceiveResponse for each new message part. | 7 // separate didReceiveResponse for each new message part. |
8 // | 8 // |
9 // Most of the logic and edge case handling are based on the Mozilla's | 9 // Most of the logic and edge case handling are based on the Mozilla's |
10 // implementation in netwerk/streamconv/converters/nsMultiMixedConv.cpp. | 10 // implementation in netwerk/streamconv/converters/nsMultiMixedConv.cpp. |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // Returns the multi part boundary string from the Content-type header | 84 // Returns the multi part boundary string from the Content-type header |
85 // in the response. | 85 // in the response. |
86 // Returns true on success. | 86 // Returns true on success. |
87 static bool ReadMultipartBoundary(const WebKit::WebURLResponse& response, | 87 static bool ReadMultipartBoundary(const WebKit::WebURLResponse& response, |
88 std::string* multipart_boundary); | 88 std::string* multipart_boundary); |
89 | 89 |
90 // Returns the lower and higher content ranges from an individual multipart | 90 // Returns the lower and higher content ranges from an individual multipart |
91 // in a multipart response. | 91 // in a multipart response. |
92 // Returns true on success. | 92 // Returns true on success. |
93 static bool ReadContentRanges(const WebKit::WebURLResponse& response, | 93 static bool ReadContentRanges(const WebKit::WebURLResponse& response, |
94 int* content_range_lower_bound, | 94 int64* content_range_lower_bound, |
95 int* content_range_upper_bound, | 95 int64* content_range_upper_bound, |
96 int* content_range_instance_size); | 96 int64* content_range_instance_size); |
97 | 97 |
98 private: | 98 private: |
99 friend class MultipartResponseDelegateTester; // For unittests. | 99 friend class MultipartResponseDelegateTester; // For unittests. |
100 | 100 |
101 // Pointers to the client and associated loader so we can make callbacks as | 101 // Pointers to the client and associated loader so we can make callbacks as |
102 // we parse pieces of data. | 102 // we parse pieces of data. |
103 WebKit::WebURLLoaderClient* client_; | 103 WebKit::WebURLLoaderClient* client_; |
104 WebKit::WebURLLoader* loader_; | 104 WebKit::WebURLLoader* loader_; |
105 | 105 |
106 // The original resource response for this request. We use this as a | 106 // The original resource response for this request. We use this as a |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 | 142 |
143 // true after we've sent our first response to the WebURLLoaderClient. | 143 // true after we've sent our first response to the WebURLLoaderClient. |
144 bool has_sent_first_response_; | 144 bool has_sent_first_response_; |
145 | 145 |
146 DISALLOW_COPY_AND_ASSIGN(MultipartResponseDelegate); | 146 DISALLOW_COPY_AND_ASSIGN(MultipartResponseDelegate); |
147 }; | 147 }; |
148 | 148 |
149 } // namespace webkit_glue | 149 } // namespace webkit_glue |
150 | 150 |
151 #endif | 151 #endif |
OLD | NEW |