diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-26 18:14:57 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-26 18:14:57 +0000 |
commit | d9806a97728e34d79a34d2d7a04dfa6048ad048c (patch) | |
tree | 8c71ff87111e177731fd02101f05bdd354cb336d /net/websockets | |
parent | 9ea8ec9f63db0b2473b4a84648cebce4e0bfcf93 (diff) | |
download | chromium_src-d9806a97728e34d79a34d2d7a04dfa6048ad048c.zip chromium_src-d9806a97728e34d79a34d2d7a04dfa6048ad048c.tar.gz chromium_src-d9806a97728e34d79a34d2d7a04dfa6048ad048c.tar.bz2 |
ui/base/resource: Remove dependency on net's big_endian implementation.
To remove this dependency we ended up moving big_endian* to base/, since besides ui/,
big_endian is also used by other top-level modules: chrome/utility/, cloud_print, media/cast
This way we removed one more net dependency from ui/base/.
BUG=299841
TEST=ui_unittests
R=tony@chromium.org,mark@chromium.org,hclam@chromium.org,vitalybuka@chromium.org
TBR=ben@chromium.org
Review URL: https://codereview.chromium.org/145873006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253510 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/websockets')
-rw-r--r-- | net/websockets/websocket_basic_stream_test.cc | 4 | ||||
-rw-r--r-- | net/websockets/websocket_channel.cc | 6 | ||||
-rw-r--r-- | net/websockets/websocket_frame.cc | 6 | ||||
-rw-r--r-- | net/websockets/websocket_frame_parser.cc | 6 |
4 files changed, 11 insertions, 11 deletions
diff --git a/net/websockets/websocket_basic_stream_test.cc b/net/websockets/websocket_basic_stream_test.cc index 4dcb8e2..71af079 100644 --- a/net/websockets/websocket_basic_stream_test.cc +++ b/net/websockets/websocket_basic_stream_test.cc @@ -13,8 +13,8 @@ #include <string> #include "base/basictypes.h" +#include "base/big_endian.h" #include "base/port.h" -#include "net/base/big_endian.h" #include "net/base/capturing_net_log.h" #include "net/base/test_completion_callback.h" #include "net/socket/socket_test_util.h" @@ -803,7 +803,7 @@ TEST_F(WebSocketBasicStreamSocketChunkedReadTest, OneMegFrame) { (kWireSize + kReadBufferSize - 1) / kReadBufferSize; scoped_ptr<char[]> big_frame(new char[kWireSize]); memcpy(big_frame.get(), "\x81\x7F", 2); - WriteBigEndian(big_frame.get() + 2, kPayloadSize); + base::WriteBigEndian(big_frame.get() + 2, kPayloadSize); memset(big_frame.get() + kLargeFrameHeaderSize, 'A', kPayloadSize); CreateChunkedRead(ASYNC, diff --git a/net/websockets/websocket_channel.cc b/net/websockets/websocket_channel.cc index 96d0b76..e1d478f89 100644 --- a/net/websockets/websocket_channel.cc +++ b/net/websockets/websocket_channel.cc @@ -7,6 +7,7 @@ #include <algorithm> #include "base/basictypes.h" // for size_t +#include "base/big_endian.h" #include "base/bind.h" #include "base/compiler_specific.h" #include "base/memory/weak_ptr.h" @@ -15,7 +16,6 @@ #include "base/stl_util.h" #include "base/strings/stringprintf.h" #include "base/time/time.h" -#include "net/base/big_endian.h" #include "net/base/io_buffer.h" #include "net/base/net_log.h" #include "net/http/http_request_headers.h" @@ -878,7 +878,7 @@ ChannelState WebSocketChannel::SendClose(uint16 code, const size_t payload_length = kWebSocketCloseCodeLength + reason.length(); body = new IOBuffer(payload_length); size = payload_length; - WriteBigEndian(body->data(), code); + base::WriteBigEndian(body->data(), code); COMPILE_ASSERT(sizeof(code) == kWebSocketCloseCodeLength, they_should_both_be_two); std::copy( @@ -921,7 +921,7 @@ bool WebSocketChannel::ParseClose(const scoped_refptr<IOBuffer>& buffer, } const char* data = buffer->data(); uint16 unchecked_code = 0; - ReadBigEndian(data, &unchecked_code); + base::ReadBigEndian(data, &unchecked_code); COMPILE_ASSERT(sizeof(unchecked_code) == kWebSocketCloseCodeLength, they_should_both_be_two_bytes); switch (unchecked_code) { diff --git a/net/websockets/websocket_frame.cc b/net/websockets/websocket_frame.cc index 763712a..6fe972b 100644 --- a/net/websockets/websocket_frame.cc +++ b/net/websockets/websocket_frame.cc @@ -7,9 +7,9 @@ #include <algorithm> #include "base/basictypes.h" +#include "base/big_endian.h" #include "base/logging.h" #include "base/rand_util.h" -#include "net/base/big_endian.h" #include "net/base/io_buffer.h" #include "net/base/net_errors.h" @@ -131,10 +131,10 @@ int WriteWebSocketFrameHeader(const WebSocketFrameHeader& header, // Writes "extended payload length" field. if (extended_length_size == 2) { uint16 payload_length_16 = static_cast<uint16>(header.payload_length); - WriteBigEndian(buffer + buffer_index, payload_length_16); + base::WriteBigEndian(buffer + buffer_index, payload_length_16); buffer_index += sizeof(payload_length_16); } else if (extended_length_size == 8) { - WriteBigEndian(buffer + buffer_index, header.payload_length); + base::WriteBigEndian(buffer + buffer_index, header.payload_length); buffer_index += sizeof(header.payload_length); } diff --git a/net/websockets/websocket_frame_parser.cc b/net/websockets/websocket_frame_parser.cc index 3b19912..2e4c58f 100644 --- a/net/websockets/websocket_frame_parser.cc +++ b/net/websockets/websocket_frame_parser.cc @@ -8,11 +8,11 @@ #include <limits> #include "base/basictypes.h" +#include "base/big_endian.h" #include "base/logging.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" -#include "net/base/big_endian.h" #include "net/base/io_buffer.h" #include "net/websockets/websocket_frame.h" @@ -124,7 +124,7 @@ void WebSocketFrameParser::DecodeFrameHeader() { if (end - current < 2) return; uint16 payload_length_16; - ReadBigEndian(current, &payload_length_16); + base::ReadBigEndian(current, &payload_length_16); current += 2; payload_length = payload_length_16; if (payload_length <= kMaxPayloadLengthWithoutExtendedLengthField) @@ -132,7 +132,7 @@ void WebSocketFrameParser::DecodeFrameHeader() { } else if (payload_length == kPayloadLengthWithEightByteExtendedLengthField) { if (end - current < 8) return; - ReadBigEndian(current, &payload_length); + base::ReadBigEndian(current, &payload_length); current += 8; if (payload_length <= kuint16max || payload_length > static_cast<uint64>(kint64max)) { |