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

Side by Side Diff: content/test/net/url_request_prepackaged_interceptor.h

Issue 11293252: Change Interceptors into URLRequestJobFactory::ProtocolHandlers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address erikwright's third round of comments Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_INTERCEPTOR_H_
6 #define CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_INTERCEPTOR_H_
7
8 #include <string>
9
10 #include "base/basictypes.h"
11
12 class FilePath;
13
14 namespace content {
15
16 // Intercepts HTTP requests and gives pre-defined responses to specified URLs.
17 // The pre-defined responses are loaded from files on disk. The interception
18 // occurs while the URLRequestPrepackagedInterceptor is alive.
19 class URLRequestPrepackagedInterceptor {
20 public:
21 URLRequestPrepackagedInterceptor();
22 virtual ~URLRequestPrepackagedInterceptor();
23
24 // When requests for |url| arrive, respond with the contents of |path|. The
25 // hostname of |url| must be "localhost" to avoid DNS lookups, and the scheme
26 // must be "http".
27 void SetResponse(const std::string& url,
28 const FilePath& path);
29
30 // Identical to SetResponse except that query parameters are ignored on
31 // incoming URLs when comparing against |url|.
32 void SetResponseIgnoreQuery(const std::string& url,
33 const FilePath& path);
mmenke 2012/12/11 17:22:38 nit: Could use a single line here and above.
34
35 // Returns how many requests have been issued that have a stored reply.
36 int GetHitCount();
37
38 private:
39 class Delegate;
40
41 Delegate* delegate_;
mmenke 2012/12/11 17:22:38 Think it's worth mentioning that after creation, t
42
43 DISALLOW_COPY_AND_ASSIGN(URLRequestPrepackagedInterceptor);
44 };
45
46 } // namespace content
47
48 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_INTERCEPTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698