| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/net/passive_log_collector.h" | 5 #include "chrome/browser/net/passive_log_collector.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 NOTREACHED(); | 174 NOTREACHED(); |
| 175 break; | 175 break; |
| 176 } | 176 } |
| 177 } | 177 } |
| 178 } | 178 } |
| 179 } | 179 } |
| 180 | 180 |
| 181 void PassiveLogCollector::SourceTracker::DeleteSourceInfo( | 181 void PassiveLogCollector::SourceTracker::DeleteSourceInfo( |
| 182 uint32 source_id) { | 182 uint32 source_id) { |
| 183 SourceIDToInfoMap::iterator it = sources_.find(source_id); | 183 SourceIDToInfoMap::iterator it = sources_.find(source_id); |
| 184 DCHECK(it != sources_.end()); | 184 if (it == sources_.end()) { |
| 185 // TODO(eroman): Is this happening? And if so, why. |
| 186 LOG(WARNING) << "Tried to delete info for nonexistent source"; |
| 187 return; |
| 188 } |
| 185 // The source should not be in the deletion queue. | 189 // The source should not be in the deletion queue. |
| 186 DCHECK(std::find(deletion_queue_.begin(), deletion_queue_.end(), | 190 DCHECK(std::find(deletion_queue_.begin(), deletion_queue_.end(), |
| 187 source_id) == deletion_queue_.end()); | 191 source_id) == deletion_queue_.end()); |
| 188 ReleaseAllReferencesToDependencies(&(it->second)); | 192 ReleaseAllReferencesToDependencies(&(it->second)); |
| 189 sources_.erase(it); | 193 sources_.erase(it); |
| 190 } | 194 } |
| 191 | 195 |
| 192 void PassiveLogCollector::SourceTracker::Clear() { | 196 void PassiveLogCollector::SourceTracker::Clear() { |
| 193 deletion_queue_.clear(); | 197 deletion_queue_.clear(); |
| 194 | 198 |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 PassiveLogCollector::SpdySessionTracker::DoAddEntry(const Entry& entry, | 451 PassiveLogCollector::SpdySessionTracker::DoAddEntry(const Entry& entry, |
| 448 SourceInfo* out_info) { | 452 SourceInfo* out_info) { |
| 449 AddEntryToSourceInfo(entry, out_info); | 453 AddEntryToSourceInfo(entry, out_info); |
| 450 if (entry.type == net::NetLog::TYPE_SPDY_SESSION && | 454 if (entry.type == net::NetLog::TYPE_SPDY_SESSION && |
| 451 entry.phase == net::NetLog::PHASE_END) { | 455 entry.phase == net::NetLog::PHASE_END) { |
| 452 return ACTION_MOVE_TO_GRAVEYARD; | 456 return ACTION_MOVE_TO_GRAVEYARD; |
| 453 } else { | 457 } else { |
| 454 return ACTION_NONE; | 458 return ACTION_NONE; |
| 455 } | 459 } |
| 456 } | 460 } |
| OLD | NEW |