Skip to content
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

Networkprocess iteration 2 #21

Closed
wants to merge 31 commits into from
Closed

Networkprocess iteration 2 #21

wants to merge 31 commits into from

Conversation

RAJAGOPALAN-GANGADHARAN

No description provided.

pulkomandy and others added 20 commits June 15, 2019 20:50
Add a static_assert to make sure pid_t fits there.
Add conversion functions but I think they will not be needed (C integer
promotion will do the magic)
Who wants to use fork/exec when we have much nicer native APIs?
We need a MIME signature so the roster can find it.
- Added a message handler to look out for incoming messages to runloop
- Created new aux support so we can attach all handlers to the main apps looper
- Added a message stashing feature so it stashes the messages and interprets them when the loop is ready to run
- used maps to store loopers and BApplications to forward message to appropriate loopers
- Created a message from ui process to network process that notifies the pid of webprocess
- Added NetworkSession so it doesnt crash
- Add minimal support for ANGLE as build is broken when disabling it
- Fix various minor things in Haiku specific files
- A bit more cleanup of include files and forwarding headers management
1)This makes few important changes in adding the view
2)Partial mouse events which is kept aside now as main focus is put on webpage rendering
1) Few callbacks for finished loading and forward and backward stop etc is now fully functional
2) status text is partially done
3)shared memory done with mapping part pending(i need to understand a little bit more)
- WebCore/PlatformHaiku: upgrade to the new way to generate forwarding headers
- WebKitLegacy: remove some direct WebCore path in PlatformHaiku, and
  remove include path hack from before we had forwarding headers working
  in many files (still more to do)
- WebKit: fix one instance of using a Webcore header with incorrect path

Currently the build is failing because ANGLE forwarding headers are not
getting copied (or not to the right place?) in
Source/ThirdParty/ANGLE/include/CMakeLists.txt. I don't see why, the
file looks okf but I don't know where the target dir is defined. It's
quite late here so stopping here for now, will continue tomorrow unless
you manage to find the issues.
Fix various include path, do not include ANGLE headers when not needed.
Some headers are added to the forwarding headers that probably shouldn't
need to be there (date time chooser stuff, and not sure about image and
image buffer). But it gets things working at least and it's more clean
than what we had before.
1) removed unwanted comments
2) removed unwanted methods
@@ -64,6 +78,10 @@ NetworkDataTaskHaiku::NetworkDataTaskHaiku(NetworkSession& session, NetworkDataT

NetworkDataTaskHaiku::~NetworkDataTaskHaiku()
{
cancel();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation

@@ -123,6 +152,8 @@ void NetworkDataTaskHaiku::resume()

m_state = State::Running;

if(m_request)
m_request->Resume();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation

{
if(isMainThread())
task();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation

}
void NetworkDataTaskHaiku::HeadersReceived(BUrlRequest* caller, const BUrlResult& result)
{
if (m_currentRequest.isNull())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation

ResourceRequest request = m_currentRequest;
ResourceResponse responseCopy = response;
request.setURL(url);
fprintf(stderr,"((((((( redirecting to %s)))))))\n",request.url().string().utf8().data());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid leaving fprintf in the commited code.

Source/WebKit/UIProcess/API/haiku/WebView.cpp Outdated Show resolved Hide resolved
//fprintf(stderr,"\n %s %s\n",__PRETTY_FUNCTION__,((BWebView*)clientInfo)->getCurrentURL());
BMessage message(URL_CHANGE);
message.AddString("url",BString(((BWebView*)clientInfo)->getCurrentURL()));
be_app->PostMessage(&message);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this goes to be_app? It should go to the BWindow the view is part of (you can get it using BLooper* window = Looper();)

@@ -54,8 +58,7 @@ class BWebView
static void didFinishProgress(WKPageRef,const void*);
static void didFinishNavigation(WKPageRef page, WKNavigationRef navigation, WKTypeRef userData,const void* clientInfo);
static void didFailNavigation(WKPageRef page, WKNavigationRef navigation, WKErrorRef,WKTypeRef userData,const void* clientInfo);


PageLoadStateObserver* observer;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fObserver (use Haiku coding guidelines here)

standardUserAgentString = "Mozilla/5.0 (" + platform + "; " + osVersion + ") AppleWebKit/" + version
+ " (KHTML, like Gecko) Version/5.0 Safari/" + version;

/*standardUserAgentString = "Mozilla/5.0 (" + platform + "; " + osVersion + ") AppleWebKit/" + version
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please restore this, and fix the parameters instead to get the same, instead of hardcoding the values.

void
App::testLoader()

void App::LoadingProgress(double value)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should all go into the MiniBrowser window instead. It will avoid Lock() and Unlock() all over the place and let the BApplication thread clean of a lot of the WebKit event work (which comes from BWebView, and should be a concern of the window it is attached to)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this can be fixed by passing onto correct BLooper right instead of posting message to be_app?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I put a comment at the place where the message is sent as well.

pulkomandy and others added 4 commits July 3, 2019 23:20
Replace our broken implementation by one done by waddlesplash based on
the curl one:
- Does not need to run two threads
- Does not crash
- Supports SSL

There is one limitation: we don't have a way to wait for a socket to be
either readable or writable. So get away with timeouts for now. I'll
revisit that after I figure out a way to add a WaitForReadableOrWritable
to BSocket and BSecureSocket (trying to not break the ABI while doing
so).
1) Loading, changing title and adding redirected url are added to minibrowser
2) Get data and run on main thread - fixes network process run on main thread problem
1) Put widgets in window thread
2) webkit events on main thread
1) Enabled 3D Rendering
2) Shareable Bitmap to get data and initialize a bitmap
3) Added few drawing mechanisms to webview
4) Backing store update
@@ -134,7 +134,7 @@ void BWebView::stop()
WKPageClose(page);
}
void BWebView::didCommitNavigation(WKPageRef page, WKNavigationRef navigation, WKTypeRef userData, const void* clientInfo)
{
{fprintf(stderr,"\n %s \n",__PRETTY_FUNCTION__);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not leave this around, or use BeDC instead

{
notImplemented();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds easy to implement.

You can try "Mozilla/5.0 (Haiku; Intel R1beta1) AppleWebKit/536.30.1 (KHTML, like Gecko) Version/6.0.5 WebPositive/2.0"

pulkomandy and others added 3 commits July 29, 2019 16:12
We still need it for now and it's not that hard to keep it working.
Link it with OpenGL and disable coordinated graphics as we don't need
that for now.
1) Loading, changing title and adding redirected url are added to minibrowser
2) Get data and run on main thread - fixes network process run on main thread problem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants