-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed missing headers from Webcore for Webkit2 #8
Changes from 1 commit
d883420
42addb5
6fdad02
09f7990
7e97e5b
1b9e6ac
31351ab
5e05c55
2cd19e0
81a496a
0d98b04
4a7a146
c80ae31
c9f0fd0
7182b92
1e1c1ad
7fc2bc0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,7 +58,7 @@ class LoopHandler: public BHandler | |
void MessageReceived(BMessage* message) | ||
{ | ||
if (message->what == 'loop') | ||
m_loop->iterate(); | ||
m_loop->iterate(); | ||
else if (message->what == 'tmrf') { | ||
RunLoop::TimerBase* timer | ||
= (RunLoop::TimerBase*)message->GetPointer("timer"); | ||
|
@@ -100,7 +100,7 @@ void RunLoop::run() | |
looper->LockLooper(); | ||
looper->AddHandler(current().m_handler); | ||
looper->UnlockLooper(); | ||
|
||
if (newLooper) | ||
looper->Loop(); | ||
} | ||
|
@@ -115,7 +115,8 @@ void RunLoop::stop() | |
|
||
void RunLoop::wakeUp() | ||
{ | ||
m_handler->Looper()->PostMessage('loop', m_handler); | ||
RunLoop::current().performWork(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Uh, this look completely wrong! There is nothing to win in taking such shortcuts. You will only get things to crash in very strange ways. Also, this probably breaks existing use of runloop in WebKitLegacy. It would be great if I could merge your changes in the main branch, but with changes like this, it's not going to work. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry just was curious what happens beyond this point 😢 but i knew it is going to break things i will find howto make it work. |
||
//m_handler->Looper()->PostMessage('loop', m_handler); | ||
} | ||
|
||
RunLoop::TimerBase::TimerBase(RunLoop& runLoop) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,7 +96,7 @@ list(APPEND WebCore_SOURCES | |
platform/graphics/texmap/GraphicsLayerTextureMapper.cpp | ||
platform/graphics/texmap/TextureMapperImageBuffer.cpp | ||
|
||
platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp | ||
#platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the problem with this file? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file does not do anything everything is wrapped under USE(COORDINATEDGRAPHICS) while we have disabled it so thought it would be a good clean up 😅😅 |
||
|
||
platform/image-decoders/haiku/ImageDecoderHaiku.cpp | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,7 +117,7 @@ WTF::Optional<size_t> BFormDataIO::readFromFile(const FormDataElement::EncodedFi | |
m_fileHandle = FileSystem::openFile(fileData.filename, FileSystem::FileOpenMode::Read); | ||
|
||
if (!FileSystem::isHandleValid(m_fileHandle)) { | ||
LOG(Network, "Haiku - Failed while trying to open %s for upload\n", fileData.filename.utf8().data()); | ||
//LOG(Network, "Haiku - Failed while trying to open %s for upload\n", fileData.filename.utf8().data()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why? Is it just a missing include to define the LOG macro? |
||
m_fileHandle = FileSystem::invalidPlatformFileHandle; | ||
return WTF::nullopt; | ||
} | ||
|
@@ -126,7 +126,7 @@ WTF::Optional<size_t> BFormDataIO::readFromFile(const FormDataElement::EncodedFi | |
// handle open and read from the current position. | ||
auto readBytes = FileSystem::readFromFile(m_fileHandle, buffer, size); | ||
if (readBytes < 0) { | ||
LOG(Network, "Haiku - Failed while trying to read %s for upload\n", fileData.filename.utf8().data()); | ||
//LOG(Network, "Haiku - Failed while trying to read %s for upload\n", fileData.filename.utf8().data()); | ||
FileSystem::closeFile(m_fileHandle); | ||
m_fileHandle = FileSystem::invalidPlatformFileHandle; | ||
return WTF::nullopt; | ||
|
@@ -202,15 +202,15 @@ WTF::Optional<size_t> BFormDataIO::readFromBlob(const FormDataElement::EncodedBl | |
|
||
|
||
if (!FileSystem::isHandleValid(m_fileHandle)) { | ||
LOG(Network, "Haiku - Failed while trying to open %s for upload\n", fileData.filename.utf8().data()); | ||
//LOG(Network, "Haiku - Failed while trying to open %s for upload\n", fileData.filename.utf8().data()); | ||
m_fileHandle = FileSystem::invalidPlatformFileHandle; | ||
readBytes = -1; | ||
} else { | ||
// Note: there is no management of a file offset, we just keep the file | ||
// handle open and read from the current position. | ||
readBytes = FileSystem::readFromFile(m_fileHandle, buffer, size); | ||
if (readBytes < 0) { | ||
LOG(Network, "Haiku - Failed while trying to read %s for upload\n", fileData.filename.utf8().data()); | ||
//LOG(Network, "Haiku - Failed while trying to read %s for upload\n", fileData.filename.utf8().data()); | ||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ | |
#include "WebProcessPool.h" | ||
#include "WebPageGroup.h" | ||
#include "DrawingAreaProxyImpl.h" | ||
#include <WebCore/IntRect.h> | ||
|
||
using namespace WebKit; | ||
using namespace WebCore; | ||
|
@@ -62,6 +63,38 @@ const API::PageConfiguration& pageConfig) | |
fPage->drawingArea()->setSize(IntSize(rect.right - rect.left, | ||
rect.top - rect.bottom)); | ||
} | ||
BRect p(0,0,10,20); | ||
paint(WebCore::IntRect(p)); | ||
} | ||
|
||
static void drawPageBackground(const WebPageProxy* page,const BRect& rect) | ||
{ | ||
if(!page->drawsBackground()) | ||
return; | ||
|
||
|
||
} | ||
|
||
|
||
void BWebView::paint(const IntRect& dirtyRect) | ||
{ | ||
if(dirtyRect.isEmpty()) | ||
{ | ||
fprintf(stderr,"its empty\n"); | ||
return; | ||
} | ||
fPage->endPrinting(); | ||
if(DrawingAreaProxyImpl* drawingArea = static_cast <DrawingAreaProxyImpl*>(fPage->drawingArea())) | ||
{ | ||
fprintf(stderr,"its painting\n"); | ||
WebCore::Region unpainted; | ||
BView* surface = new BView("drawing_surface",B_WILL_DRAW); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. BWebView is a BView, and it's the one you should draw on. Here you are creating a new BView every time this is called, which is a huge memory leak, and you are not going to draw anything onto the BWebView itself. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops im still learning so please forgive me. I do understand that it is wrong now. Uh how can i miss it out I am supposed to use the existing view to draw but im just overlaying it over and over. |
||
drawingArea->paint(surface,dirtyRect,unpainted); | ||
} | ||
else | ||
{ | ||
drawPageBackground(fPage.get(),dirtyRect); | ||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,12 +26,83 @@ | |
#include "config.h" | ||
#include "ProcessLauncher.h" | ||
|
||
#define __STDC_FORMAT_MACROS | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this still needed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes to get uint64 into a string(as a format specifier) we need this |
||
#include <unistd.h> | ||
#include <string> | ||
#include <inttypes.h> | ||
#include <stdlib.h> | ||
#include <sys/socket.h> | ||
#include <sys/resource.h> | ||
|
||
#include <Looper.h> | ||
|
||
|
||
using namespace WebCore; | ||
|
||
namespace WebKit { | ||
|
||
static const char* processName(ProcessLauncher::ProcessType type) | ||
{ | ||
switch(type) | ||
{ | ||
case ProcessLauncher::ProcessType::Web: | ||
//debug later will be taken system based absolute path | ||
return "/WebKit/webkit/WebKitBuild/Release/bin/WebProcess"; | ||
case ProcessLauncher::ProcessType::Network: | ||
return "/WebKit/webkit/WebKitBuild/Release/bin/NetworkProcess"; | ||
} | ||
} | ||
|
||
void ProcessLauncher::launchProcess() | ||
{ | ||
const char* name=processName(m_launchOptions.processType); | ||
char* procName; | ||
switch(m_launchOptions.processType) | ||
{ | ||
case ProcessLauncher::ProcessType::Web: | ||
procName="WebProcess"; | ||
break; | ||
case ProcessLauncher::ProcessType::Network: | ||
procName="NetworkProcess"; | ||
break; | ||
} | ||
//process identifier | ||
uint64_t prID = m_launchOptions.processIdentifier.toUInt64(); | ||
fprintf(stderr,"\nlaunch%d\n",prID); | ||
char buff[21]; | ||
snprintf(buff,sizeof(buff),"%"PRIu64,prID); | ||
// | ||
|
||
//socket | ||
int sockets[2]; | ||
if(socketpair(AF_UNIX, SOCK_STREAM, 0, sockets)==-1) | ||
{ | ||
fprintf(stderr,":(%s\n",strerror(errno)); | ||
} | ||
//1-> client 0-> server is taken convention | ||
|
||
std::string sock = std::to_string(sockets[1]); | ||
char* sockBuff = new char[sock.length()+1]; | ||
strcpy(sockBuff,sock.c_str()); | ||
// | ||
|
||
pid_t pid=fork(); | ||
char* m_args[]={procName,buff,sockBuff,NULL}; | ||
if(pid==0) | ||
{ | ||
execvp(name,m_args); | ||
} | ||
else | ||
{ | ||
fprintf(stderr,"\nChild:%d\n",pid); | ||
} | ||
fprintf(stderr,"\ngoing to send\n"); | ||
RefPtr<ProcessLauncher> protectedLauncher(this); | ||
|
||
RunLoop::main().dispatch([protectedLauncher,pid,sockets]{ | ||
fprintf(stderr,"Messaged function executing now\n"); | ||
protectedLauncher->didFinishLaunchingProcess(pid,sockets[0]); | ||
}); | ||
} | ||
|
||
void ProcessLauncher::terminateProcess() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's this file? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think its like a configuration file created by webkit for mini browser |
||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>com.apple.security.device.usb</key> | ||
<true/> | ||
<key>com.apple.security.temporary-exception.mach-lookup.global-name</key> | ||
<string>com.apple.Safari.SafeBrowsing.Service</string> | ||
<key>com.apple.security.app-sandbox</key> | ||
<true/> | ||
<key>com.apple.security.network.client</key> | ||
<true/> | ||
<key>com.apple.security.temporary-exception.files.absolute-path.read-only</key> | ||
<string>/</string> | ||
</dict> | ||
</plist> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i will get the spacing and weird debug messages out as now my only aim is to get it rendering 😄