ceftests: Rename test_server::Observer::OnHttpRequest to OnTestServerRequest (see issue #3348)
This commit is contained in:
parent
0b1c3938c6
commit
952f2b0829
|
@ -1321,8 +1321,8 @@ class CookieAccessServerHandler : public test_server::ObserverHelper,
|
|||
delete this;
|
||||
}
|
||||
|
||||
bool OnHttpRequest(CefRefPtr<CefRequest> request,
|
||||
const ResponseCallback& response_callback) override {
|
||||
bool OnTestServerRequest(CefRefPtr<CefRequest> request,
|
||||
const ResponseCallback& response_callback) override {
|
||||
EXPECT_UI_THREAD();
|
||||
|
||||
// Log the requests for better error reporting.
|
||||
|
|
|
@ -313,8 +313,8 @@ class TestServerObserver : public test_server::ObserverHelper {
|
|||
std::move(ready_callback_).Run();
|
||||
}
|
||||
|
||||
bool OnHttpRequest(CefRefPtr<CefRequest> request,
|
||||
const ResponseCallback& response_callback) override {
|
||||
bool OnTestServerRequest(CefRefPtr<CefRequest> request,
|
||||
const ResponseCallback& response_callback) override {
|
||||
CEF_REQUIRE_UI_THREAD();
|
||||
Resource* resource = setup_->GetResource(request);
|
||||
if (!resource) {
|
||||
|
|
|
@ -253,8 +253,8 @@ void Manager::OnServerHandlerDeleted() {
|
|||
delete this;
|
||||
}
|
||||
|
||||
void Manager::OnHttpRequest(CefRefPtr<CefRequest> request,
|
||||
const ResponseCallback& response_callback) {
|
||||
void Manager::OnTestServerRequest(CefRefPtr<CefRequest> request,
|
||||
const ResponseCallback& response_callback) {
|
||||
CEF_REQUIRE_UI_THREAD();
|
||||
|
||||
// TODO(chrome-runtime): Debug why favicon requests don't always have the
|
||||
|
@ -276,7 +276,7 @@ void Manager::OnHttpRequest(CefRefPtr<CefRequest> request,
|
|||
|
||||
ObserverList::const_iterator it = list.begin();
|
||||
for (; it != list.end(); ++it) {
|
||||
if ((*it)->OnHttpRequest(request, response_callback)) {
|
||||
if ((*it)->OnTestServerRequest(request, response_callback)) {
|
||||
handled = true;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -74,8 +74,8 @@ class Manager : public Runner::Delegate {
|
|||
void OnServerCreated(const std::string& server_origin) override;
|
||||
void OnServerDestroyed() override;
|
||||
void OnServerHandlerDeleted() override;
|
||||
void OnHttpRequest(CefRefPtr<CefRequest> request,
|
||||
const ResponseCallback& response_callback) override;
|
||||
void OnTestServerRequest(CefRefPtr<CefRequest> request,
|
||||
const ResponseCallback& response_callback) override;
|
||||
|
||||
private:
|
||||
const bool https_server_;
|
||||
|
|
|
@ -30,8 +30,9 @@ class Observer {
|
|||
// Return true and execute |response_callback| either synchronously or
|
||||
// asynchronously if the request was handled. Do not execute
|
||||
// |response_callback| when returning false.
|
||||
virtual bool OnHttpRequest(CefRefPtr<CefRequest> request,
|
||||
const ResponseCallback& response_callback) = 0;
|
||||
virtual bool OnTestServerRequest(
|
||||
CefRefPtr<CefRequest> request,
|
||||
const ResponseCallback& response_callback) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~Observer() = default;
|
||||
|
|
|
@ -73,8 +73,8 @@ class TestServerObserver : public test_server::ObserverHelper {
|
|||
weak_ptr_factory_.GetWeakPtr()));
|
||||
}
|
||||
|
||||
bool OnHttpRequest(CefRefPtr<CefRequest> request,
|
||||
const ResponseCallback& response_callback) override {
|
||||
bool OnTestServerRequest(CefRefPtr<CefRequest> request,
|
||||
const ResponseCallback& response_callback) override {
|
||||
CEF_REQUIRE_UI_THREAD();
|
||||
const std::string& url = request->GetURL();
|
||||
if (url != url_)
|
||||
|
|
|
@ -31,8 +31,9 @@ class Runner {
|
|||
virtual void OnServerHandlerDeleted() = 0;
|
||||
|
||||
// Server request notification.
|
||||
virtual void OnHttpRequest(CefRefPtr<CefRequest> request,
|
||||
const ResponseCallback& response_callback) = 0;
|
||||
virtual void OnTestServerRequest(
|
||||
CefRefPtr<CefRequest> request,
|
||||
const ResponseCallback& response_callback) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~Delegate() = default;
|
||||
|
|
|
@ -59,7 +59,7 @@ class ServerHandler : public CefServerHandler {
|
|||
const CefString& client_address,
|
||||
CefRefPtr<CefRequest> request) override {
|
||||
EXPECT_TRUE(server->GetTaskRunner()->BelongsToCurrentThread());
|
||||
NotifyHttpRequest(server, connection_id, client_address, request);
|
||||
NotifyTestServerRequest(server, connection_id, client_address, request);
|
||||
}
|
||||
|
||||
void OnWebSocketRequest(CefRefPtr<CefServer> server,
|
||||
|
@ -95,20 +95,20 @@ class ServerHandler : public CefServerHandler {
|
|||
delegate_->OnServerDestroyed();
|
||||
}
|
||||
|
||||
void NotifyHttpRequest(CefRefPtr<CefServer> server,
|
||||
int connection_id,
|
||||
const CefString& client_address,
|
||||
CefRefPtr<CefRequest> request) {
|
||||
void NotifyTestServerRequest(CefRefPtr<CefServer> server,
|
||||
int connection_id,
|
||||
const CefString& client_address,
|
||||
CefRefPtr<CefRequest> request) {
|
||||
if (!CefCurrentlyOn(TID_UI)) {
|
||||
CefPostTask(TID_UI, base::BindOnce(&ServerHandler::NotifyHttpRequest,
|
||||
this, server, connection_id,
|
||||
client_address, request));
|
||||
CefPostTask(TID_UI, base::BindOnce(
|
||||
&ServerHandler::NotifyTestServerRequest, this,
|
||||
server, connection_id, client_address, request));
|
||||
return;
|
||||
}
|
||||
|
||||
auto response_callback = base::BindRepeating(&ServerHandler::SendResponse,
|
||||
server, connection_id);
|
||||
delegate_->OnHttpRequest(request, response_callback);
|
||||
delegate_->OnTestServerRequest(request, response_callback);
|
||||
}
|
||||
|
||||
static void SendResponse(CefRefPtr<CefServer> server,
|
||||
|
|
|
@ -54,7 +54,7 @@ class ServerHandler : public CefTestServerHandler {
|
|||
CefRefPtr<CefTestServer> server,
|
||||
CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefTestServerConnection> connection) override {
|
||||
NotifyHttpRequest(request, connection);
|
||||
NotifyTestServerRequest(request, connection);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -69,17 +69,18 @@ class ServerHandler : public CefTestServerHandler {
|
|||
delegate_->OnServerDestroyed();
|
||||
}
|
||||
|
||||
void NotifyHttpRequest(CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefTestServerConnection> connection) {
|
||||
void NotifyTestServerRequest(CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefTestServerConnection> connection) {
|
||||
if (!CefCurrentlyOn(TID_UI)) {
|
||||
CefPostTask(TID_UI, base::BindOnce(&ServerHandler::NotifyHttpRequest,
|
||||
this, request, connection));
|
||||
CefPostTask(TID_UI,
|
||||
base::BindOnce(&ServerHandler::NotifyTestServerRequest, this,
|
||||
request, connection));
|
||||
return;
|
||||
}
|
||||
|
||||
auto response_callback =
|
||||
base::BindRepeating(&ServerHandler::SendResponse, connection);
|
||||
delegate_->OnHttpRequest(request, response_callback);
|
||||
delegate_->OnTestServerRequest(request, response_callback);
|
||||
}
|
||||
|
||||
static void SendResponse(CefRefPtr<CefTestServerConnection> connection,
|
||||
|
|
|
@ -1303,8 +1303,8 @@ class RequestServerHandler : public test_server::ObserverHelper {
|
|||
delete this;
|
||||
}
|
||||
|
||||
bool OnHttpRequest(CefRefPtr<CefRequest> request,
|
||||
const ResponseCallback& response_callback) override {
|
||||
bool OnTestServerRequest(CefRefPtr<CefRequest> request,
|
||||
const ResponseCallback& response_callback) override {
|
||||
EXPECT_UI_THREAD();
|
||||
|
||||
// Log the requests for better error reporting.
|
||||
|
|
Loading…
Reference in New Issue