OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/budget_service/budget_manager.h" | 5 #include "chrome/browser/budget_service/budget_manager.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
11 #include "base/metrics/histogram_macros.h" | 11 #include "base/metrics/histogram_macros.h" |
12 #include "base/threading/sequenced_worker_pool.h" | |
13 #include "base/threading/thread_task_runner_handle.h" | 12 #include "base/threading/thread_task_runner_handle.h" |
14 #include "base/time/time.h" | 13 #include "base/time/time.h" |
15 #include "chrome/browser/engagement/site_engagement_score.h" | 14 #include "chrome/browser/engagement/site_engagement_score.h" |
16 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
17 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
18 #include "content/public/common/origin_util.h" | 17 #include "content/public/common/origin_util.h" |
19 #include "third_party/WebKit/public/platform/modules/budget_service/budget_servi
ce.mojom.h" | 18 #include "third_party/WebKit/public/platform/modules/budget_service/budget_servi
ce.mojom.h" |
20 #include "url/origin.h" | 19 #include "url/origin.h" |
21 | 20 |
22 using content::BrowserThread; | 21 using content::BrowserThread; |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 blink::mojom::BudgetServiceErrorType error, | 134 blink::mojom::BudgetServiceErrorType error, |
136 bool success) { | 135 bool success) { |
137 // If the call succeeded, write the new reservation into the map. | 136 // If the call succeeded, write the new reservation into the map. |
138 if (success && error == blink::mojom::BudgetServiceErrorType::NONE) | 137 if (success && error == blink::mojom::BudgetServiceErrorType::NONE) |
139 reservation_map_[origin]++; | 138 reservation_map_[origin]++; |
140 | 139 |
141 UMA_HISTOGRAM_BOOLEAN("Blink.BudgetAPI.Reserve", success); | 140 UMA_HISTOGRAM_BOOLEAN("Blink.BudgetAPI.Reserve", success); |
142 | 141 |
143 callback.Run(error, success); | 142 callback.Run(error, success); |
144 } | 143 } |
OLD | NEW |