Add CefServer API for handling HTTP/WebSocket requests (issue #2278)

This commit is contained in:
Marshall Greenblatt
2017-11-09 14:00:47 -05:00
parent 39e689d80a
commit 4b39753c41
46 changed files with 5041 additions and 71 deletions

View File

@@ -23,6 +23,12 @@ void RunTest(CefRefPtr<CefBrowser> browser, int id);
// Returns the contents of the CefRequest as a string.
std::string DumpRequestContents(CefRefPtr<CefRequest> request);
// Returns the dump response as a stream. |request| is the request.
// |response_headers| will be populated with extra response headers, if any.
CefRefPtr<CefStreamReader> GetDumpResponse(
CefRefPtr<CefRequest> request,
CefResponse::HeaderMap& response_headers);
// Returns a data: URI with the specified contents.
std::string GetDataURI(const std::string& data, const std::string& mime_type);
@@ -35,6 +41,10 @@ void SetupResourceManager(CefRefPtr<CefResourceManager> resource_manager);
// Show a JS alert message.
void Alert(CefRefPtr<CefBrowser> browser, const std::string& message);
// Returns true if |url| is a test URL with the specified |path|. This matches
// both http://tests/<path> and http://localhost:xxxx/<path>.
bool IsTestURL(const std::string& url, const std::string& path);
// Create all CefMessageRouterBrowserSide::Handler objects. They will be
// deleted when the ClientHandler is destroyed.
typedef std::set<CefMessageRouterBrowserSide::Handler*> MessageHandlerSet;