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

Unified Diff: chrome/browser/net/resource_prefetch_interceptor.h

Issue 10416002: Seculative resource prefetching for URLs CL. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/net/resource_prefetch_interceptor.h
diff --git a/chrome/browser/net/resource_prefetch_interceptor.h b/chrome/browser/net/resource_prefetch_interceptor.h
new file mode 100644
index 0000000000000000000000000000000000000000..fca51971b502534013f4d590b75f5eda1631058e
--- /dev/null
+++ b/chrome/browser/net/resource_prefetch_interceptor.h
@@ -0,0 +1,49 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_NET_RESOURCE_PREFETCH_INTERCEPTOR_H_
+#define CHROME_BROWSER_NET_RESOURCE_PREFETCH_INTERCEPTOR_H_
+#pragma once
+
+#include "base/basictypes.h"
+#include "base/memory/ref_counted.h"
+#include "chrome/browser/predictors/resource_prefetch_predictor.h"
+#include "net/url_request/url_request_job_factory.h"
dominich 2012/05/21 16:16:53 nit: this include should be first as it defines th
Shishir 2012/05/23 01:46:46 No longer required.
+
+namespace predictors {
+class URLRequestSummary;
+}
+
+namespace chrome_browser_net {
+
+class ResourcePrefetchInterceptor
+ : public net::URLRequestJobFactory::Interceptor {
willchan no longer on Chromium 2012/05/21 20:20:18 No, do not use this interface. You're not intercep
Shishir 2012/05/23 01:46:46 Done,
+ public:
+ explicit ResourcePrefetchInterceptor(
+ scoped_refptr<predictors::ResourcePrefetchPredictor> predictor);
+ virtual ~ResourcePrefetchInterceptor();
+
+ protected:
+ virtual net::URLRequestJob* MaybeIntercept(
+ net::URLRequest* request) const OVERRIDE;
+ virtual net::URLRequestJob* MaybeInterceptResponse(
+ net::URLRequest* request) const OVERRIDE;
+ virtual net::URLRequestJob* MaybeInterceptRedirect(
+ const GURL& location, net::URLRequest* request) const OVERRIDE;
+
+ private:
+ void Intercept(
+ net::URLRequest* request,
+ bool is_response,
+ void(predictors::ResourcePrefetchPredictor::*InterceptFunction)
+ (const predictors::ResourcePrefetchPredictor::URLRequestSummary&)) const;
+
+ scoped_refptr<predictors::ResourcePrefetchPredictor> predictor_;
willchan no longer on Chromium 2012/05/21 20:20:18 Does ResourcePrefetchInterceptor own predictors::R
Shishir 2012/05/23 01:46:46 ResourcePrefetchPredictor is refcounted as it need
+
+ DISALLOW_COPY_AND_ASSIGN(ResourcePrefetchInterceptor);
+};
+
+} // namespace chrome_browser_net
+
+#endif // CHROME_BROWSER_NET_RESOURCE_PREFETCH_INTERCEPTOR_H_

Powered by Google App Engine
This is Rietveld 408576698