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

Side by Side Diff: chrome/browser/prerender/prerender_interceptor.h

Issue 6111010: Remove PrerenderInterceptor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with trunk Created 9 years, 11 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 | « chrome/browser/io_thread.cc ('k') | chrome/browser/prerender/prerender_interceptor.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 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_PRERENDER_PRERENDER_INTERCEPTOR_H_
6 #define CHROME_BROWSER_PRERENDER_PRERENDER_INTERCEPTOR_H_
7
8 #include "base/basictypes.h"
9 #include "base/callback.h"
10 #include "base/scoped_ptr.h"
11 #include "base/task.h"
12 #include "net/url_request/url_request.h"
13
14 class GURL;
15
16 // The PrerenderInterceptor watches prefetch requests, and when
17 // they are for type text/html, notifies the prerendering
18 // system about the fetch so it may consider the URL.
19 class PrerenderInterceptor : public net::URLRequest::Interceptor {
20 public:
21 PrerenderInterceptor();
22 virtual ~PrerenderInterceptor();
23
24 // URLRequest::Interceptor overrides. We only care about
25 // MaybeInterceptResponse, but must capture MaybeIntercept since
26 // it is pure virtual.
27 virtual net::URLRequestJob* MaybeIntercept(net::URLRequest* request);
28 virtual net::URLRequestJob* MaybeInterceptResponse(net::URLRequest* request);
29
30 private:
31 friend class PrerenderInterceptorTest;
32
33 typedef Callback1<const GURL&>::Type PrerenderInterceptorCallback;
34
35 // This constructor is provided for the unit test only, to provide
36 // an an alternative dispatch target for the test only. The callback
37 // parameter is owned and deleted by this object.
38 explicit PrerenderInterceptor(PrerenderInterceptorCallback* callback);
39
40 void RunCallbackFromUIThread(const GURL& url);
41 void PrerenderDispatch(const GURL& url);
42
43 scoped_ptr<PrerenderInterceptorCallback> callback_;
44
45 DISALLOW_COPY_AND_ASSIGN(PrerenderInterceptor);
46 };
47
48 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_INTERCEPTOR_H_
49
OLDNEW
« no previous file with comments | « chrome/browser/io_thread.cc ('k') | chrome/browser/prerender/prerender_interceptor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698