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

Side by Side Diff: mojo/services/network/url_loader_impl.cc

Issue 1594973004: Remove use of void** from HttpResponseHeaders::EnumerateHeaderLines (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Created 4 years, 11 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "mojo/services/network/url_loader_impl.h" 5 #include "mojo/services/network/url_loader_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <utility> 10 #include <utility>
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 response->url = String::From(url_request->url()); 70 response->url = String::From(url_request->url());
71 response->site = GetSiteForURL(url_request->url()).spec(); 71 response->site = GetSiteForURL(url_request->url()).spec();
72 72
73 const net::HttpResponseHeaders* headers = url_request->response_headers(); 73 const net::HttpResponseHeaders* headers = url_request->response_headers();
74 if (headers) { 74 if (headers) {
75 response->status_code = headers->response_code(); 75 response->status_code = headers->response_code();
76 response->status_line = headers->GetStatusLine(); 76 response->status_line = headers->GetStatusLine();
77 77
78 response->headers = Array<HttpHeaderPtr>::New(0); 78 response->headers = Array<HttpHeaderPtr>::New(0);
79 std::vector<String> header_lines; 79 std::vector<String> header_lines;
80 void* iter = nullptr; 80 size_t iter = 0;
81 std::string name, value; 81 std::string name, value;
82 while (headers->EnumerateHeaderLines(&iter, &name, &value)) { 82 while (headers->EnumerateHeaderLines(&iter, &name, &value)) {
83 HttpHeaderPtr header = HttpHeader::New(); 83 HttpHeaderPtr header = HttpHeader::New();
84 header->name = name; 84 header->name = name;
85 header->value = value; 85 header->value = value;
86 response->headers.push_back(std::move(header)); 86 response->headers.push_back(std::move(header));
87 } 87 }
88 } 88 }
89 89
90 std::string mime_type; 90 std::string mime_type;
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 417
418 void URLLoaderImpl::ListenForPeerClosed() { 418 void URLLoaderImpl::ListenForPeerClosed() {
419 handle_watcher_.Start(response_body_stream_.get(), 419 handle_watcher_.Start(response_body_stream_.get(),
420 MOJO_HANDLE_SIGNAL_PEER_CLOSED, 420 MOJO_HANDLE_SIGNAL_PEER_CLOSED,
421 MOJO_DEADLINE_INDEFINITE, 421 MOJO_DEADLINE_INDEFINITE,
422 base::Bind(&URLLoaderImpl::OnResponseBodyStreamClosed, 422 base::Bind(&URLLoaderImpl::OnResponseBodyStreamClosed,
423 base::Unretained(this))); 423 base::Unretained(this)));
424 } 424 }
425 425
426 } // namespace mojo 426 } // namespace mojo
OLDNEW
« no previous file with comments | « ios/web/public/test/response_providers/data_response_provider.mm ('k') | net/http/http_response_headers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698