| 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 "chrome/browser/net/websocket_experiment/websocket_experiment_task.h" | 5 #include "chrome/browser/net/websocket_experiment/websocket_experiment_task.h" |
| 6 | 6 |
| 7 #include "base/hash_tables.h" | 7 #include "base/hash_tables.h" |
| 8 #include "base/histogram.h" | 8 #include "base/histogram.h" |
| 9 #include "chrome/browser/chrome_thread.h" | 9 #include "chrome/browser/chrome_thread.h" |
| 10 #include "chrome/browser/profile.h" | 10 #include "chrome/browser/profile.h" |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 base::TimeDelta min, | 178 base::TimeDelta min, |
| 179 base::TimeDelta max, | 179 base::TimeDelta max, |
| 180 size_t bucket_count) { | 180 size_t bucket_count) { |
| 181 DCHECK(g_histogram_table); | 181 DCHECK(g_histogram_table); |
| 182 std::string counter_name = GetCounterNameForConfig(config, name); | 182 std::string counter_name = GetCounterNameForConfig(config, name); |
| 183 base::hash_map<std::string, Histogram*>::iterator found = | 183 base::hash_map<std::string, Histogram*>::iterator found = |
| 184 g_histogram_table->find(counter_name); | 184 g_histogram_table->find(counter_name); |
| 185 if (found != g_histogram_table->end()) { | 185 if (found != g_histogram_table->end()) { |
| 186 return found->second; | 186 return found->second; |
| 187 } | 187 } |
| 188 Histogram* counter = Histogram::FactoryGet( | 188 Histogram* counter = Histogram::FactoryTimeGet( |
| 189 counter_name, min, max, bucket_count, | 189 counter_name, min, max, bucket_count, |
| 190 Histogram::kUmaTargetedHistogramFlag); | 190 Histogram::kUmaTargetedHistogramFlag); |
| 191 counter->AddRef(); // Released in ReleaseHistogram(). | 191 counter->AddRef(); // Released in ReleaseHistogram(). |
| 192 g_histogram_table->insert(std::make_pair(counter_name, counter)); | 192 g_histogram_table->insert(std::make_pair(counter_name, counter)); |
| 193 return counter; | 193 return counter; |
| 194 } | 194 } |
| 195 | 195 |
| 196 static void UpdateHistogramEnums( | 196 static void UpdateHistogramEnums( |
| 197 const WebSocketExperimentTask::Config& config, | 197 const WebSocketExperimentTask::Config& config, |
| 198 const std::string& name, | 198 const std::string& name, |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 641 if (websocket) | 641 if (websocket) |
| 642 websocket->DetachDelegate(); | 642 websocket->DetachDelegate(); |
| 643 DLOG(INFO) << "Finish WebSocket experiment for " << config_.url | 643 DLOG(INFO) << "Finish WebSocket experiment for " << config_.url |
| 644 << " " << GetProtocolVersionName(config_.protocol_version) | 644 << " " << GetProtocolVersionName(config_.protocol_version) |
| 645 << " next_state=" << next_state_ | 645 << " next_state=" << next_state_ |
| 646 << " result=" << net::ErrorToString(result); | 646 << " result=" << net::ErrorToString(result); |
| 647 callback_->Run(result); // will release this. | 647 callback_->Run(result); // will release this. |
| 648 } | 648 } |
| 649 | 649 |
| 650 } // namespace chrome_browser_net | 650 } // namespace chrome_browser_net |
| OLD | NEW |