SHARE
TWEET
Untitled
a guest
Apr 25th, 2019
17
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- /*
- * Copyright (C) 2019 Haiku, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
- #include "config.h"
- #include "ProcessLauncher.h"
- #include "WebProcessMainUnix.h"
- #include <cstdlib>
- #include<Application.h>
- #include<Message.h>
- using namespace WebCore;
- namespace WebKit {
- class WebProcessDispatch : public BApplication
- {
- public:
- WebProcessDispatch();
- int Dispatch(int32 argc,char** argv);
- void MessageReceived(BMessage* msg);
- void ReadyToRun();
- void ArgvReceived(int32 argc,char** argv);
- private:
- int32 m_argc;
- char** m_argv;
- };
- WebProcessDispatch::WebProcessDispatch()
- :BApplication("application/x-vnd.lh-WebProcess")
- {
- }
- void WebProcessDispatch::MessageReceived(BMessage* msg)
- {
- switch(msg->what)
- {
- default:
- {
- BApplication::MessageReceived(msg);
- break;
- }
- }
- }
- void WebProcessDispatch::ArgvReceived(int32 argc, char** argv)
- {
- m_argc = argc;
- m_argv = argv;
- }
- void WebProcessDispatch::ReadyToRun()
- {
- int status = Dispatch(m_argc,m_argv);
- }
- int WebProcessDispatch::Dispatch(int32 argc, char** argv)
- {
- setenv("G_TLS_GNUTLS_PRIORITY", "NORMAL:%COMPAT:!VERS-SSL3.0:!ARCFOUR-128", 0);
- return WebProcessMainUnix(argc,argv);
- }
- void ProcessLauncher::launchProcess()
- {
- ProcessLauncher::ProcessType processType;
- switch(processType)
- {
- case ProcessLauncher::ProcessType::Web:
- //debug later will be taken system based absolute path
- //return "/WebKit/webkit/WebKitBuild/Release/bin/WebProcess";
- {
- WebProcessDispatch* WebProcessApp = new WebProcessDispatch();
- WebProcessApp->Run();
- break;
- }
- case ProcessLauncher::ProcessType::Network:
- //return "/WebKit/webkit/WebKitBuild/Release/bin/NetworkProcess";
- fprintf(stderr,"Network stuff\n");
- break;
- }
- }
- void ProcessLauncher::terminateProcess()
- {
- }
- void ProcessLauncher::platformInvalidate()
- {
- }
- } // namespace WebKit
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.
