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

Unified Diff: chrome/browser/profiles/profile.cc

Issue 7467012: Modifying prefetch to account for multi-profile. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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/profiles/profile.cc
===================================================================
--- chrome/browser/profiles/profile.cc (revision 89645)
+++ chrome/browser/profiles/profile.cc (working copy)
@@ -23,6 +23,8 @@
#include "chrome/browser/extensions/extension_process_manager.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_special_storage_policy.h"
+#include "chrome/browser/io_thread.h"
+#include "chrome/browser/net/predictor_api.h"
#include "chrome/browser/net/pref_proxy_config_service.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/off_the_record_profile_io_data.h"
@@ -208,6 +210,43 @@
////////////////////////////////////////////////////////////////////////////////
//
+// This section supports the about:dns page.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+// Provide global support for the about:dns page.
+void Profile::PredictorGetHtmlInfo(std::string* output) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+
+ output->append("<html><head><title>About DNS</title>"
+ // We'd like the following no-cache... but it doesn't work.
+ // "<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">"
+ "</head><body>");
+ chrome_browser_net::Predictor* predictor = GetPredictor();
+ if (predictor && predictor->predictor_enabled()) {
Miranda Callahan 2011/07/21 14:38:04 Isn't there be a race condition here if you allow
rpetterson 2011/08/10 02:24:46 I've fixed EnablePredictor to post a task to enabl
+ output->append("DNS pre-resolution and TCP pre-connection is disabled.");
+ } else {
+ if (!predictor->on_the_record()) {
+ output->append("Incognito mode is active in a window.");
+ } else {
+ // Show list of prediction results.
+ predictor->GetHtmlInfo(output);
+ }
+ }
+ output->append("</body></html>");
+}
+
+void Profile::PredictorOnTheRecord(bool enable) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ if (GetPredictor()->on_the_record() == enable)
+ return;
+ GetPredictor()->SetOnTheRecord(enable);
+ if (GetPredictor()->on_the_record())
+ g_browser_process->io_thread()->ChangedToOnTheRecord(this);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
// OffTheRecordProfileImpl is a profile subclass that wraps an existing profile
// to make it suitable for the incognito mode.
//

Powered by Google App Engine
This is Rietveld 408576698