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

Unified Diff: chrome/browser/extensions/autoupdate_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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/autoupdate_interceptor.h
diff --git a/chrome/browser/extensions/autoupdate_interceptor.h b/chrome/browser/extensions/autoupdate_interceptor.h
deleted file mode 100644
index cfc0659087bcb475bcda427fea6c220ae487061e..0000000000000000000000000000000000000000
--- a/chrome/browser/extensions/autoupdate_interceptor.h
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
willchan no longer on Chromium 2012/12/11 19:23:34 Why is this not marked [D]eleted?
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_EXTENSIONS_AUTOUPDATE_INTERCEPTOR_H_
-#define CHROME_BROWSER_EXTENSIONS_AUTOUPDATE_INTERCEPTOR_H_
-
-#include <map>
-#include <string>
-
-#include "googleurl/src/gurl.h"
-#include "net/url_request/url_request.h"
-
-namespace extensions {
-
-// This url request interceptor lets us respond to localhost http request urls
-// with the contents of files on disk for use in tests.
-class AutoUpdateInterceptor
- : public net::URLRequest::Interceptor,
- public base::RefCountedThreadSafe<AutoUpdateInterceptor> {
- public:
- AutoUpdateInterceptor();
-
- // When computing matches, this ignores query parameters (since the autoupdate
- // fetch code appends a bunch of them to manifest fetches).
- virtual net::URLRequestJob* MaybeIntercept(
- net::URLRequest* request,
- net::NetworkDelegate* network_delegate) OVERRIDE;
-
- // When requests for |url| arrive, respond with the contents of |path|. The
- // hostname of |url| must be "localhost" to avoid DNS lookups, and the scheme
- // must be "http" so MaybeIntercept can ignore "chrome" and other schemes.
- // Also, the match for |url| will ignore any query parameters.
- void SetResponse(const std::string url, const FilePath& path);
-
- // A helper function to call SetResponse on the I/O thread.
- void SetResponseOnIOThread(const std::string url, const FilePath& path);
-
- private:
- friend class base::RefCountedThreadSafe<AutoUpdateInterceptor>;
-
- virtual ~AutoUpdateInterceptor();
-
- std::map<GURL, FilePath> responses_;
-
- DISALLOW_COPY_AND_ASSIGN(AutoUpdateInterceptor);
-};
-
-} // namespace extensions
-
-#endif // CHROME_BROWSER_EXTENSIONS_AUTOUPDATE_INTERCEPTOR_H_

Powered by Google App Engine
This is Rietveld 408576698