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 "components/sync/core/attachments/attachment_downloader_impl.h" | 5 #include "components/sync/core/attachments/attachment_downloader_impl.h" |
6 | 6 |
7 #include <stdint.h> | |
8 | |
9 #include <utility> | 7 #include <utility> |
10 | 8 |
11 #include "base/base64.h" | 9 #include "base/base64.h" |
12 #include "base/bind.h" | 10 #include "base/bind.h" |
13 #include "base/location.h" | 11 #include "base/location.h" |
14 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
15 #include "base/metrics/histogram_macros.h" | 13 #include "base/metrics/histogram_macros.h" |
16 #include "base/metrics/sparse_histogram.h" | 14 #include "base/metrics/sparse_histogram.h" |
17 #include "base/single_thread_task_runner.h" | 15 #include "base/single_thread_task_runner.h" |
18 #include "base/sys_byteorder.h" | 16 #include "base/sys_byteorder.h" |
19 #include "base/threading/thread_task_runner_handle.h" | 17 #include "base/threading/thread_task_runner_handle.h" |
20 #include "base/time/time.h" | 18 #include "base/time/time.h" |
21 #include "components/sync/core/attachments/attachment_uploader_impl.h" | 19 #include "components/sync/core/attachments/attachment_uploader_impl.h" |
22 #include "components/sync/core/attachments/attachment_util.h" | 20 #include "components/sync/core/attachments/attachment_util.h" |
23 #include "components/sync/protocol/sync.pb.h" | 21 #include "components/sync/protocol/sync.pb.h" |
24 #include "net/base/load_flags.h" | 22 #include "net/base/load_flags.h" |
25 #include "net/http/http_response_headers.h" | 23 #include "net/http/http_response_headers.h" |
26 #include "net/http/http_status_code.h" | 24 #include "net/http/http_status_code.h" |
27 #include "net/http/http_util.h" | 25 #include "net/http/http_util.h" |
28 #include "net/url_request/url_fetcher.h" | 26 #include "net/url_request/url_fetcher.h" |
29 #include "net/url_request/url_request_status.h" | 27 #include "net/url_request/url_request_status.h" |
30 #include "url/gurl.h" | |
31 | 28 |
32 namespace syncer { | 29 namespace syncer { |
33 | 30 |
34 struct AttachmentDownloaderImpl::DownloadState { | 31 struct AttachmentDownloaderImpl::DownloadState { |
35 public: | 32 public: |
36 DownloadState(const AttachmentId& attachment_id, | 33 DownloadState(const AttachmentId& attachment_id, |
37 const AttachmentUrl& attachment_url); | 34 const AttachmentUrl& attachment_url); |
38 | 35 |
39 AttachmentId attachment_id; | 36 AttachmentId attachment_id; |
40 AttachmentUrl attachment_url; | 37 AttachmentUrl attachment_url; |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 | 282 |
286 if (crc32c_raw.size() != sizeof(*crc32c)) | 283 if (crc32c_raw.size() != sizeof(*crc32c)) |
287 return false; | 284 return false; |
288 | 285 |
289 *crc32c = | 286 *crc32c = |
290 base::NetToHost32(*reinterpret_cast<const uint32_t*>(crc32c_raw.c_str())); | 287 base::NetToHost32(*reinterpret_cast<const uint32_t*>(crc32c_raw.c_str())); |
291 return true; | 288 return true; |
292 } | 289 } |
293 | 290 |
294 } // namespace syncer | 291 } // namespace syncer |
OLD | NEW |