OLD | NEW |
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/http/http_pipelined_host_forced.h" | 5 #include "net/http/http_pipelined_host_forced.h" |
6 | 6 |
7 #include "base/values.h" | 7 #include "base/values.h" |
8 #include "net/http/http_pipelined_connection_impl.h" | 8 #include "net/http/http_pipelined_connection_impl.h" |
9 #include "net/http/http_pipelined_stream.h" | 9 #include "net/http/http_pipelined_stream.h" |
10 #include "net/socket/buffered_write_stream_socket.h" | 10 #include "net/socket/buffered_write_stream_socket.h" |
11 #include "net/socket/client_socket_handle.h" | 11 #include "net/socket/client_socket_handle.h" |
12 | 12 |
13 using base::DictionaryValue; | |
14 using base::ListValue; | |
15 using base::Value; | |
16 | |
17 namespace net { | 13 namespace net { |
18 | 14 |
19 HttpPipelinedHostForced::HttpPipelinedHostForced( | 15 HttpPipelinedHostForced::HttpPipelinedHostForced( |
20 HttpPipelinedHost::Delegate* delegate, | 16 HttpPipelinedHost::Delegate* delegate, |
21 const Key& key, | 17 const Key& key, |
22 HttpPipelinedConnection::Factory* factory) | 18 HttpPipelinedConnection::Factory* factory) |
23 : delegate_(delegate), | 19 : delegate_(delegate), |
24 key_(key), | 20 key_(key), |
25 factory_(factory) { | 21 factory_(factory) { |
26 if (!factory) { | 22 if (!factory) { |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 // WARNING: We might be deleted here. | 78 // WARNING: We might be deleted here. |
83 } | 79 } |
84 } | 80 } |
85 | 81 |
86 void HttpPipelinedHostForced::OnPipelineFeedback( | 82 void HttpPipelinedHostForced::OnPipelineFeedback( |
87 HttpPipelinedConnection* pipeline, | 83 HttpPipelinedConnection* pipeline, |
88 HttpPipelinedConnection::Feedback feedback) { | 84 HttpPipelinedConnection::Feedback feedback) { |
89 // We don't care. We always pipeline. | 85 // We don't care. We always pipeline. |
90 } | 86 } |
91 | 87 |
92 Value* HttpPipelinedHostForced::PipelineInfoToValue() const { | 88 base::Value* HttpPipelinedHostForced::PipelineInfoToValue() const { |
93 ListValue* list_value = new ListValue(); | 89 base::ListValue* list_value = new base::ListValue(); |
94 if (pipeline_.get()) { | 90 if (pipeline_.get()) { |
95 DictionaryValue* pipeline_dict = new DictionaryValue; | 91 base::DictionaryValue* pipeline_dict = new base::DictionaryValue; |
96 pipeline_dict->SetString("host", key_.origin().ToString()); | 92 pipeline_dict->SetString("host", key_.origin().ToString()); |
97 pipeline_dict->SetBoolean("forced", true); | 93 pipeline_dict->SetBoolean("forced", true); |
98 pipeline_dict->SetInteger("depth", pipeline_->depth()); | 94 pipeline_dict->SetInteger("depth", pipeline_->depth()); |
99 pipeline_dict->SetInteger("capacity", 1000); | 95 pipeline_dict->SetInteger("capacity", 1000); |
100 pipeline_dict->SetBoolean("usable", pipeline_->usable()); | 96 pipeline_dict->SetBoolean("usable", pipeline_->usable()); |
101 pipeline_dict->SetBoolean("active", pipeline_->active()); | 97 pipeline_dict->SetBoolean("active", pipeline_->active()); |
102 pipeline_dict->SetInteger("source_id", pipeline_->net_log().source().id); | 98 pipeline_dict->SetInteger("source_id", pipeline_->net_log().source().id); |
103 list_value->Append(pipeline_dict); | 99 list_value->Append(pipeline_dict); |
104 } | 100 } |
105 return list_value; | 101 return list_value; |
106 } | 102 } |
107 | 103 |
108 } // namespace net | 104 } // namespace net |
OLD | NEW |