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

Side by Side Diff: net/spdy/spdy_header_block.cc

Issue 1059843002: Refactor NetLog::LogLevel --> NetLogCaptureMode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase again to fix a merge conflict Created 5 years, 8 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 | « net/spdy/spdy_header_block.h ('k') | net/spdy/spdy_header_block_unittest.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "net/spdy/spdy_header_block.h" 5 #include "net/spdy/spdy_header_block.h"
6 6
7 #include "base/values.h" 7 #include "base/values.h"
8 #include "net/http/http_log_util.h" 8 #include "net/http/http_log_util.h"
9 9
10 namespace net { 10 namespace net {
11 11
12 base::Value* SpdyHeaderBlockNetLogCallback( 12 base::Value* SpdyHeaderBlockNetLogCallback(const SpdyHeaderBlock* headers,
13 const SpdyHeaderBlock* headers, 13 NetLogCaptureMode capture_mode) {
14 NetLog::LogLevel log_level) {
15 base::DictionaryValue* dict = new base::DictionaryValue(); 14 base::DictionaryValue* dict = new base::DictionaryValue();
16 base::DictionaryValue* headers_dict = new base::DictionaryValue(); 15 base::DictionaryValue* headers_dict = new base::DictionaryValue();
17 for (SpdyHeaderBlock::const_iterator it = headers->begin(); 16 for (SpdyHeaderBlock::const_iterator it = headers->begin();
18 it != headers->end(); ++it) { 17 it != headers->end(); ++it) {
19 headers_dict->SetWithoutPathExpansion( 18 headers_dict->SetWithoutPathExpansion(
20 it->first, 19 it->first, new base::StringValue(ElideHeaderValueForNetLog(
21 new base::StringValue( 20 capture_mode, it->first, it->second)));
22 ElideHeaderValueForNetLog(log_level, it->first, it->second)));
23 } 21 }
24 dict->Set("headers", headers_dict); 22 dict->Set("headers", headers_dict);
25 return dict; 23 return dict;
26 } 24 }
27 25
28 bool SpdyHeaderBlockFromNetLogParam( 26 bool SpdyHeaderBlockFromNetLogParam(
29 const base::Value* event_param, 27 const base::Value* event_param,
30 SpdyHeaderBlock* headers) { 28 SpdyHeaderBlock* headers) {
31 headers->clear(); 29 headers->clear();
32 30
(...skipping 10 matching lines...) Expand all
43 it.Advance()) { 41 it.Advance()) {
44 if (!it.value().GetAsString(&(*headers)[it.key()])) { 42 if (!it.value().GetAsString(&(*headers)[it.key()])) {
45 headers->clear(); 43 headers->clear();
46 return false; 44 return false;
47 } 45 }
48 } 46 }
49 return true; 47 return true;
50 } 48 }
51 49
52 } // namespace net 50 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_header_block.h ('k') | net/spdy/spdy_header_block_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698