forked from WebKit/WebKit-http
-
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
Cleanup for rebase #18
Closed
RAJAGOPALAN-GANGADHARAN
wants to merge
16
commits into
haiku:webkit2
from
RAJAGOPALAN-GANGADHARAN:cleanup-for-rebase
Closed
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
693ced0
Initial implementation to load blank url and now trying to load html …
RAJAGOPALAN-GANGADHARAN f8d83c5
Added message handler to main run loop and made changes to webview st…
RAJAGOPALAN-GANGADHARAN e4dabbf
WebKit: missing include dirs, add coordinatedgraphics sourcefiles
pulkomandy e72221c
WebProcessPool: remove changes in cross platform code
pulkomandy abbf0d9
WebProcessPoolHaiku: fix tracing.
pulkomandy 08768f4
IPC for haiku
RAJAGOPALAN-GANGADHARAN 3710801
Message Listener attached to Workqueue thread first iteration
RAJAGOPALAN-GANGADHARAN 451791e
Fixed the worqueue ambiguity
RAJAGOPALAN-GANGADHARAN 3d9e297
IPC communication WIP
RAJAGOPALAN-GANGADHARAN 04d5e10
Tried the new Adding messenger technique (relies only once on the mai…
RAJAGOPALAN-GANGADHARAN 3cd84c4
Finalizing IPC communication related things
RAJAGOPALAN-GANGADHARAN d73a91a
Enable logging with BeDC
RAJAGOPALAN-GANGADHARAN 7847639
Adding the view to Minibrowser and adding few buttons
RAJAGOPALAN-GANGADHARAN d6e2e61
Partial implementation of mouse events
RAJAGOPALAN-GANGADHARAN fcbf9ea
Widget and shared memory
RAJAGOPALAN-GANGADHARAN bd654c6
Fixed Shared Memory and Started Network Process implementation
RAJAGOPALAN-GANGADHARAN File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
167 changes: 167 additions & 0 deletions
167
Source/WebKit/NetworkProcess/haiku/NetworkDataTaskHaiku.cpp
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,167 @@ | ||
/* | ||
* 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 "NetworkDataTaskHaiku.h" | ||
|
||
#include <WebCore/AuthenticationChallenge.h> | ||
#include <WebCore/CookieJar.h> | ||
#include <WebCore/NetworkStorageSession.h> | ||
#include <WebCore/ResourceError.h> | ||
#include <WebCore/SameSiteInfo.h> | ||
#include <WebCore/SharedBuffer.h> | ||
|
||
#include <Url.h> | ||
#include <UrlRequest.h> | ||
#include <HttpRequest.h> | ||
#include <assert.h> | ||
|
||
namespace WebKit { | ||
|
||
using namespace WebCore; | ||
|
||
NetworkDataTaskHaiku::NetworkDataTaskHaiku(NetworkSession& session, NetworkDataTaskClient& client, const ResourceRequest& requestWithCredentials, StoredCredentialsPolicy storedCredentialsPolicy, ContentSniffingPolicy shouldContentSniff, ContentEncodingSniffingPolicy, bool shouldClearReferrerOnHTTPSToHTTPRedirect, bool dataTaskIsForMainFrameNavigation) | ||
: NetworkDataTask(session, client, requestWithCredentials, storedCredentialsPolicy, shouldClearReferrerOnHTTPSToHTTPRedirect, dataTaskIsForMainFrameNavigation) | ||
, m_postData(NULL) | ||
{ | ||
if (m_scheduledFailureType != NoFailure) | ||
return; | ||
|
||
auto request = requestWithCredentials; | ||
if (request.url().protocolIsInHTTPFamily()) { | ||
m_startTime = MonotonicTime::now(); | ||
auto url = request.url(); | ||
if (m_storedCredentialsPolicy == StoredCredentialsPolicy::Use) { | ||
m_user = url.user(); | ||
m_password = url.pass(); | ||
request.removeCredentials(); | ||
} | ||
} | ||
createRequest(WTFMove(request)); | ||
} | ||
|
||
NetworkDataTaskHaiku::~NetworkDataTaskHaiku() | ||
{ | ||
} | ||
|
||
void NetworkDataTaskHaiku::createRequest(ResourceRequest&& request) | ||
{ | ||
m_currentRequest = WTFMove(request); | ||
m_request = m_currentRequest.toNetworkRequest(nullptr); | ||
|
||
BString method = BString(m_currentRequest.httpMethod()); | ||
|
||
m_postData = NULL; | ||
|
||
if (m_request == NULL) | ||
return; | ||
|
||
m_baseUrl = URL(m_request->Url()); | ||
|
||
BHttpRequest* httpRequest = dynamic_cast<BHttpRequest*>(m_request); | ||
if(httpRequest) { | ||
|
||
if(method == B_HTTP_POST || method == B_HTTP_PUT) { | ||
FormData* form = m_currentRequest.httpBody(); | ||
if(form) { | ||
m_postData = new BFormDataIO(form); | ||
httpRequest->AdoptInputData(m_postData, m_postData->Size()); | ||
} | ||
} | ||
|
||
httpRequest->SetMethod(method.String()); | ||
} | ||
|
||
if(this->SynchronousListener()) { | ||
m_request->SetListener(this->SynchronousListener()); | ||
} else { | ||
m_request->SetListener(this); | ||
} | ||
|
||
if (m_request->Run() < B_OK) | ||
{ | ||
} | ||
} | ||
void NetworkDataTaskHaiku::cancel() | ||
{ | ||
if(m_state == State::Canceling || m_state == State::Completed) | ||
return; | ||
|
||
m_state = State::Canceling; | ||
|
||
if(m_request) | ||
m_request->Stop(); | ||
|
||
} | ||
|
||
void NetworkDataTaskHaiku::resume() | ||
{ | ||
if(m_state == State::Completed || m_state == State::Canceling) | ||
return; | ||
|
||
m_state = State::Running; | ||
|
||
} | ||
|
||
void NetworkDataTaskHaiku::invalidateAndCancel() | ||
{ | ||
|
||
} | ||
|
||
NetworkDataTask::State NetworkDataTaskHaiku::state() const | ||
{ | ||
return m_state; | ||
} | ||
|
||
void NetworkDataTaskHaiku::ConnectionOpened(BUrlRequest* caller) | ||
{ | ||
|
||
} | ||
void NetworkDataTaskHaiku::HeadersReceived(BUrlRequest* caller, const BUrlResult& result) | ||
{ | ||
} | ||
void NetworkDataTaskHaiku::DataReceived(BUrlRequest* caller, const char* data, off_t position, | ||
ssize_t size) | ||
{ | ||
if(size < 0 ) | ||
{ | ||
return; | ||
} | ||
m_client->didReceiveData(SharedBuffer::create(data,size)); | ||
} | ||
void NetworkDataTaskHaiku::UploadProgress(BUrlRequest* caller, ssize_t bytesSent, ssize_t bytesTotal) | ||
{ | ||
|
||
} | ||
void NetworkDataTaskHaiku::RequestCompleted(BUrlRequest* caller, bool success) | ||
{ | ||
|
||
} | ||
bool NetworkDataTaskHaiku::CertificateVerificationFailed(BUrlRequest* caller, BCertificate& certificate, const char* message) | ||
{ | ||
|
||
} | ||
|
||
} |
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,76 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "config.h" | ||
#include "HaikuFormDataStream.h" | ||
#include "NetworkDataTask.h" | ||
#include <WebCore/ResourceResponse.h> | ||
#include <WebCore/ResourceRequest.h> | ||
|
||
#include <UrlProtocolAsynchronousListener.h> | ||
#include <Referenceable.h> | ||
#include <Path.h> | ||
namespace WebKit { | ||
using namespace WebCore; | ||
|
||
class NetworkDataTaskHaiku final : public NetworkDataTask, | ||
public BUrlProtocolAsynchronousListener | ||
{ | ||
public: | ||
static Ref<NetworkDataTask> create(NetworkSession& session, NetworkDataTaskClient& client, const WebCore::ResourceRequest& request, WebCore::StoredCredentialsPolicy storedCredentialsPolicy, WebCore::ContentSniffingPolicy shouldContentSniff, WebCore::ContentEncodingSniffingPolicy shouldContentEncodingSniff, bool shouldClearReferrerOnHTTPSToHTTPRedirect, bool dataTaskIsForMainFrameNavigation) | ||
{ | ||
return adoptRef(*new NetworkDataTaskHaiku(session, client, request, storedCredentialsPolicy, shouldContentSniff, shouldContentEncodingSniff, shouldClearReferrerOnHTTPSToHTTPRedirect, dataTaskIsForMainFrameNavigation)); | ||
} | ||
|
||
~NetworkDataTaskHaiku(); | ||
private: | ||
NetworkDataTaskHaiku(NetworkSession&, NetworkDataTaskClient&, const WebCore::ResourceRequest&, WebCore::StoredCredentialsPolicy, WebCore::ContentSniffingPolicy, WebCore::ContentEncodingSniffingPolicy, bool shouldClearReferrerOnHTTPSToHTTPRedirect, bool dataTaskIsForMainFrameNavigation); | ||
void createRequest(WebCore::ResourceRequest&&); | ||
State m_state{State::Suspended}; | ||
void cancel() override; | ||
void resume() override; | ||
void invalidateAndCancel() override; | ||
NetworkDataTask::State state() const override; | ||
|
||
void ConnectionOpened(BUrlRequest* caller) override; | ||
void HeadersReceived(BUrlRequest* caller, const BUrlResult& result) override; | ||
void DataReceived(BUrlRequest* caller, const char* data, off_t position, | ||
ssize_t size) override; | ||
void UploadProgress(BUrlRequest* caller, ssize_t bytesSent, ssize_t bytesTotal) override; | ||
void RequestCompleted(BUrlRequest* caller, bool success) override; | ||
bool CertificateVerificationFailed(BUrlRequest* caller, BCertificate& certificate, const char* message) override; | ||
|
||
WebCore::ResourceResponse m_response; | ||
WebCore::ResourceRequest m_currentRequest; | ||
unsigned m_redirectCount { 0 }; | ||
unsigned m_authFailureCount { 0 }; | ||
MonotonicTime m_startTime; | ||
BUrlRequest* m_request; | ||
BFormDataIO* m_postData; | ||
URL m_baseUrl; | ||
}; | ||
} |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
You have committed this without fixing the conflicts