OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 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 #include "chrome/browser/net/prerender_interceptor.h" | 5 #include "chrome/browser/net/prerender_interceptor.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "chrome/browser/browser_thread.h" | 10 #include "chrome/browser/browser_thread.h" |
11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
12 #include "chrome/browser/io_thread.h" | 12 #include "chrome/browser/io_thread.h" |
13 #include "googleurl/src/gurl.h" | 13 #include "googleurl/src/gurl.h" |
14 #include "net/base/load_flags.h" | 14 #include "net/base/load_flags.h" |
15 | 15 |
16 DISABLE_RUNNABLE_METHOD_REFCOUNT(chrome_browser_net::PrerenderInterceptor); | 16 DISABLE_RUNNABLE_METHOD_REFCOUNT(chrome_browser_net::PrerenderInterceptor); |
17 | 17 |
18 namespace chrome_browser_net { | 18 namespace chrome_browser_net { |
19 | 19 |
20 PrerenderInterceptor::PrerenderInterceptor() | 20 PrerenderInterceptor::PrerenderInterceptor() |
21 : ALLOW_THIS_IN_INITIALIZER_LIST( | 21 : ALLOW_THIS_IN_INITIALIZER_LIST( |
22 callback_(NewCallback(this, | 22 callback_(NewCallback(this, |
23 &PrerenderInterceptor::PrerenderDispatch))) { | 23 &PrerenderInterceptor::PrerenderDispatch))) { |
24 URLRequest::RegisterRequestInterceptor(this); | 24 net::URLRequest::RegisterRequestInterceptor(this); |
25 } | 25 } |
26 | 26 |
27 PrerenderInterceptor::PrerenderInterceptor( | 27 PrerenderInterceptor::PrerenderInterceptor( |
28 PrerenderInterceptorCallback* callback) | 28 PrerenderInterceptorCallback* callback) |
29 : callback_(callback) { | 29 : callback_(callback) { |
30 URLRequest::RegisterRequestInterceptor(this); | 30 net::URLRequest::RegisterRequestInterceptor(this); |
31 } | 31 } |
32 | 32 |
33 PrerenderInterceptor::~PrerenderInterceptor() { | 33 PrerenderInterceptor::~PrerenderInterceptor() { |
34 URLRequest::UnregisterRequestInterceptor(this); | 34 net::URLRequest::UnregisterRequestInterceptor(this); |
35 } | 35 } |
36 | 36 |
37 net::URLRequestJob* PrerenderInterceptor::MaybeIntercept( | 37 net::URLRequestJob* PrerenderInterceptor::MaybeIntercept( |
38 net::URLRequest* request) { | 38 net::URLRequest* request) { |
39 return NULL; | 39 return NULL; |
40 } | 40 } |
41 | 41 |
42 net::URLRequestJob* PrerenderInterceptor::MaybeInterceptResponse( | 42 net::URLRequestJob* PrerenderInterceptor::MaybeInterceptResponse( |
43 net::URLRequest* request) { | 43 net::URLRequest* request) { |
44 // TODO(gavinp): unfortunately, we can't figure out the origin | 44 // TODO(gavinp): unfortunately, we can't figure out the origin |
(...skipping 25 matching lines...) Expand all Loading... |
70 } | 70 } |
71 | 71 |
72 void PrerenderInterceptor::PrerenderDispatch( | 72 void PrerenderInterceptor::PrerenderDispatch( |
73 const GURL& url) { | 73 const GURL& url) { |
74 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 74 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
75 DVLOG(2) << "PrerenderDispatchOnUIThread: url=" << url; | 75 DVLOG(2) << "PrerenderDispatchOnUIThread: url=" << url; |
76 } | 76 } |
77 | 77 |
78 } // namespace chrome_browser_net | 78 } // namespace chrome_browser_net |
79 | 79 |
OLD | NEW |