Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Side by Side Diff: webkit/glue/multipart_response_delegate.h

Issue 2850023: Fix a crash when the content type of a multipart request (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: cancel -> Cancel Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | webkit/glue/multipart_response_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 public: 68 public:
69 MultipartResponseDelegate(WebKit::WebURLLoaderClient* client, 69 MultipartResponseDelegate(WebKit::WebURLLoaderClient* client,
70 WebKit::WebURLLoader* loader, 70 WebKit::WebURLLoader* loader,
71 const WebKit::WebURLResponse& response, 71 const WebKit::WebURLResponse& response,
72 const std::string& boundary); 72 const std::string& boundary);
73 73
74 // Passed through from ResourceHandleInternal 74 // Passed through from ResourceHandleInternal
75 void OnReceivedData(const char* data, int data_len); 75 void OnReceivedData(const char* data, int data_len);
76 void OnCompletedRequest(); 76 void OnCompletedRequest();
77 77
78 // The request has been canceled, so stop making calls to the client.
79 void Cancel() {
80 client_ = NULL;
81 loader_ = NULL;
82 }
83
78 // Returns the multi part boundary string from the Content-type header 84 // Returns the multi part boundary string from the Content-type header
79 // in the response. 85 // in the response.
80 // Returns true on success. 86 // Returns true on success.
81 static bool ReadMultipartBoundary(const WebKit::WebURLResponse& response, 87 static bool ReadMultipartBoundary(const WebKit::WebURLResponse& response,
82 std::string* multipart_boundary); 88 std::string* multipart_boundary);
83 89
84 // Returns the lower and higher content ranges from an individual multipart 90 // Returns the lower and higher content ranges from an individual multipart
85 // in a multipart response. 91 // in a multipart response.
86 // Returns true on success. 92 // Returns true on success.
87 static bool ReadContentRanges(const WebKit::WebURLResponse& response, 93 static bool ReadContentRanges(const WebKit::WebURLResponse& response,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 138
133 // true after we've sent our first response to the WebURLLoaderClient. 139 // true after we've sent our first response to the WebURLLoaderClient.
134 bool has_sent_first_response_; 140 bool has_sent_first_response_;
135 141
136 DISALLOW_COPY_AND_ASSIGN(MultipartResponseDelegate); 142 DISALLOW_COPY_AND_ASSIGN(MultipartResponseDelegate);
137 }; 143 };
138 144
139 } // namespace webkit_glue 145 } // namespace webkit_glue
140 146
141 #endif 147 #endif
OLDNEW
« no previous file with comments | « no previous file | webkit/glue/multipart_response_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698