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

Side by Side Diff: chrome/browser/extensions/extension_webrequest_api.cc

Issue 7048010: Fix onBeforeSendHeaders regression: we were sending {name: name} for every (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/test/data/extensions/api_test/webrequest/events/test.html » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/extensions/extension_webrequest_api.h" 5 #include "chrome/browser/extensions/extension_webrequest_api.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 } 154 }
155 return headers_value; 155 return headers_value;
156 } 156 }
157 157
158 ListValue* GetRequestHeadersList(const net::HttpRequestHeaders* headers) { 158 ListValue* GetRequestHeadersList(const net::HttpRequestHeaders* headers) {
159 ListValue* headers_value = new ListValue(); 159 ListValue* headers_value = new ListValue();
160 if (headers) { 160 if (headers) {
161 for (net::HttpRequestHeaders::Iterator it(*headers); it.GetNext(); ) { 161 for (net::HttpRequestHeaders::Iterator it(*headers); it.GetNext(); ) {
162 DictionaryValue* header = new DictionaryValue(); 162 DictionaryValue* header = new DictionaryValue();
163 header->SetString(keys::kHeaderNameKey, it.name()); 163 header->SetString(keys::kHeaderNameKey, it.name());
164 header->SetString(keys::kHeaderValueKey, it.name()); 164 header->SetString(keys::kHeaderValueKey, it.value());
165 headers_value->Append(header); 165 headers_value->Append(header);
166 } 166 }
167 } 167 }
168 return headers_value; 168 return headers_value;
169 } 169 }
170 170
171 // Creates a StringValue with the status line of |headers|. If |headers| is 171 // Creates a StringValue with the status line of |headers|. If |headers| is
172 // NULL, an empty string is returned. Ownership is passed to the caller. 172 // NULL, an empty string is returned. Ownership is passed to the caller.
173 StringValue* GetStatusLine(net::HttpResponseHeaders* headers) { 173 StringValue* GetStatusLine(net::HttpResponseHeaders* headers) {
174 return new StringValue(headers ? headers->GetStatusLine() : ""); 174 return new StringValue(headers ? headers->GetStatusLine() : "");
(...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after
1038 1038
1039 BrowserThread::PostTask( 1039 BrowserThread::PostTask(
1040 BrowserThread::IO, FROM_HERE, 1040 BrowserThread::IO, FROM_HERE,
1041 NewRunnableFunction( 1041 NewRunnableFunction(
1042 &EventHandledOnIOThread, 1042 &EventHandledOnIOThread,
1043 profile()->GetRuntimeId(), extension_id(), 1043 profile()->GetRuntimeId(), extension_id(),
1044 event_name, sub_event_name, request_id, response.release())); 1044 event_name, sub_event_name, request_id, response.release()));
1045 1045
1046 return true; 1046 return true;
1047 } 1047 }
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/extensions/api_test/webrequest/events/test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698