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

Unified Diff: mojo/services/public/cpp/network/web_socket_read_queue.h

Issue 789243002: Restructure public side of network service. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Rebase Created 6 years 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
Index: mojo/services/public/cpp/network/web_socket_read_queue.h
diff --git a/mojo/services/public/cpp/network/web_socket_read_queue.h b/mojo/services/public/cpp/network/web_socket_read_queue.h
deleted file mode 100644
index 6108e49f9a40f528c2cde3b206cb52e5b78e8f4d..0000000000000000000000000000000000000000
--- a/mojo/services/public/cpp/network/web_socket_read_queue.h
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright 2014 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.
-
-#ifndef MOJO_SERVICES_PUBLIC_CPP_NETWORK_WEB_SOCKET_READ_QUEUE_H_
-#define MOJO_SERVICES_PUBLIC_CPP_NETWORK_WEB_SOCKET_READ_QUEUE_H_
-
-#include "base/callback.h"
-#include "base/memory/scoped_vector.h"
-#include "mojo/common/handle_watcher.h"
-#include "mojo/public/cpp/system/data_pipe.h"
-
-namespace mojo {
-
-// This class simplifies the handling of multiple Reads on a DataPipe. It reads
-// the data in the expected chunk size, calling the callback once a full chunk
-// is ready. Callbacks are owned by this class, and are guaranteed not to be
-// called after this class is destroyed.
-// See also: WebSocketWriteQueue
-class WebSocketReadQueue {
- public:
- WebSocketReadQueue(DataPipeConsumerHandle handle);
- ~WebSocketReadQueue();
-
- void Read(uint32_t num_bytes, base::Callback<void(const char*)> callback);
-
- private:
- struct Operation;
-
- void TryToRead();
- void Wait();
- void OnHandleReady(MojoResult result);
-
- DataPipeConsumerHandle handle_;
- common::HandleWatcher handle_watcher_;
- ScopedVector<Operation> queue_;
- bool is_waiting_;
-};
-
-} // namespace mojo
-
-#endif // MOJO_SERVICES_PUBLIC_CPP_NETWORK_WEB_SOCKET_READ_QUEUE_H_
« no previous file with comments | « mojo/services/public/cpp/network/udp_socket_wrapper.cc ('k') | mojo/services/public/cpp/network/web_socket_read_queue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698