1 // Copyright (c) 2013 Intel Corporation. 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.
5 #ifndef XWALK_SYSAPPS_RAW_SOCKET_RAW_SOCKET_EXTENSION_H_
6 #define XWALK_SYSAPPS_RAW_SOCKET_RAW_SOCKET_EXTENSION_H_
9 #include "base/values.h"
10 #include "xwalk/sysapps/common/binding_object_store.h"
15 using extensions::XWalkExtension;
16 using extensions::XWalkExtensionFunctionHandler;
17 using extensions::XWalkExtensionFunctionInfo;
18 using extensions::XWalkExtensionInstance;
20 class RawSocketExtension : public XWalkExtension {
23 virtual ~RawSocketExtension();
25 // XWalkExtension implementation.
26 virtual XWalkExtensionInstance* CreateInstance() OVERRIDE;
29 class RawSocketInstance : public XWalkExtensionInstance {
33 // XWalkExtensionInstance implementation.
34 virtual void HandleMessage(scoped_ptr<base::Value> msg) OVERRIDE;
36 void AddBindingObject(const std::string& object_id,
37 scoped_ptr<BindingObject> obj);
40 void OnTCPServerSocketConstructor(
41 scoped_ptr<XWalkExtensionFunctionInfo> info);
42 void OnTCPSocketConstructor(scoped_ptr<XWalkExtensionFunctionInfo> info);
43 void OnUDPSocketConstructor(scoped_ptr<XWalkExtensionFunctionInfo> info);
45 XWalkExtensionFunctionHandler handler_;
46 BindingObjectStore store_;
49 } // namespace sysapps
52 #endif // XWALK_SYSAPPS_RAW_SOCKET_RAW_SOCKET_EXTENSION_H_