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

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

Issue 1873463003: Remove mojo network service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
Index: mojo/services/network/public/cpp/web_socket_write_queue.h
diff --git a/mojo/services/network/public/cpp/web_socket_write_queue.h b/mojo/services/network/public/cpp/web_socket_write_queue.h
deleted file mode 100644
index fe513aa40c9a9b632a78801dfa032566ad941b3e..0000000000000000000000000000000000000000
--- a/mojo/services/network/public/cpp/web_socket_write_queue.h
+++ /dev/null
@@ -1,48 +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_NETWORK_PUBLIC_CPP_WEB_SOCKET_WRITE_QUEUE_H_
-#define MOJO_SERVICES_NETWORK_PUBLIC_CPP_WEB_SOCKET_WRITE_QUEUE_H_
-
-#include <stdint.h>
-
-#include "base/callback.h"
-#include "base/memory/scoped_vector.h"
-#include "base/memory/weak_ptr.h"
-#include "mojo/message_pump/handle_watcher.h"
-#include "mojo/public/cpp/system/data_pipe.h"
-
-namespace mojo {
-
-// This class simplifies the handling of multiple Writes on a DataPipe. It
-// writes each chunk all at once (or waits until the pipe is ready before
-// writing), calling the callback when finished. Callbacks are owned by this
-// class, and are guaranteed not to be called after this class is destroyed.
-// See also: WebSocketReadQueue
-class WebSocketWriteQueue {
- public:
- explicit WebSocketWriteQueue(DataPipeProducerHandle handle);
- ~WebSocketWriteQueue();
-
- void Write(const char* data,
- uint32_t num_bytes,
- base::Callback<void(const char*)> callback);
-
- private:
- struct Operation;
-
- void TryToWrite();
- void Wait();
- void OnHandleReady(MojoResult result);
-
- DataPipeProducerHandle handle_;
- common::HandleWatcher handle_watcher_;
- ScopedVector<Operation> queue_;
- bool is_busy_;
- base::WeakPtrFactory<WebSocketWriteQueue> weak_factory_;
-};
-
-} // namespace mojo
-
-#endif // MOJO_SERVICES_NETWORK_PUBLIC_CPP_WEB_SOCKET_WRITE_QUEUE_H_
« no previous file with comments | « mojo/services/network/public/cpp/web_socket_read_queue.cc ('k') | mojo/services/network/public/cpp/web_socket_write_queue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698