forked from WebKit/WebKit-http
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial implementation of IPC for haiku will add it to description each time i amend 1)added empty functions 2)fixed building issues and successfully created a connection between webprocess 3)Added a message handler to look out for incoming messages to runloop
- Loading branch information
1 parent
ce47621
commit ebecb1d
Showing
12 changed files
with
242 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
/* | ||
* Copyright (C) 2019 Haiku, Inc. All rights reserved. | ||
* | ||
* 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 "Connection.h" | ||
|
||
#include <unistd.h> | ||
#include <Message.h> | ||
#include <Looper.h> | ||
namespace IPC{ | ||
class ReadLoop: public BHandler | ||
{ | ||
public: | ||
ReadLoop(IPC::Connection* con) | ||
:BHandler("Read Message Loop"), | ||
connection(con) | ||
{ | ||
} | ||
void MessageReceived(BMessage* message) | ||
{ | ||
message->PrintToStream(); | ||
} | ||
private: | ||
IPC::Connection* connection; | ||
|
||
}; | ||
void Connection::platformInitialize(Identifier identifier) | ||
{ | ||
fprintf(stderr,"%s\n",__PRETTY_FUNCTION__); | ||
m_connectedProcess = identifier; | ||
} | ||
void Connection::platformInvalidate() | ||
{ | ||
|
||
} | ||
void Connection::runReadEventLoop() | ||
{ | ||
//RunLoop::run(); | ||
BLooper* looper = BLooper::LooperForThread(find_thread(NULL)); | ||
BLooper* looper = BLooper::LooperForThread(find_thread(NULL)); | ||
bool newLooper = false; | ||
if (!looper) { | ||
//This case is not good | ||
return; | ||
} else if (looper != be_app) { | ||
fprintf(stderr, "Add handler to existing RunLoop looper\n"); | ||
} | ||
looper->Lock(); | ||
looper->AddHandler(m_readHandler); | ||
looper->SetPreferredHandler(m_readHandler); | ||
looper->Unlock(); | ||
fprintf(stderr,"\n Connt id:%ld",looper->Thread()); | ||
} | ||
void Connection::runWriteEventLoop() | ||
{ | ||
} | ||
bool Connection::open() | ||
{ | ||
status_t result = m_messenger.SetTo(NULL,m_connectedProcess); | ||
m_readHandler = new ReadLoop(this); | ||
runReadEventLoop(); | ||
if(result == B_OK) | ||
{ | ||
fprintf(stderr,"%s %ld %ld\n",__PRETTY_FUNCTION__,m_connectedProcess,getpid()); | ||
return true; | ||
} | ||
|
||
return false; | ||
} | ||
bool Connection::platformCanSendOutgoingMessages() const | ||
{ | ||
|
||
} | ||
bool Connection::sendOutgoingMessage(std::unique_ptr<Encoder> encoder) | ||
{ | ||
fprintf(stderr,"%s\n",__PRETTY_FUNCTION__); | ||
} | ||
void Connection::willSendSyncMessage(OptionSet<SendSyncOption> ) | ||
{ | ||
|
||
} | ||
void Connection::didReceiveSyncReply(OptionSet<SendSyncOption> ) | ||
{ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
/* | ||
* Copyright (C) 2019 Haiku, Inc. All rights reserved. | ||
* | ||
* 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 "SharedMemory.h" | ||
|
||
#include "Decoder.h" | ||
#include "Encoder.h" | ||
|
||
namespace WebKit { | ||
|
||
SharedMemory::Handle::Handle() | ||
{ | ||
} | ||
|
||
SharedMemory::Handle::~Handle() | ||
{ | ||
} | ||
|
||
SharedMemory::Handle::Handle(Handle&&) = default; | ||
SharedMemory::Handle& SharedMemory::Handle::operator=(Handle&& other) = default; | ||
|
||
void SharedMemory::Handle::clear() | ||
{ | ||
} | ||
|
||
bool SharedMemory::Handle::isNull() const | ||
{ | ||
} | ||
|
||
void SharedMemory::Handle::encode(IPC::Encoder& encoder) const | ||
{ | ||
} | ||
|
||
bool SharedMemory::Handle::decode(IPC::Decoder& decoder, Handle& handle) | ||
{ | ||
} | ||
|
||
static int createSharedMemory() | ||
{ | ||
} | ||
|
||
RefPtr<SharedMemory> SharedMemory::allocate(size_t size) | ||
{ | ||
} | ||
|
||
RefPtr<SharedMemory> SharedMemory::map(const Handle& handle, Protection protection) | ||
{ | ||
|
||
} | ||
|
||
SharedMemory::~SharedMemory() | ||
{ | ||
} | ||
|
||
bool SharedMemory::createHandle(Handle& handle, Protection) | ||
{ | ||
} | ||
|
||
unsigned SharedMemory::systemPageSize() | ||
{ | ||
} | ||
|
||
} // namespace WebKit | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters