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

Unified Diff: chrome/browser/policy/cloud/test_request_interceptor.h

Issue 879233003: Initial RemoteCommandService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remote-commands
Patch Set: WIP Created 5 years, 10 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: chrome/browser/policy/cloud/test_request_interceptor.h
diff --git a/chrome/browser/policy/cloud/test_request_interceptor.h b/chrome/browser/policy/cloud/test_request_interceptor.h
index 858af64556c1c766d739a543718cfdc1f7fa444d..c66fb0b04d831f089d63f37faba5d616c56f4be5 100644
--- a/chrome/browser/policy/cloud/test_request_interceptor.h
+++ b/chrome/browser/policy/cloud/test_request_interceptor.h
@@ -25,6 +25,8 @@ class URLRequestJob;
namespace policy {
+class TestingRemoteCommandsServer;
+
// Intercepts all requests to the given hostname while in scope, and allows
// queuing callbacks to handle expected requests. Must be created and destroyed
// while the IO thread is valid.
@@ -32,6 +34,11 @@ class TestRequestInterceptor {
public:
// A callback that returns a new URLRequestJob given a URLRequest.
// This is used to queue callbacks that will handle expected requests.
+ // If a null URLRequestJob is returned by this callback, it indicates that
bartfab (slow) 2015/02/12 14:29:17 The grammar is a bit off in this comment, but that
binjin 2015/02/16 22:46:22 It's not for out of order packets. It's meant to i
bartfab (slow) 2015/02/17 18:13:52 If the order in which requests arrive is well-defi
binjin 2015/02/18 15:37:48 I don't want to handle certain request (policy req
+ // the request is legal but not expected be intercepted by current JobCallback
+ // , thus it will be ignored and BadRequestJob will be used instead for
+ // current request. In the other hand, the current JobCallback will continue
+ // to live in the queue to service future request job.
typedef base::Callback<
net::URLRequestJob*(net::URLRequest*, net::NetworkDelegate*)> JobCallback;
@@ -71,6 +78,10 @@ class TestRequestInterceptor {
// Returns a JobCallback that will send the contents of |file_path|.
static JobCallback FileJob(const base::FilePath& file_path);
+ // XXX
+ static JobCallback FetchRemoteCommandsJob(TestingRemoteCommandsServer* server,
+ bool ignore_other_requests);
+
private:
class Delegate;

Powered by Google App Engine
This is Rietveld 408576698