OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 "sync/internal_api/public/http_bridge.h" | 5 #include "sync/internal_api/public/http_bridge.h" |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 void RecordSyncResponseContentLengthHistograms(int64 compressed_content_length, | 55 void RecordSyncResponseContentLengthHistograms(int64 compressed_content_length, |
56 int64 original_content_length) { | 56 int64 original_content_length) { |
57 UMA_HISTOGRAM_COUNTS("Sync.ResponseContentLength.Compressed", | 57 UMA_HISTOGRAM_COUNTS("Sync.ResponseContentLength.Compressed", |
58 compressed_content_length); | 58 compressed_content_length); |
59 UMA_HISTOGRAM_COUNTS("Sync.ResponseContentLength.Original", | 59 UMA_HISTOGRAM_COUNTS("Sync.ResponseContentLength.Original", |
60 original_content_length); | 60 original_content_length); |
61 } | 61 } |
62 | 62 |
63 // ----------------------------------------------------------------------------- | 63 // ----------------------------------------------------------------------------- |
64 // The rest of the code in the anon namespace is copied from | 64 // The rest of the code in the anon namespace is copied from |
65 // components/metrics/compression_utils.cc | 65 // components/compression/compression_utils.cc |
66 // TODO(gangwu): crbug.com/515695. The following code is copied from | 66 // TODO(gangwu): crbug.com/515695. The following code is copied from |
67 // components/metrics/compression_utils.cc. We copied them because if we | 67 // components/compression/compression_utils.cc. We copied them because if we |
68 // reference them, we will get cycle dependency warning. Once the functions | 68 // reference them, we will get cycle dependency warning. Once the functions |
69 // have been moved from //component to //base, we can remove the following | 69 // have been moved from //component to //base, we can remove the following |
70 // functions. | 70 // functions. |
71 //------------------------------------------------------------------------------ | 71 //------------------------------------------------------------------------------ |
72 // The difference in bytes between a zlib header and a gzip header. | 72 // The difference in bytes between a zlib header and a gzip header. |
73 const size_t kGzipZlibHeaderDifferenceBytes = 16; | 73 const size_t kGzipZlibHeaderDifferenceBytes = 16; |
74 | 74 |
75 // Pass an integer greater than the following get a gzip header instead of a | 75 // Pass an integer greater than the following get a gzip header instead of a |
76 // zlib header when calling deflateInit2() and inflateInit2(). | 76 // zlib header when calling deflateInit2() and inflateInit2(). |
77 const int kWindowBitsToGetGzipHeader = 16; | 77 const int kWindowBitsToGetGzipHeader = 16; |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 int64 sane_time_ms = 0; | 526 int64 sane_time_ms = 0; |
527 if (base::StringToInt64(sane_time_str, &sane_time_ms)) { | 527 if (base::StringToInt64(sane_time_str, &sane_time_ms)) { |
528 network_time_update_callback_.Run( | 528 network_time_update_callback_.Run( |
529 base::Time::FromJsTime(sane_time_ms), | 529 base::Time::FromJsTime(sane_time_ms), |
530 base::TimeDelta::FromMilliseconds(1), | 530 base::TimeDelta::FromMilliseconds(1), |
531 fetch_state_.end_time - fetch_state_.start_time); | 531 fetch_state_.end_time - fetch_state_.start_time); |
532 } | 532 } |
533 } | 533 } |
534 | 534 |
535 } // namespace syncer | 535 } // namespace syncer |
OLD | NEW |