• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
2 // reserved. Use of this source code is governed by a BSD-style license that
3 // can be found in the LICENSE file.
4 //
5 // ---------------------------------------------------------------------------
6 //
7 // This file was generated by the CEF translator tool. If making changes by
8 // hand only do so within the body of existing method and function
9 // implementations. See the translator.README.txt file in the tools directory
10 // for more information.
11 //
12 // $hash=b9b38b204c2b9d385ebefb11aa0b45efcd684cbc$
13 //
14 
15 #ifndef CEF_LIBCEF_DLL_CTOCPP_SERVER_HANDLER_CTOCPP_H_
16 #define CEF_LIBCEF_DLL_CTOCPP_SERVER_HANDLER_CTOCPP_H_
17 #pragma once
18 
19 #if !defined(BUILDING_CEF_SHARED)
20 #error This file can be included DLL-side only
21 #endif
22 
23 #include "include/capi/cef_server_capi.h"
24 #include "include/cef_server.h"
25 #include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
26 
27 // Wrap a C structure with a C++ class.
28 // This class may be instantiated and accessed DLL-side only.
29 class CefServerHandlerCToCpp
30     : public CefCToCppRefCounted<CefServerHandlerCToCpp,
31                                  CefServerHandler,
32                                  cef_server_handler_t> {
33  public:
34   CefServerHandlerCToCpp();
35   virtual ~CefServerHandlerCToCpp();
36 
37   // CefServerHandler methods.
38   void OnServerCreated(CefRefPtr<CefServer> server) override;
39   void OnServerDestroyed(CefRefPtr<CefServer> server) override;
40   void OnClientConnected(CefRefPtr<CefServer> server,
41                          int connection_id) override;
42   void OnClientDisconnected(CefRefPtr<CefServer> server,
43                             int connection_id) override;
44   void OnHttpRequest(CefRefPtr<CefServer> server,
45                      int connection_id,
46                      const CefString& client_address,
47                      CefRefPtr<CefRequest> request) override;
48   void OnWebSocketRequest(CefRefPtr<CefServer> server,
49                           int connection_id,
50                           const CefString& client_address,
51                           CefRefPtr<CefRequest> request,
52                           CefRefPtr<CefCallback> callback) override;
53   void OnWebSocketConnected(CefRefPtr<CefServer> server,
54                             int connection_id) override;
55   void OnWebSocketMessage(CefRefPtr<CefServer> server,
56                           int connection_id,
57                           const void* data,
58                           size_t data_size) override;
59 };
60 
61 #endif  // CEF_LIBCEF_DLL_CTOCPP_SERVER_HANDLER_CTOCPP_H_
62