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

Side by Side Diff: chrome/browser/component_updater/component_updater_interceptor.h

Issue 10855209: Refactoring: ProtocolHandler::MaybeCreateJob takes NetworkDelegate as argument (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Latest merge Created 8 years, 4 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
OLDNEW
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_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 <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 19 matching lines...) Expand all
30 // must be "http". 30 // must be "http".
31 void SetResponse(const std::string& url, 31 void SetResponse(const std::string& url,
32 const std::string& headers, 32 const std::string& headers,
33 const FilePath& path); 33 const FilePath& path);
34 34
35 // 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.
36 int hit_count() const { return hit_count_; } 36 int hit_count() const { return hit_count_; }
37 37
38 private: 38 private:
39 // When computing matches, this ignores the query parameters of the url. 39 // When computing matches, this ignores the query parameters of the url.
40 virtual net::URLRequestJob* MaybeIntercept(net::URLRequest* request) OVERRIDE; 40 virtual net::URLRequestJob* MaybeIntercept(
41 net::URLRequest* request,
42 net::NetworkDelegate* network_delegate) OVERRIDE;
41 43
42 friend class base::RefCountedThreadSafe<ComponentUpdateInterceptor>; 44 friend class base::RefCountedThreadSafe<ComponentUpdateInterceptor>;
43 45
44 virtual ~ComponentUpdateInterceptor(); 46 virtual ~ComponentUpdateInterceptor();
45 47
46 struct Response { 48 struct Response {
47 FilePath data_path; 49 FilePath data_path;
48 std::string headers; 50 std::string headers;
49 }; 51 };
50 52
51 typedef std::map<GURL, Response> ResponseMap; 53 typedef std::map<GURL, Response> ResponseMap;
52 ResponseMap responses_; 54 ResponseMap responses_;
53 int hit_count_; 55 int hit_count_;
54 56
55 DISALLOW_COPY_AND_ASSIGN(ComponentUpdateInterceptor); 57 DISALLOW_COPY_AND_ASSIGN(ComponentUpdateInterceptor);
56 }; 58 };
57 59
58 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_INTERCEPTOR_H_ 60 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_INTERCEPTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698