| 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 import base64 | 5 import base64 |
| 6 import gzip | 6 import gzip |
| 7 import hashlib | 7 import hashlib |
| 8 import io | 8 import io |
| 9 import logging | 9 import logging |
| 10 import zlib | 10 import zlib |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 if self.compute_data_saving: | 193 if self.compute_data_saving: |
| 194 if (original_content_length > 0 and | 194 if (original_content_length > 0 and |
| 195 original_content_length >= content_length): | 195 original_content_length >= content_length): |
| 196 saving = (float(original_content_length-content_length) * 100 / | 196 saving = (float(original_content_length-content_length) * 100 / |
| 197 original_content_length) | 197 original_content_length) |
| 198 results.AddValue(scalar.ScalarValue( | 198 results.AddValue(scalar.ScalarValue( |
| 199 results.current_page, 'data_saving', 'percent', saving)) | 199 results.current_page, 'data_saving', 'percent', saving)) |
| 200 else: | 200 else: |
| 201 results.AddValue(scalar.ScalarValue( | 201 results.AddValue(scalar.ScalarValue( |
| 202 results.current_page, 'data_saving', 'percent', 0.0)) | 202 results.current_page, 'data_saving', 'percent', 0.0)) |
| OLD | NEW |