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

Side by Side Diff: components/cronet/android/cronet_bidirectional_stream_adapter.cc

Issue 1777083002: Make QuicSimpleServerStream supports multipart response body (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@quicsmaller
Patch Set: Rebased Created 4 years, 9 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 | components/cronet/android/test/javatests/src/org/chromium/net/TestBidirectionalStreamCallback.java » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "cronet_bidirectional_stream_adapter.h" 5 #include "cronet_bidirectional_stream_adapter.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 // Get http status code from response headers. 181 // Get http status code from response headers.
182 jint http_status_code = 0; 182 jint http_status_code = 0;
183 const auto http_status_header = response_headers.find(":status"); 183 const auto http_status_header = response_headers.find(":status");
184 if (http_status_header != response_headers.end()) 184 if (http_status_header != response_headers.end())
185 base::StringToInt(http_status_header->second, &http_status_code); 185 base::StringToInt(http_status_header->second, &http_status_code);
186 186
187 std::string protocol; 187 std::string protocol;
188 switch (bidi_stream_->GetProtocol()) { 188 switch (bidi_stream_->GetProtocol()) {
189 case net::kProtoHTTP2: 189 case net::kProtoHTTP2:
190 protocol = "h2"; 190 protocol = "h2";
191 break;
192 case net::kProtoQUIC1SPDY3:
193 protocol = "quic/1+spdy/3";
194 break;
191 default: 195 default:
192 break; 196 break;
193 } 197 }
194 198
195 cronet::Java_CronetBidirectionalStream_onResponseHeadersReceived( 199 cronet::Java_CronetBidirectionalStream_onResponseHeadersReceived(
196 env, owner_.obj(), http_status_code, 200 env, owner_.obj(), http_status_code,
197 ConvertUTF8ToJavaString(env, protocol).obj(), 201 ConvertUTF8ToJavaString(env, protocol).obj(),
198 GetHeadersArray(env, response_headers).obj(), 202 GetHeadersArray(env, response_headers).obj(),
199 bidi_stream_->GetTotalReceivedBytes()); 203 bidi_stream_->GetTotalReceivedBytes());
200 } 204 }
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 309
306 std::vector<std::string> headers; 310 std::vector<std::string> headers;
307 for (const auto& header : header_block) { 311 for (const auto& header : header_block) {
308 headers.push_back(header.first.as_string()); 312 headers.push_back(header.first.as_string());
309 headers.push_back(header.second.as_string()); 313 headers.push_back(header.second.as_string());
310 } 314 }
311 return base::android::ToJavaArrayOfStrings(env, headers); 315 return base::android::ToJavaArrayOfStrings(env, headers);
312 } 316 }
313 317
314 } // namespace cronet 318 } // namespace cronet
OLDNEW
« no previous file with comments | « no previous file | components/cronet/android/test/javatests/src/org/chromium/net/TestBidirectionalStreamCallback.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698