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

Unified Diff: extensions/browser/api/socket/socket.h

Issue 183893041: Move sockets APIs out of src/chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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: extensions/browser/api/socket/socket.h
diff --git a/chrome/browser/extensions/api/socket/socket.h b/extensions/browser/api/socket/socket.h
similarity index 84%
rename from chrome/browser/extensions/api/socket/socket.h
rename to extensions/browser/api/socket/socket.h
index 2e73cb0d1fee27a496af8b9d77ca2f0a4391b8e5..df0588d71f91d3616154246214f3f02d8b2ac82e 100644
--- a/chrome/browser/extensions/api/socket/socket.h
+++ b/extensions/browser/api/socket/socket.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_EXTENSIONS_API_SOCKET_SOCKET_H_
-#define CHROME_BROWSER_EXTENSIONS_API_SOCKET_SOCKET_H_
+#ifndef EXTENSIONS_BROWSER_API_SOCKET_SOCKET_H_
+#define EXTENSIONS_BROWSER_API_SOCKET_SOCKET_H_
#include <queue>
#include <string>
@@ -30,19 +30,16 @@ typedef base::Callback<void(int)> CompletionCallback;
typedef base::Callback<void(int, scoped_refptr<net::IOBuffer> io_buffer)>
ReadCompletionCallback;
typedef base::Callback<
- void(int, scoped_refptr<net::IOBuffer> io_buffer, const std::string&, int)>
- RecvFromCompletionCallback;
-typedef base::Callback<
- void(int, net::TCPClientSocket*)> AcceptCompletionCallback;
+ void(int, scoped_refptr<net::IOBuffer> io_buffer, const std::string&, int)>
+ RecvFromCompletionCallback;
+typedef base::Callback<void(int, net::TCPClientSocket*)>
+ AcceptCompletionCallback;
// A Socket wraps a low-level socket and includes housekeeping information that
// we need to manage it in the context of an extension.
class Socket : public ApiResource {
public:
- enum SocketType {
- TYPE_TCP,
- TYPE_UDP,
- };
+ enum SocketType { TYPE_TCP, TYPE_UDP, };
virtual ~Socket();
virtual void Connect(const std::string& address,
@@ -53,8 +50,7 @@ class Socket : public ApiResource {
// The |callback| will be called with the number of bytes read into the
// buffer, or a negative number if an error occurred.
- virtual void Read(int count,
- const ReadCompletionCallback& callback) = 0;
+ virtual void Read(int count, const ReadCompletionCallback& callback) = 0;
// The |callback| will be called with |byte_count| or a negative number if an
// error occurred.
@@ -72,9 +68,11 @@ class Socket : public ApiResource {
virtual bool SetKeepAlive(bool enable, int delay);
virtual bool SetNoDelay(bool no_delay);
- virtual int Listen(const std::string& address, int port, int backlog,
+ virtual int Listen(const std::string& address,
+ int port,
+ int backlog,
std::string* error_msg);
- virtual void Accept(const AcceptCompletionCallback &callback);
+ virtual void Accept(const AcceptCompletionCallback& callback);
virtual bool IsConnected() = 0;
@@ -107,9 +105,7 @@ class Socket : public ApiResource {
private:
friend class ApiResourceManager<Socket>;
- static const char* service_name() {
- return "SocketManager";
- }
+ static const char* service_name() { return "SocketManager"; }
struct WriteRequest {
WriteRequest(scoped_refptr<net::IOBuffer> io_buffer,
@@ -127,4 +123,4 @@ class Socket : public ApiResource {
} // namespace extensions
-#endif // CHROME_BROWSER_EXTENSIONS_API_SOCKET_SOCKET_H_
+#endif // EXTENSIONS_BROWSER_API_SOCKET_SOCKET_H_

Powered by Google App Engine
This is Rietveld 408576698