| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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_EXTENSIONS_AUTOUPDATE_INTERCEPTOR_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_AUTOUPDATE_INTERCEPTOR_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_AUTOUPDATE_INTERCEPTOR_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_AUTOUPDATE_INTERCEPTOR_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "googleurl/src/gurl.h" | 11 #include "googleurl/src/gurl.h" |
| 12 #include "net/url_request/url_request.h" | 12 #include "net/url_request/url_request.h" |
| 13 | 13 |
| 14 namespace extensions { |
| 15 |
| 14 // This url request interceptor lets us respond to localhost http request urls | 16 // This url request interceptor lets us respond to localhost http request urls |
| 15 // with the contents of files on disk for use in tests. | 17 // with the contents of files on disk for use in tests. |
| 16 class AutoUpdateInterceptor | 18 class AutoUpdateInterceptor |
| 17 : public net::URLRequest::Interceptor, | 19 : public net::URLRequest::Interceptor, |
| 18 public base::RefCountedThreadSafe<AutoUpdateInterceptor> { | 20 public base::RefCountedThreadSafe<AutoUpdateInterceptor> { |
| 19 public: | 21 public: |
| 20 AutoUpdateInterceptor(); | 22 AutoUpdateInterceptor(); |
| 21 | 23 |
| 22 // When computing matches, this ignores query parameters (since the autoupdate | 24 // When computing matches, this ignores query parameters (since the autoupdate |
| 23 // fetch code appends a bunch of them to manifest fetches). | 25 // fetch code appends a bunch of them to manifest fetches). |
| (...skipping 11 matching lines...) Expand all Loading... |
| 35 private: | 37 private: |
| 36 friend class base::RefCountedThreadSafe<AutoUpdateInterceptor>; | 38 friend class base::RefCountedThreadSafe<AutoUpdateInterceptor>; |
| 37 | 39 |
| 38 virtual ~AutoUpdateInterceptor(); | 40 virtual ~AutoUpdateInterceptor(); |
| 39 | 41 |
| 40 std::map<GURL, FilePath> responses_; | 42 std::map<GURL, FilePath> responses_; |
| 41 | 43 |
| 42 DISALLOW_COPY_AND_ASSIGN(AutoUpdateInterceptor); | 44 DISALLOW_COPY_AND_ASSIGN(AutoUpdateInterceptor); |
| 43 }; | 45 }; |
| 44 | 46 |
| 47 } // namespace extensions |
| 48 |
| 45 #endif // CHROME_BROWSER_EXTENSIONS_AUTOUPDATE_INTERCEPTOR_H_ | 49 #endif // CHROME_BROWSER_EXTENSIONS_AUTOUPDATE_INTERCEPTOR_H_ |
| OLD | NEW |