| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_SOCKET_API_H_ | |
| 6 #define CHROME_BROWSER_EXTENSIONS_SOCKET_API_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "chrome/browser/extensions/extension_function.h" | |
| 10 | |
| 11 namespace extensions { | |
| 12 | |
| 13 class SocketCreateFunction : public AsyncExtensionFunction { | |
| 14 public: | |
| 15 SocketCreateFunction(); | |
| 16 virtual ~SocketCreateFunction(); | |
| 17 virtual bool RunImpl() OVERRIDE; | |
| 18 | |
| 19 protected: | |
| 20 void WorkOnIOThread(); | |
| 21 void RespondOnUIThread(); | |
| 22 | |
| 23 DECLARE_EXTENSION_FUNCTION_NAME("experimental.socket.create") | |
| 24 }; | |
| 25 | |
| 26 class SocketConnectFunction : public AsyncExtensionFunction { | |
| 27 public: | |
| 28 SocketConnectFunction(); | |
| 29 virtual ~SocketConnectFunction(); | |
| 30 virtual bool RunImpl() OVERRIDE; | |
| 31 | |
| 32 protected: | |
| 33 void WorkOnIOThread(); | |
| 34 void RespondOnUIThread(); | |
| 35 | |
| 36 DECLARE_EXTENSION_FUNCTION_NAME("experimental.socket.connect") | |
| 37 }; | |
| 38 | |
| 39 class SocketDisconnectFunction : public AsyncExtensionFunction { | |
| 40 public: | |
| 41 SocketDisconnectFunction(); | |
| 42 virtual ~SocketDisconnectFunction(); | |
| 43 virtual bool RunImpl() OVERRIDE; | |
| 44 | |
| 45 protected: | |
| 46 void WorkOnIOThread(); | |
| 47 void RespondOnUIThread(); | |
| 48 | |
| 49 DECLARE_EXTENSION_FUNCTION_NAME("experimental.socket.disconnect") | |
| 50 }; | |
| 51 | |
| 52 class SocketSendFunction : public AsyncExtensionFunction { | |
| 53 public: | |
| 54 SocketSendFunction(); | |
| 55 virtual ~SocketSendFunction(); | |
| 56 virtual bool RunImpl() OVERRIDE; | |
| 57 | |
| 58 protected: | |
| 59 void WorkOnIOThread(); | |
| 60 void RespondOnUIThread(); | |
| 61 | |
| 62 DECLARE_EXTENSION_FUNCTION_NAME("experimental.socket.send") | |
| 63 }; | |
| 64 | |
| 65 } // namespace extensions | |
| 66 | |
| 67 #endif // CHROME_BROWSER_EXTENSIONS_SOCKET_API_H_ | |
| OLD | NEW |