Landing Recent QUIC changes until 8/19/2015 17:00 UTC.
[chromium-blink-merge.git] / net / base / sdch_net_log_params.cc
blob81f84760d815c9f4f86604810f514a107532c970
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
3 // found in the LICENSE file.
5 #include "net/base/sdch_net_log_params.h"
7 #include "base/values.h"
8 #include "net/base/net_errors.h"
9 #include "url/gurl.h"
11 namespace net {
13 scoped_ptr<base::Value> NetLogSdchResourceProblemCallback(
14 SdchProblemCode problem,
15 NetLogCaptureMode capture_mode) {
16 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
17 dict->SetInteger("sdch_problem_code", problem);
18 dict->SetInteger("net_error", ERR_FAILED);
19 return dict.Pass();
22 scoped_ptr<base::Value> NetLogSdchDictionaryFetchProblemCallback(
23 SdchProblemCode problem,
24 const GURL& url,
25 bool is_error,
26 NetLogCaptureMode capture_mode) {
27 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
28 dict->SetInteger("sdch_problem_code", problem);
29 dict->SetString("dictionary_url", url.spec());
30 if (is_error)
31 dict->SetInteger("net_error", ERR_FAILED);
32 return dict.Pass();
35 } // namespace net