client_win.h (1052B)
1 // Copyright 2022 The Chromium Authors. 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 CONTENT_ANALYSIS_BROWSER_SRC_CLIENT_WIN_H_ 6 #define CONTENT_ANALYSIS_BROWSER_SRC_CLIENT_WIN_H_ 7 8 #include <string> 9 10 #include "client_base.h" 11 12 namespace content_analysis { 13 namespace sdk { 14 15 // Client implementaton for Windows. 16 class ClientWin : public ClientBase { 17 public: 18 ClientWin(Config config, int* rc); 19 ~ClientWin() override; 20 21 // Client: 22 int Send(ContentAnalysisRequest request, 23 ContentAnalysisResponse* response) override; 24 int Acknowledge(const ContentAnalysisAcknowledgement& ack) override; 25 int CancelRequests(const ContentAnalysisCancelRequests& cancel) override; 26 27 private: 28 static DWORD ConnectToPipe(const std::string& pipename, HANDLE* handle); 29 30 // Performs a clean shutdown of the client. 31 void Shutdown(); 32 33 HANDLE hPipe_ = INVALID_HANDLE_VALUE; 34 }; 35 36 } // namespace sdk 37 } // namespace content_analysis 38 39 #endif // CONTENT_ANALYSIS_BROWSER_SRC_CLIENT_WIN_H_