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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 int* content_range_lower_bound, |
95 int* content_range_upper_bound); | 95 int* content_range_upper_bound, |
| 96 int* content_range_instance_size); |
96 | 97 |
97 private: | 98 private: |
98 friend class MultipartResponseDelegateTester; // For unittests. | 99 friend class MultipartResponseDelegateTester; // For unittests. |
99 | 100 |
100 // 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 |
101 // we parse pieces of data. | 102 // we parse pieces of data. |
102 WebKit::WebURLLoaderClient* client_; | 103 WebKit::WebURLLoaderClient* client_; |
103 WebKit::WebURLLoader* loader_; | 104 WebKit::WebURLLoader* loader_; |
104 | 105 |
105 // 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 139 |
139 // true after we've sent our first response to the WebURLLoaderClient. | 140 // true after we've sent our first response to the WebURLLoaderClient. |
140 bool has_sent_first_response_; | 141 bool has_sent_first_response_; |
141 | 142 |
142 DISALLOW_COPY_AND_ASSIGN(MultipartResponseDelegate); | 143 DISALLOW_COPY_AND_ASSIGN(MultipartResponseDelegate); |
143 }; | 144 }; |
144 | 145 |
145 } // namespace webkit_glue | 146 } // namespace webkit_glue |
146 | 147 |
147 #endif | 148 #endif |
OLD | NEW |