| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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/supervised_user/experimental/supervised_user_async_url_
checker.h" | 5 #include "chrome/browser/supervised_user/experimental/supervised_user_async_url_
checker.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/json/json_reader.h" | 11 #include "base/json/json_reader.h" |
| 12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram_macros.h" |
| 13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
| 14 #include "base/strings/string_piece.h" | 14 #include "base/strings/string_piece.h" |
| 15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
| 16 #include "base/strings/stringprintf.h" | 16 #include "base/strings/stringprintf.h" |
| 17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
| 18 #include "base/values.h" | 18 #include "base/values.h" |
| 19 #include "components/google/core/browser/google_util.h" | 19 #include "components/google/core/browser/google_util.h" |
| 20 #include "google_apis/google_api_keys.h" | 20 #include "google_apis/google_api_keys.h" |
| 21 #include "net/base/escape.h" | 21 #include "net/base/escape.h" |
| 22 #include "net/base/load_flags.h" | 22 #include "net/base/load_flags.h" |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 | 213 |
| 214 UMA_HISTOGRAM_TIMES("ManagedUsers.SafeSitesDelay", | 214 UMA_HISTOGRAM_TIMES("ManagedUsers.SafeSitesDelay", |
| 215 base::TimeTicks::Now() - check->start_time); | 215 base::TimeTicks::Now() - check->start_time); |
| 216 | 216 |
| 217 cache_.Put(check->url, CheckResult(behavior, uncertain)); | 217 cache_.Put(check->url, CheckResult(behavior, uncertain)); |
| 218 | 218 |
| 219 for (size_t i = 0; i < check->callbacks.size(); i++) | 219 for (size_t i = 0; i < check->callbacks.size(); i++) |
| 220 check->callbacks[i].Run(check->url, behavior, uncertain); | 220 check->callbacks[i].Run(check->url, behavior, uncertain); |
| 221 checks_in_progress_.erase(it); | 221 checks_in_progress_.erase(it); |
| 222 } | 222 } |
| OLD | NEW |