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

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

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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 | « 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "net/spdy/spdy_header_block.h"
6
7 #include "base/values.h"
8 #include "net/http/http_log_util.h"
9
10 namespace net {
11
12 base::Value* SpdyHeaderBlockNetLogCallback(
13 const SpdyHeaderBlock* headers,
14 NetLog::LogLevel log_level) {
15 base::DictionaryValue* dict = new base::DictionaryValue();
16 base::DictionaryValue* headers_dict = new base::DictionaryValue();
17 for (SpdyHeaderBlock::const_iterator it = headers->begin();
18 it != headers->end(); ++it) {
19 headers_dict->SetWithoutPathExpansion(
20 it->first,
21 new base::StringValue(
22 ElideHeaderValueForNetLog(log_level, it->first, it->second)));
23 }
24 dict->Set("headers", headers_dict);
25 return dict;
26 }
27
28 bool SpdyHeaderBlockFromNetLogParam(
29 const base::Value* event_param,
30 SpdyHeaderBlock* headers) {
31 headers->clear();
32
33 const base::DictionaryValue* dict = NULL;
34 const base::DictionaryValue* header_dict = NULL;
35
36 if (!event_param ||
37 !event_param->GetAsDictionary(&dict) ||
38 !dict->GetDictionary("headers", &header_dict)) {
39 return false;
40 }
41
42 for (base::DictionaryValue::Iterator it(*header_dict); !it.IsAtEnd();
43 it.Advance()) {
44 if (!it.value().GetAsString(&(*headers)[it.key()])) {
45 headers->clear();
46 return false;
47 }
48 }
49 return true;
50 }
51
52 } // 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