remote/gen-cpp/ClientHandlers_server.skeleton.cpp (245 lines of code) (raw):
// This autogenerated skeleton file illustrates how to build a server.
// You should copy it to another filename to avoid overwriting it.
#include "ClientHandlers.h"
#include <thrift/protocol/TBinaryProtocol.h>
#include <thrift/server/TSimpleServer.h>
#include <thrift/transport/TServerSocket.h>
#include <thrift/transport/TBufferTransports.h>
using namespace ::apache::thrift;
using namespace ::apache::thrift::protocol;
using namespace ::apache::thrift::transport;
using namespace ::apache::thrift::server;
using namespace ::thrift_codegen;
class ClientHandlersHandler : virtual public ClientHandlersIf {
public:
ClientHandlersHandler() {
// Your initialization goes here
}
void echo(std::string& _return, const std::string& msg) {
// Your implementation goes here
printf("echo\n");
}
void log(const std::string& msg) {
// Your implementation goes here
printf("log\n");
}
void AppHandler_OnContextInitialized() {
// Your implementation goes here
printf("AppHandler_OnContextInitialized\n");
}
void RenderHandler_GetViewRect(Rect& _return, const int32_t bid) {
// Your implementation goes here
printf("RenderHandler_GetViewRect\n");
}
void RenderHandler_GetScreenInfo(ScreenInfo& _return, const int32_t bid) {
// Your implementation goes here
printf("RenderHandler_GetScreenInfo\n");
}
void RenderHandler_GetScreenPoint(Point& _return, const int32_t bid, const int32_t viewX, const int32_t viewY) {
// Your implementation goes here
printf("RenderHandler_GetScreenPoint\n");
}
void RenderHandler_OnPaint(const int32_t bid, const bool popup, const int32_t dirtyRectsCount, const std::string& sharedMemName, const int64_t sharedMemHandle, const int32_t width, const int32_t height) {
// Your implementation goes here
printf("RenderHandler_OnPaint\n");
}
void RenderHandler_OnPopupShow(const int32_t bid, const bool show) {
// Your implementation goes here
printf("RenderHandler_OnPopupShow\n");
}
void RenderHandler_OnPopupSize(const int32_t bid, const Rect& rect) {
// Your implementation goes here
printf("RenderHandler_OnPopupSize\n");
}
void RenderHandler_OnImeCompositionRangeChanged(const int32_t bid, const ::thrift_codegen::Range& selectionRange, const std::vector<Rect> & characterBounds) {
// Your implementation goes here
printf("RenderHandler_OnImeCompositionRangeChanged\n");
}
void RenderHandler_OnTextSelectionChanged(const int32_t bid, const std::string& selectedText, const ::thrift_codegen::Range& selectionRange) {
// Your implementation goes here
printf("RenderHandler_OnTextSelectionChanged\n");
}
bool LifeSpanHandler_OnBeforePopup(const int32_t bid, const ::thrift_codegen::RObject& frame, const std::string& url, const std::string& frameName, const bool gesture) {
// Your implementation goes here
printf("LifeSpanHandler_OnBeforePopup\n");
}
void LifeSpanHandler_OnAfterCreated(const int32_t bid, const int32_t nativeBrowserIdentifier) {
// Your implementation goes here
printf("LifeSpanHandler_OnAfterCreated\n");
}
bool LifeSpanHandler_DoClose(const int32_t bid) {
// Your implementation goes here
printf("LifeSpanHandler_DoClose\n");
}
void LifeSpanHandler_OnBeforeClose(const int32_t bid) {
// Your implementation goes here
printf("LifeSpanHandler_OnBeforeClose\n");
}
void LoadHandler_OnLoadingStateChange(const int32_t bid, const bool isLoading, const bool canGoBack, const bool canGoForward) {
// Your implementation goes here
printf("LoadHandler_OnLoadingStateChange\n");
}
void LoadHandler_OnLoadStart(const int32_t bid, const ::thrift_codegen::RObject& frame, const int32_t transition_type) {
// Your implementation goes here
printf("LoadHandler_OnLoadStart\n");
}
void LoadHandler_OnLoadEnd(const int32_t bid, const ::thrift_codegen::RObject& frame, const int32_t httpStatusCode) {
// Your implementation goes here
printf("LoadHandler_OnLoadEnd\n");
}
void LoadHandler_OnLoadError(const int32_t bid, const ::thrift_codegen::RObject& frame, const int32_t errorCode, const std::string& errorText, const std::string& failedUrl) {
// Your implementation goes here
printf("LoadHandler_OnLoadError\n");
}
void DisplayHandler_OnAddressChange(const int32_t bid, const ::thrift_codegen::RObject& frame, const std::string& url) {
// Your implementation goes here
printf("DisplayHandler_OnAddressChange\n");
}
void DisplayHandler_OnTitleChange(const int32_t bid, const std::string& title) {
// Your implementation goes here
printf("DisplayHandler_OnTitleChange\n");
}
bool DisplayHandler_OnTooltip(const int32_t bid, const std::string& text) {
// Your implementation goes here
printf("DisplayHandler_OnTooltip\n");
}
void DisplayHandler_OnStatusMessage(const int32_t bid, const std::string& value) {
// Your implementation goes here
printf("DisplayHandler_OnStatusMessage\n");
}
bool DisplayHandler_OnConsoleMessage(const int32_t bid, const std::string& level, const std::string& message, const std::string& source, const int32_t line) {
// Your implementation goes here
printf("DisplayHandler_OnConsoleMessage\n");
}
bool KeyboardHandler_OnPreKeyEvent(const int32_t bid, const ::thrift_codegen::KeyEvent& event) {
// Your implementation goes here
printf("KeyboardHandler_OnPreKeyEvent\n");
}
bool KeyboardHandler_OnKeyEvent(const int32_t bid, const ::thrift_codegen::KeyEvent& event) {
// Your implementation goes here
printf("KeyboardHandler_OnKeyEvent\n");
}
void FocusHandler_OnTakeFocus(const int32_t bid, const bool next) {
// Your implementation goes here
printf("FocusHandler_OnTakeFocus\n");
}
bool FocusHandler_OnSetFocus(const int32_t bid, const std::string& source) {
// Your implementation goes here
printf("FocusHandler_OnSetFocus\n");
}
void FocusHandler_OnGotFocus(const int32_t bid) {
// Your implementation goes here
printf("FocusHandler_OnGotFocus\n");
}
bool RequestHandler_OnBeforeBrowse(const int32_t bid, const ::thrift_codegen::RObject& frame, const ::thrift_codegen::RObject& request, const bool user_gesture, const bool is_redirect) {
// Your implementation goes here
printf("RequestHandler_OnBeforeBrowse\n");
}
bool RequestHandler_OnOpenURLFromTab(const int32_t bid, const ::thrift_codegen::RObject& frame, const std::string& target_url, const bool user_gesture) {
// Your implementation goes here
printf("RequestHandler_OnOpenURLFromTab\n");
}
bool RequestHandler_GetAuthCredentials(const int32_t bid, const std::string& origin_url, const bool isProxy, const std::string& host, const int32_t port, const std::string& realm, const std::string& scheme, const ::thrift_codegen::RObject& authCallback) {
// Your implementation goes here
printf("RequestHandler_GetAuthCredentials\n");
}
bool RequestHandler_OnCertificateError(const int32_t bid, const std::string& cert_error, const std::string& request_url, const std::string& sslInfo, const ::thrift_codegen::RObject& callback) {
// Your implementation goes here
printf("RequestHandler_OnCertificateError\n");
}
void RequestHandler_OnRenderProcessTerminated(const int32_t bid, const std::string& status, const int32_t errCode, const std::string& errText) {
// Your implementation goes here
printf("RequestHandler_OnRenderProcessTerminated\n");
}
void RequestHandler_GetResourceRequestHandler( ::thrift_codegen::RObject& _return, const int32_t bid, const ::thrift_codegen::RObject& frame, const ::thrift_codegen::RObject& request, const bool isNavigation, const bool isDownload, const std::string& requestInitiator) {
// Your implementation goes here
printf("RequestHandler_GetResourceRequestHandler\n");
}
void ResourceRequestHandler_Dispose(const int32_t rrHandler) {
// Your implementation goes here
printf("ResourceRequestHandler_Dispose\n");
}
void ResourceRequestHandler_GetCookieAccessFilter( ::thrift_codegen::RObject& _return, const int32_t rrHandler, const int32_t bid, const ::thrift_codegen::RObject& frame, const ::thrift_codegen::RObject& request) {
// Your implementation goes here
printf("ResourceRequestHandler_GetCookieAccessFilter\n");
}
void CookieAccessFilter_Dispose(const int32_t filter) {
// Your implementation goes here
printf("CookieAccessFilter_Dispose\n");
}
bool CookieAccessFilter_CanSendCookie(const int32_t filter, const int32_t bid, const ::thrift_codegen::RObject& frame, const ::thrift_codegen::RObject& request, const std::vector<std::string> & cookie) {
// Your implementation goes here
printf("CookieAccessFilter_CanSendCookie\n");
}
bool CookieAccessFilter_CanSaveCookie(const int32_t filter, const int32_t bid, const ::thrift_codegen::RObject& frame, const ::thrift_codegen::RObject& request, const ::thrift_codegen::RObject& response, const std::vector<std::string> & cookie) {
// Your implementation goes here
printf("CookieAccessFilter_CanSaveCookie\n");
}
bool ResourceRequestHandler_OnBeforeResourceLoad(const int32_t rrHandler, const int32_t bid, const ::thrift_codegen::RObject& frame, const ::thrift_codegen::RObject& request) {
// Your implementation goes here
printf("ResourceRequestHandler_OnBeforeResourceLoad\n");
}
void ResourceRequestHandler_GetResourceHandler( ::thrift_codegen::RObject& _return, const int32_t rrHandler, const int32_t bid, const ::thrift_codegen::RObject& frame, const ::thrift_codegen::RObject& request) {
// Your implementation goes here
printf("ResourceRequestHandler_GetResourceHandler\n");
}
void ResourceHandler_Dispose(const int32_t resourceHandler) {
// Your implementation goes here
printf("ResourceHandler_Dispose\n");
}
bool ResourceHandler_ProcessRequest(const int32_t resourceHandler, const ::thrift_codegen::RObject& request, const ::thrift_codegen::RObject& callback) {
// Your implementation goes here
printf("ResourceHandler_ProcessRequest\n");
}
void ResourceHandler_GetResponseHeaders( ::thrift_codegen::ResponseHeaders& _return, const int32_t resourceHandler, const ::thrift_codegen::RObject& response) {
// Your implementation goes here
printf("ResourceHandler_GetResponseHeaders\n");
}
void ResourceHandler_ReadResponse( ::thrift_codegen::ResponseData& _return, const int32_t resourceHandler, const int32_t bytes_to_read, const ::thrift_codegen::RObject& callback) {
// Your implementation goes here
printf("ResourceHandler_ReadResponse\n");
}
void ResourceHandler_Cancel(const int32_t resourceHandler) {
// Your implementation goes here
printf("ResourceHandler_Cancel\n");
}
void ResourceRequestHandler_OnResourceRedirect(std::string& _return, const int32_t rrHandler, const int32_t bid, const ::thrift_codegen::RObject& frame, const ::thrift_codegen::RObject& request, const ::thrift_codegen::RObject& response, const std::string& new_url) {
// Your implementation goes here
printf("ResourceRequestHandler_OnResourceRedirect\n");
}
bool ResourceRequestHandler_OnResourceResponse(const int32_t rrHandler, const int32_t bid, const ::thrift_codegen::RObject& frame, const ::thrift_codegen::RObject& request, const ::thrift_codegen::RObject& response) {
// Your implementation goes here
printf("ResourceRequestHandler_OnResourceResponse\n");
}
void ResourceRequestHandler_OnResourceLoadComplete(const int32_t rrHandler, const int32_t bid, const ::thrift_codegen::RObject& frame, const ::thrift_codegen::RObject& request, const ::thrift_codegen::RObject& response, const std::string& status, const int64_t receivedContentLength) {
// Your implementation goes here
printf("ResourceRequestHandler_OnResourceLoadComplete\n");
}
bool ResourceRequestHandler_OnProtocolExecution(const int32_t rrHandler, const int32_t bid, const ::thrift_codegen::RObject& frame, const ::thrift_codegen::RObject& request, const bool allowOsExecution) {
// Your implementation goes here
printf("ResourceRequestHandler_OnProtocolExecution\n");
}
void ContextMenuHandler_OnBeforeContextMenu(std::vector<MenuItem> & _return, const int32_t bid, const ::thrift_codegen::RObject& frame, const ContextMenuParams& params, const std::vector<MenuItem> & menu_model) {
// Your implementation goes here
printf("ContextMenuHandler_OnBeforeContextMenu\n");
}
bool ContextMenuHandler_RunContextMenu(const int32_t bid, const ::thrift_codegen::RObject& frame, const ContextMenuParams& params, const std::vector<MenuItem> & model, const ::thrift_codegen::RObject& callback) {
// Your implementation goes here
printf("ContextMenuHandler_RunContextMenu\n");
}
bool ContextMenuHandler_OnContextMenuCommand(const int32_t bid, const ::thrift_codegen::RObject& frame, const ContextMenuParams& params, const int32_t command_id, const int32_t event_flags) {
// Your implementation goes here
printf("ContextMenuHandler_OnContextMenuCommand\n");
}
void ContextMenuHandler_OnContextMenuDismissed(const int32_t bid, const ::thrift_codegen::RObject& frame) {
// Your implementation goes here
printf("ContextMenuHandler_OnContextMenuDismissed\n");
}
bool MessageRouterHandler_onQuery(const ::thrift_codegen::RObject& handler, const int32_t bid, const ::thrift_codegen::RObject& frame, const int64_t queryId, const std::string& request, const bool persistent, const ::thrift_codegen::RObject& queryCallback) {
// Your implementation goes here
printf("MessageRouterHandler_onQuery\n");
}
void MessageRouterHandler_onQueryCanceled(const ::thrift_codegen::RObject& handler, const int32_t bid, const ::thrift_codegen::RObject& frame, const int64_t queryId) {
// Your implementation goes here
printf("MessageRouterHandler_onQueryCanceled\n");
}
void MessageRouterHandler_Dispose(const int32_t handler) {
// Your implementation goes here
printf("MessageRouterHandler_Dispose\n");
}
void SchemeHandlerFactory_CreateHandler( ::thrift_codegen::RObject& _return, const int32_t schemeHandlerFactory, const int32_t bid, const ::thrift_codegen::RObject& frame, const std::string& scheme_name, const ::thrift_codegen::RObject& request) {
// Your implementation goes here
printf("SchemeHandlerFactory_CreateHandler\n");
}
void SchemeHandlerFactory_Dispose(const int32_t schemeHandlerFactory) {
// Your implementation goes here
printf("SchemeHandlerFactory_Dispose\n");
}
void CompletionCallback_OnComplete(const int32_t completionCallback) {
// Your implementation goes here
printf("CompletionCallback_OnComplete\n");
}
void IntCallback_OnComplete(const int32_t intCallback, const int32_t result) {
// Your implementation goes here
printf("IntCallback_OnComplete\n");
}
void RequestContextHandler_GetResourceRequestHandler( ::thrift_codegen::RObject& _return, const int32_t handler, const int32_t bid, const ::thrift_codegen::RObject& frame, const ::thrift_codegen::RObject& request, const bool isNavigation, const bool isDownload, const std::string& requestInitiator) {
// Your implementation goes here
printf("RequestContextHandler_GetResourceRequestHandler\n");
}
bool CookieVisitor_Visit(const int32_t visitor, const ::thrift_codegen::Cookie& cookie, const int32_t count, const int32_t total) {
// Your implementation goes here
printf("CookieVisitor_Visit\n");
}
void CookieVisitor_Dispose(const int32_t visitor) {
// Your implementation goes here
printf("CookieVisitor_Dispose\n");
}
void StringVisitor_Visit(const int32_t stringVisitor, const std::string& str) {
// Your implementation goes here
printf("StringVisitor_Visit\n");
}
void StringVisitor_Dispose(const int32_t stringVisitor) {
// Your implementation goes here
printf("StringVisitor_Dispose\n");
}
void DevToolsMessageObserver_Dispose(const int32_t observer) {
// Your implementation goes here
printf("DevToolsMessageObserver_Dispose\n");
}
void DevToolsMessageObserver_OnDevToolsMethodResult(const int32_t observer, const int32_t bid, const int32_t messageId, const bool success, const std::string& result) {
// Your implementation goes here
printf("DevToolsMessageObserver_OnDevToolsMethodResult\n");
}
void DevToolsMessageObserver_OnDevToolsEvent(const int32_t observer, const int32_t bid, const std::string& method, const std::string& parameters) {
// Your implementation goes here
printf("DevToolsMessageObserver_OnDevToolsEvent\n");
}
bool PermissionHandler_OnRequestMediaAccessPermission(const int32_t bid, const ::thrift_codegen::RObject& frame, const std::string& requesting_origin, const int32_t requested_permissions, const ::thrift_codegen::RObject& mediaAccessCallback) {
// Your implementation goes here
printf("PermissionHandler_OnRequestMediaAccessPermission\n");
}
void PdfPrintCallback_OnPdfPrintFinished(const int32_t pdfPrintCallback, const std::string& path, const bool ok) {
// Your implementation goes here
printf("PdfPrintCallback_OnPdfPrintFinished\n");
}
void RunFileDialogCallback_OnFileDialogDismissed(const int32_t runFileDialogCallback, const std::vector<std::string> & filePaths) {
// Your implementation goes here
printf("RunFileDialogCallback_OnFileDialogDismissed\n");
}
};
int main(int argc, char **argv) {
int port = 9090;
::std::shared_ptr<ClientHandlersHandler> handler(new ClientHandlersHandler());
::std::shared_ptr<TProcessor> processor(new ClientHandlersProcessor(handler));
::std::shared_ptr<TServerTransport> serverTransport(new TServerSocket(port));
::std::shared_ptr<TTransportFactory> transportFactory(new TBufferedTransportFactory());
::std::shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());
TSimpleServer server(processor, serverTransport, transportFactory, protocolFactory);
server.serve();
return 0;
}