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

Unified Diff: content/network/net_adapters.cc

Issue 2906543002: Add support for reading blobs when using the network service. (Closed)
Patch Set: fix threading issue with weakptr Created 3 years, 6 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 | « content/network/net_adapters.h ('k') | content/network/url_loader_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/network/net_adapters.cc
diff --git a/content/network/net_adapters.cc b/content/network/net_adapters.cc
deleted file mode 100644
index ee0bc33b8fbf5329721cdeea3895a3d9fa3e80ee..0000000000000000000000000000000000000000
--- a/content/network/net_adapters.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright 2017 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/network/net_adapters.h"
-
-#include "net/base/net_errors.h"
-
-namespace content {
-
-namespace {
-const uint32_t kMaxBufSize = 64 * 1024;
-}
-
-NetToMojoPendingBuffer::NetToMojoPendingBuffer(
- mojo::ScopedDataPipeProducerHandle handle,
- void* buffer)
- : handle_(std::move(handle)), buffer_(buffer) {}
-
-NetToMojoPendingBuffer::~NetToMojoPendingBuffer() {
- if (handle_.is_valid())
- EndWriteDataRaw(handle_.get(), 0);
-}
-
-MojoResult NetToMojoPendingBuffer::BeginWrite(
- mojo::ScopedDataPipeProducerHandle* handle,
- scoped_refptr<NetToMojoPendingBuffer>* pending,
- uint32_t* num_bytes) {
- void* buf;
- *num_bytes = 0;
- MojoResult result = BeginWriteDataRaw(handle->get(), &buf, num_bytes,
- MOJO_WRITE_DATA_FLAG_NONE);
- if (result == MOJO_RESULT_OK) {
- if (*num_bytes > kMaxBufSize)
- *num_bytes = kMaxBufSize;
- *pending = new NetToMojoPendingBuffer(std::move(*handle), buf);
- }
- return result;
-}
-
-mojo::ScopedDataPipeProducerHandle NetToMojoPendingBuffer::Complete(
- uint32_t num_bytes) {
- EndWriteDataRaw(handle_.get(), num_bytes);
- buffer_ = NULL;
- return std::move(handle_);
-}
-
-NetToMojoIOBuffer::NetToMojoIOBuffer(NetToMojoPendingBuffer* pending_buffer)
- : net::WrappedIOBuffer(pending_buffer->buffer()),
- pending_buffer_(pending_buffer) {}
-
-NetToMojoIOBuffer::~NetToMojoIOBuffer() {}
-
-} // namespace content
« no previous file with comments | « content/network/net_adapters.h ('k') | content/network/url_loader_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698