Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Side by Side Diff: components/compression/compression_utils.cc

Issue 399313006: Move bit_cast from base/macros.h to its own header (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix chromeos compile after r368203 Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/compression/compression_utils.h" 5 #include "components/compression/compression_utils.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <string.h> 9 #include <string.h>
10 10
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/bit_cast.h"
13 #include "base/logging.h" 14 #include "base/logging.h"
14 #include "base/sys_byteorder.h" 15 #include "base/sys_byteorder.h"
15 #include "third_party/zlib/zlib.h" 16 #include "third_party/zlib/zlib.h"
16 17
17 namespace { 18 namespace {
18 19
19 // The difference in bytes between a zlib header and a gzip header. 20 // The difference in bytes between a zlib header and a gzip header.
20 const size_t kGzipZlibHeaderDifferenceBytes = 16; 21 const size_t kGzipZlibHeaderDifferenceBytes = 16;
21 22
22 // Pass an integer greater than the following get a gzip header instead of a 23 // Pass an integer greater than the following get a gzip header instead of a
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 &uncompressed_size, 156 &uncompressed_size,
156 bit_cast<const Bytef*>(input.data()), 157 bit_cast<const Bytef*>(input.data()),
157 static_cast<uLongf>(input.length())) == Z_OK) { 158 static_cast<uLongf>(input.length())) == Z_OK) {
158 output->swap(uncompressed_output); 159 output->swap(uncompressed_output);
159 return true; 160 return true;
160 } 161 }
161 return false; 162 return false;
162 } 163 }
163 164
164 } // namespace compression 165 } // namespace compression
OLDNEW
« no previous file with comments | « chromeos/hugepage_text/hugepage_text.cc ('k') | components/visitedlink/common/visitedlink_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698