OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/tools/flip_server/output_ordering.h" | 5 #include "net/tools/flip_server/output_ordering.h" |
6 | 6 |
7 #include "net/tools/flip_server/flip_config.h" | 7 #include "net/tools/flip_server/flip_config.h" |
8 #include "net/tools/flip_server/sm_connection.h" | 8 #include "net/tools/flip_server/sm_connection.h" |
9 | 9 |
10 | 10 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 connection_->ReadyToSend(); | 88 connection_->ReadyToSend(); |
89 } | 89 } |
90 | 90 |
91 void OutputOrdering::AddToOutputOrder(const MemCacheIter& mci) { | 91 void OutputOrdering::AddToOutputOrder(const MemCacheIter& mci) { |
92 if (ExistsInPriorityMaps(mci.stream_id)) | 92 if (ExistsInPriorityMaps(mci.stream_id)) |
93 LOG(ERROR) << "OOps, already was inserted here?!"; | 93 LOG(ERROR) << "OOps, already was inserted here?!"; |
94 | 94 |
95 double think_time_in_s = server_think_time_in_s_; | 95 double think_time_in_s = server_think_time_in_s_; |
96 std::string x_server_latency = | 96 std::string x_server_latency = |
97 mci.file_data->headers->GetHeader("X-Server-Latency").as_string(); | 97 mci.file_data->headers->GetHeader("X-Server-Latency").as_string(); |
98 if (x_server_latency.size() != 0) { | 98 if (!x_server_latency.empty()) { |
99 char* endp; | 99 char* endp; |
100 double tmp_think_time_in_s = strtod(x_server_latency.c_str(), &endp); | 100 double tmp_think_time_in_s = strtod(x_server_latency.c_str(), &endp); |
101 if (endp != x_server_latency.c_str() + x_server_latency.size()) { | 101 if (endp != x_server_latency.c_str() + x_server_latency.size()) { |
102 LOG(ERROR) << "Unable to understand X-Server-Latency of: " | 102 LOG(ERROR) << "Unable to understand X-Server-Latency of: " |
103 << x_server_latency << " for resource: " | 103 << x_server_latency << " for resource: " |
104 << mci.file_data->filename.c_str(); | 104 << mci.file_data->filename.c_str(); |
105 } else { | 105 } else { |
106 think_time_in_s = tmp_think_time_in_s; | 106 think_time_in_s = tmp_think_time_in_s; |
107 } | 107 } |
108 } | 108 } |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 PriorityMapPointer& pmp = sitpmi->second; | 170 PriorityMapPointer& pmp = sitpmi->second; |
171 if (pmp.alarm_enabled) | 171 if (pmp.alarm_enabled) |
172 epoll_server_->UnregisterAlarm(pmp.alarm_token); | 172 epoll_server_->UnregisterAlarm(pmp.alarm_token); |
173 else | 173 else |
174 pmp.ring->erase(pmp.it); | 174 pmp.ring->erase(pmp.it); |
175 stream_ids_.erase(sitpmi); | 175 stream_ids_.erase(sitpmi); |
176 } | 176 } |
177 | 177 |
178 } // namespace net | 178 } // namespace net |
179 | 179 |
OLD | NEW |