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

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

Issue 12163003: Add FilePath to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/test/net/url_request_mock_http_job.h ('k') | content/utility/utility_thread_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_INTERCEPTOR_H_ 5 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_INTERCEPTOR_H_
6 #define CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_INTERCEPTOR_H_ 6 #define CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_INTERCEPTOR_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 9
10 class GURL;
11
12 namespace base {
10 class FilePath; 13 class FilePath;
11 class GURL; 14 }
12 15
13 namespace content { 16 namespace content {
14 17
15 // Intercepts HTTP requests and gives pre-defined responses to specified URLs. 18 // Intercepts HTTP requests and gives pre-defined responses to specified URLs.
16 // The pre-defined responses are loaded from files on disk. The interception 19 // The pre-defined responses are loaded from files on disk. The interception
17 // occurs while the URLRequestPrepackagedInterceptor is alive. 20 // occurs while the URLRequestPrepackagedInterceptor is alive.
18 class URLRequestPrepackagedInterceptor { 21 class URLRequestPrepackagedInterceptor {
19 public: 22 public:
20 URLRequestPrepackagedInterceptor(); 23 URLRequestPrepackagedInterceptor();
21 virtual ~URLRequestPrepackagedInterceptor(); 24 virtual ~URLRequestPrepackagedInterceptor();
22 25
23 // When requests for |url| arrive, respond with the contents of |path|. The 26 // When requests for |url| arrive, respond with the contents of |path|. The
24 // hostname of |url| must be "localhost" to avoid DNS lookups, and the scheme 27 // hostname of |url| must be "localhost" to avoid DNS lookups, and the scheme
25 // must be "http". 28 // must be "http".
26 void SetResponse(const GURL& url, const FilePath& path); 29 void SetResponse(const GURL& url, const base::FilePath& path);
27 30
28 // Identical to SetResponse except that query parameters are ignored on 31 // Identical to SetResponse except that query parameters are ignored on
29 // incoming URLs when comparing against |url|. 32 // incoming URLs when comparing against |url|.
30 void SetResponseIgnoreQuery(const GURL& url, const FilePath& path); 33 void SetResponseIgnoreQuery(const GURL& url, const base::FilePath& path);
31 34
32 // Returns how many requests have been issued that have a stored reply. 35 // Returns how many requests have been issued that have a stored reply.
33 int GetHitCount(); 36 int GetHitCount();
34 37
35 private: 38 private:
36 class Delegate; 39 class Delegate;
37 40
38 // After creation, |delegate_| lives on the IO thread, and a task to delete 41 // After creation, |delegate_| lives on the IO thread, and a task to delete
39 // it is posted from ~URLRequestPrepackagedInterceptor(). 42 // it is posted from ~URLRequestPrepackagedInterceptor().
40 Delegate* delegate_; 43 Delegate* delegate_;
41 44
42 DISALLOW_COPY_AND_ASSIGN(URLRequestPrepackagedInterceptor); 45 DISALLOW_COPY_AND_ASSIGN(URLRequestPrepackagedInterceptor);
43 }; 46 };
44 47
45 } // namespace content 48 } // namespace content
46 49
47 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_INTERCEPTOR_H_ 50 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_INTERCEPTOR_H_
OLDNEW
« no previous file with comments | « content/test/net/url_request_mock_http_job.h ('k') | content/utility/utility_thread_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698