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

Unified Diff: chrome/browser/renderer_host/chrome_render_view_host_observer.cc

Issue 7467012: Modifying prefetch to account for multi-profile. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Modifying prefetch to account for multi-profile. Created 9 years, 3 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/renderer_host/chrome_render_view_host_observer.cc
===================================================================
--- chrome/browser/renderer_host/chrome_render_view_host_observer.cc (revision 100345)
+++ chrome/browser/renderer_host/chrome_render_view_host_observer.cc (working copy)
@@ -7,7 +7,7 @@
#include "base/command_line.h"
#include "chrome/browser/dom_operation_notification_details.h"
#include "chrome/browser/extensions/extension_service.h"
-#include "chrome/browser/net/predictor_api.h"
+#include "chrome/browser/net/predictor.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h"
@@ -24,8 +24,9 @@
#include "content/common/view_messages.h"
ChromeRenderViewHostObserver::ChromeRenderViewHostObserver(
- RenderViewHost* render_view_host)
- : RenderViewHostObserver(render_view_host) {
+ RenderViewHost* render_view_host, chrome_browser_net::Predictor* predictor)
+ : RenderViewHostObserver(render_view_host),
+ predictor_(predictor) {
InitRenderViewHostForExtensions();
}
@@ -39,9 +40,11 @@
void ChromeRenderViewHostObserver::Navigate(
const ViewMsg_Navigate_Params& params) {
const GURL& url = params.url;
+ if (!predictor_)
+ return;
if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kChromeFrame) &&
- (url.SchemeIs(chrome::kHttpScheme) || url.SchemeIs(chrome::kHttpsScheme)))
- chrome_browser_net::PreconnectUrlAndSubresources(url);
+ (url.SchemeIs(chrome::kHttpScheme) || url.SchemeIs(chrome::kHttpsScheme)))
+ predictor_->PreconnectUrlAndSubresources(url);
}
bool ChromeRenderViewHostObserver::OnMessageReceived(

Powered by Google App Engine
This is Rietveld 408576698