| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "net/spdy/spdy_buffer.h" | 5 #include "net/spdy/chromium/spdy_buffer.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 #include <cstring> | 8 #include <cstring> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "net/base/io_buffer.h" | 13 #include "net/base/io_buffer.h" |
| 14 #include "net/spdy/core/spdy_protocol.h" |
| 14 #include "net/spdy/platform/api/spdy_string.h" | 15 #include "net/spdy/platform/api/spdy_string.h" |
| 15 #include "net/spdy/spdy_protocol.h" | |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 17 | 17 |
| 18 namespace net { | 18 namespace net { |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 const char kData[] = "hello!\0hi."; | 22 const char kData[] = "hello!\0hi."; |
| 23 const size_t kDataSize = arraysize(kData); | 23 const size_t kDataSize = arraysize(kData); |
| 24 | 24 |
| 25 class SpdyBufferTest : public ::testing::Test {}; | 25 class SpdyBufferTest : public ::testing::Test {}; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 buffer.reset(); | 126 buffer.reset(); |
| 127 | 127 |
| 128 // This will cause a use-after-free error if |io_buffer| doesn't | 128 // This will cause a use-after-free error if |io_buffer| doesn't |
| 129 // outlive |buffer|. | 129 // outlive |buffer|. |
| 130 std::memcpy(io_buffer->data(), kData, kDataSize); | 130 std::memcpy(io_buffer->data(), kData, kDataSize); |
| 131 } | 131 } |
| 132 | 132 |
| 133 } // namespace | 133 } // namespace |
| 134 | 134 |
| 135 } // namespace net | 135 } // namespace net |
| OLD | NEW |