Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Unified Diff: net/test/embedded_test_server/embedded_test_server.h

Issue 1905873002: Add content_browsertests for testing cache control flags (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reload.html wasn't there Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/test/embedded_test_server/embedded_test_server.h
diff --git a/net/test/embedded_test_server/embedded_test_server.h b/net/test/embedded_test_server/embedded_test_server.h
index 93ba69086265444ee45e6a55629e0e94ccb21083..d13933f4908e023396b1700105ebf905e9ca9119 100644
--- a/net/test/embedded_test_server/embedded_test_server.h
+++ b/net/test/embedded_test_server/embedded_test_server.h
@@ -117,6 +117,8 @@ class EmbeddedTestServer {
typedef base::Callback<std::unique_ptr<HttpResponse>(
const HttpRequest& request)>
HandleRequestCallback;
+ typedef base::Callback<void(const HttpRequest& request)>
+ MonitorRequestCallback;
// Creates a http test server. Start() must be called to start the server.
// |type| indicates the protocol type of the server (HTTP/HTTPS).
@@ -207,6 +209,11 @@ class EmbeddedTestServer {
// on UI thread.
void RegisterRequestHandler(const HandleRequestCallback& callback);
+ // Adds request monitor. The |callback| is called before any other handler is
kinuko 2016/05/12 08:45:05 nit: 'a request monitor' or 'request monitors' 'an
Takashi Toyoshima 2016/05/13 05:27:13 Done.
+ // called, but can not respond it. This is useful to monitor requests that
+ // will be handled by other request handlers.
+ void RegisterRequestMonitor(const MonitorRequestCallback& callback);
+
// Adds default handlers, including those added by AddDefaultHandlers, to be
// tried after all other user-specified handlers have been tried.
void RegisterDefaultHandler(const HandleRequestCallback& callback);
@@ -271,8 +278,9 @@ class EmbeddedTestServer {
// Owns the HttpConnection objects.
std::map<StreamSocket*, HttpConnection*> connections_;
- // Vector of registered and default request handlers.
+ // Vector of registered and default request handlers and monitors.
std::vector<HandleRequestCallback> request_handlers_;
+ std::vector<MonitorRequestCallback> request_monitors_;
std::vector<HandleRequestCallback> default_request_handlers_;
base::ThreadChecker thread_checker_;

Powered by Google App Engine
This is Rietveld 408576698