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); | |
97 | 96 |
98 private: | 97 private: |
99 friend class MultipartResponseDelegateTester; // For unittests. | 98 friend class MultipartResponseDelegateTester; // For unittests. |
100 | 99 |
101 // Pointers to the client and associated loader so we can make callbacks as | 100 // Pointers to the client and associated loader so we can make callbacks as |
102 // we parse pieces of data. | 101 // we parse pieces of data. |
103 WebKit::WebURLLoaderClient* client_; | 102 WebKit::WebURLLoaderClient* client_; |
104 WebKit::WebURLLoader* loader_; | 103 WebKit::WebURLLoader* loader_; |
105 | 104 |
106 // The original resource response for this request. We use this as a | 105 // 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... |
139 | 138 |
140 // true after we've sent our first response to the WebURLLoaderClient. | 139 // true after we've sent our first response to the WebURLLoaderClient. |
141 bool has_sent_first_response_; | 140 bool has_sent_first_response_; |
142 | 141 |
143 DISALLOW_COPY_AND_ASSIGN(MultipartResponseDelegate); | 142 DISALLOW_COPY_AND_ASSIGN(MultipartResponseDelegate); |
144 }; | 143 }; |
145 | 144 |
146 } // namespace webkit_glue | 145 } // namespace webkit_glue |
147 | 146 |
148 #endif | 147 #endif |
OLD | NEW |