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

Side by Side Diff: chrome/browser/devtools/devtools_ui_bindings.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 "chrome/browser/devtools/devtools_ui_bindings.h" 5 #include "chrome/browser/devtools/devtools_ui_bindings.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after
975 DCHECK(source); 975 DCHECK(source);
976 PendingRequestsMap::iterator it = pending_requests_.find(source); 976 PendingRequestsMap::iterator it = pending_requests_.find(source);
977 DCHECK(it != pending_requests_.end()); 977 DCHECK(it != pending_requests_.end());
978 978
979 base::DictionaryValue response; 979 base::DictionaryValue response;
980 base::DictionaryValue* headers = new base::DictionaryValue(); 980 base::DictionaryValue* headers = new base::DictionaryValue();
981 net::HttpResponseHeaders* rh = source->GetResponseHeaders(); 981 net::HttpResponseHeaders* rh = source->GetResponseHeaders();
982 response.SetInteger("statusCode", rh ? rh->response_code() : 200); 982 response.SetInteger("statusCode", rh ? rh->response_code() : 200);
983 response.Set("headers", headers); 983 response.Set("headers", headers);
984 984
985 void* iterator = NULL; 985 size_t iterator = 0;
986 std::string name; 986 std::string name;
987 std::string value; 987 std::string value;
988 while (rh && rh->EnumerateHeaderLines(&iterator, &name, &value)) 988 while (rh && rh->EnumerateHeaderLines(&iterator, &name, &value))
989 headers->SetString(name, value); 989 headers->SetString(name, value);
990 990
991 it->second.Run(&response); 991 it->second.Run(&response);
992 pending_requests_.erase(it); 992 pending_requests_.erase(it);
993 delete source; 993 delete source;
994 } 994 }
995 995
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
1223 return; 1223 return;
1224 frontend_loaded_ = true; 1224 frontend_loaded_ = true;
1225 1225
1226 // Call delegate first - it seeds importants bit of information. 1226 // Call delegate first - it seeds importants bit of information.
1227 delegate_->OnLoadCompleted(); 1227 delegate_->OnLoadCompleted();
1228 1228
1229 AddDevToolsExtensionsToClient(); 1229 AddDevToolsExtensionsToClient();
1230 if (g_web_socket_api_channel) 1230 if (g_web_socket_api_channel)
1231 g_web_socket_api_channel->AttachedToBindings(this); 1231 g_web_socket_api_channel->AttachedToBindings(this);
1232 } 1232 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698