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

Unified Diff: base/big_endian.h

Issue 145873006: ui/base/resource: Roll our own version of ReadBigEndian() function. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/base.gypi ('k') | base/big_endian.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/big_endian.h
diff --git a/net/base/big_endian.h b/base/big_endian.h
similarity index 88%
rename from net/base/big_endian.h
rename to base/big_endian.h
index 911f3c5074d5664943fd5a4c22008597f7c9dc7d..bd51ce9104c8253a46b976a2dcd3a4fcfef098d3 100644
--- a/net/base/big_endian.h
+++ b/base/big_endian.h
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef NET_BASE_BIG_ENDIAN_H_
-#define NET_BASE_BIG_ENDIAN_H_
+#ifndef BASE_BIG_ENDIAN_H_
+#define BASE_BIG_ENDIAN_H_
+#include "base/base_export.h"
#include "base/basictypes.h"
#include "base/strings/string_piece.h"
-#include "net/base/net_export.h"
-namespace net {
+namespace base {
// Read an integer (signed or unsigned) from |buf| in Big Endian order.
// Note: this loop is unrolled with -O1 and above.
@@ -49,9 +49,9 @@ inline void WriteBigEndian<uint8>(char buf[], uint8 val) {
// Allows reading integers in network order (big endian) while iterating over
// an underlying buffer. All the reading functions advance the internal pointer.
-class NET_EXPORT BigEndianReader {
+class BASE_EXPORT BigEndianReader {
public:
- BigEndianReader(const void* buf, size_t len);
+ BigEndianReader(const char* buf, size_t len);
const char* ptr() const { return ptr_; }
int remaining() const { return end_ - ptr_; }
@@ -75,9 +75,9 @@ class NET_EXPORT BigEndianReader {
// Allows writing integers in network order (big endian) while iterating over
// an underlying buffer. All the writing functions advance the internal pointer.
-class NET_EXPORT BigEndianWriter {
+class BASE_EXPORT BigEndianWriter {
public:
- BigEndianWriter(void* buf, size_t len);
+ BigEndianWriter(char* buf, size_t len);
char* ptr() const { return ptr_; }
int remaining() const { return end_ - ptr_; }
@@ -97,7 +97,6 @@ class NET_EXPORT BigEndianWriter {
char* end_;
};
-} // namespace net
-
-#endif // NET_BASE_BIG_ENDIAN_H_
+} // namespace base
+#endif // BASE_BIG_ENDIAN_H_
« no previous file with comments | « base/base.gypi ('k') | base/big_endian.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698