OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/safe_browsing/notification_image_reporter.h" | 5 #include "chrome/browser/safe_browsing/notification_image_reporter.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/feature_list.h" | 11 #include "base/feature_list.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
14 #include "base/memory/ref_counted_memory.h" | 14 #include "base/memory/ref_counted_memory.h" |
15 #include "base/metrics/histogram_macros.h" | 15 #include "base/metrics/histogram_macros.h" |
16 #include "base/rand_util.h" | 16 #include "base/rand_util.h" |
17 #include "base/threading/sequenced_worker_pool.h" | 17 #include "base/threading/sequenced_worker_pool.h" |
18 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
19 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
20 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 20 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 21 #include "components/safe_browsing/common/safe_browsing_prefs.h" |
21 #include "components/safe_browsing/csd.pb.h" | 22 #include "components/safe_browsing/csd.pb.h" |
22 #include "components/safe_browsing_db/database_manager.h" | 23 #include "components/safe_browsing_db/database_manager.h" |
23 #include "components/safe_browsing_db/safe_browsing_prefs.h" | |
24 #include "components/variations/variations_associated_data.h" | 24 #include "components/variations/variations_associated_data.h" |
25 #include "content/public/browser/browser_thread.h" | 25 #include "content/public/browser/browser_thread.h" |
26 #include "net/base/net_errors.h" | 26 #include "net/base/net_errors.h" |
27 #include "net/http/http_status_code.h" | 27 #include "net/http/http_status_code.h" |
28 #include "net/url_request/report_sender.h" | 28 #include "net/url_request/report_sender.h" |
29 #include "skia/ext/image_operations.h" | 29 #include "skia/ext/image_operations.h" |
30 #include "third_party/skia/include/core/SkBitmap.h" | 30 #include "third_party/skia/include/core/SkBitmap.h" |
31 #include "ui/gfx/codec/png_codec.h" | 31 #include "ui/gfx/codec/png_codec.h" |
32 #include "ui/gfx/geometry/size.h" | 32 #include "ui/gfx/geometry/size.h" |
33 #include "url/gurl.h" | 33 #include "url/gurl.h" |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 report.SerializeToString(&serialized_report); | 218 report.SerializeToString(&serialized_report); |
219 report_sender_->Send(GURL(kReportingUploadUrl), "application/octet-stream", | 219 report_sender_->Send(GURL(kReportingUploadUrl), "application/octet-stream", |
220 serialized_report, | 220 serialized_report, |
221 base::Bind(&LogReportResult, GURL(kReportingUploadUrl), | 221 base::Bind(&LogReportResult, GURL(kReportingUploadUrl), |
222 net::OK, net::HTTP_OK), | 222 net::OK, net::HTTP_OK), |
223 base::Bind(&LogReportResult)); | 223 base::Bind(&LogReportResult)); |
224 // TODO(johnme): Consider logging bandwidth and/or duration to UMA. | 224 // TODO(johnme): Consider logging bandwidth and/or duration to UMA. |
225 } | 225 } |
226 | 226 |
227 } // namespace safe_browsing | 227 } // namespace safe_browsing |
OLD | NEW |