Chromium Code Reviews| Index: chrome/browser/profile.cc |
| =================================================================== |
| --- chrome/browser/profile.cc (revision 9212) |
| +++ chrome/browser/profile.cc (working copy) |
| @@ -19,6 +19,7 @@ |
| #include "chrome/browser/profile_manager.h" |
| #include "chrome/browser/renderer_host/render_process_host.h" |
| #include "chrome/browser/search_engines/template_url_model.h" |
| +#include "chrome/browser/ssl/ssl_host_state.h" |
| #include "chrome/browser/visitedlink_master.h" |
| #include "chrome/browser/webdata/web_data_service.h" |
| #include "chrome/common/chrome_constants.h" |
| @@ -59,7 +60,7 @@ |
| // Profile::GetDefaultRequestContext. |
| URLRequestContext* Profile::default_request_context_; |
| -//static |
| +// static |
| void Profile::RegisterUserPrefs(PrefService* prefs) { |
| prefs->RegisterBooleanPref(prefs::kSearchSuggestEnabled, true); |
| prefs->RegisterBooleanPref(prefs::kSessionExitedCleanly, true); |
| @@ -76,12 +77,12 @@ |
| prefs->RegisterBooleanPref(prefs::kEnableSpellCheck, true); |
| } |
| -//static |
| +// static |
| Profile* Profile::CreateProfile(const FilePath& path) { |
| return new ProfileImpl(path); |
| } |
| -//static |
| +// static |
| URLRequestContext* Profile::GetDefaultRequestContext() { |
| return default_request_context_; |
| } |
| @@ -152,6 +153,14 @@ |
| return profile_->GetUserScriptMaster(); |
| } |
| + virtual SSLHostState* GetSSLHostState() { |
| + if (!ssl_host_state_.get()) |
| + ssl_host_state_.reset(new SSLHostState()); |
| + |
| + DCHECK(ssl_host_state_->CalledOnValidThread()); |
| + return ssl_host_state_.get(); |
| + } |
| + |
| virtual HistoryService* GetHistoryService(ServiceAccessType sat) { |
| if (sat == EXPLICIT_ACCESS) { |
| return profile_->GetHistoryService(sat); |
| @@ -306,6 +315,11 @@ |
| // The download manager that only stores downloaded items in memory. |
| scoped_refptr<DownloadManager> download_manager_; |
| + // We don't want SSLHostState from the OTR profile to leak back to the main |
| + // profile because then the main profile would learn some of the host names |
|
wtc
2009/02/12 21:41:46
I like this comment!
|
| + // the user visited while OTR. |
| + scoped_ptr<SSLHostState> ssl_host_state_; |
| + |
| // Time we were started. |
| Time start_time_; |
| @@ -343,7 +357,7 @@ |
| const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| bool user_scripts_enabled = |
| command_line->HasSwitch(switches::kEnableUserScripts); |
| - bool extensions_enabled = |
| + bool extensions_enabled = |
| command_line->HasSwitch(switches::kEnableExtensions); |
| FilePath script_dir; |
| @@ -499,6 +513,14 @@ |
| return user_script_master_.get(); |
| } |
| +SSLHostState* ProfileImpl::GetSSLHostState() { |
| + if (!ssl_host_state_.get()) |
| + ssl_host_state_.reset(new SSLHostState()); |
| + |
| + DCHECK(ssl_host_state_->CalledOnValidThread()); |
| + return ssl_host_state_.get(); |
| +} |
| + |
| PrefService* ProfileImpl::GetPrefs() { |
| if (!prefs_.get()) { |
| prefs_.reset(new PrefService(GetPrefFilePath().ToWStringHack())); |
| @@ -684,7 +706,7 @@ |
| tab_restore_service_ = NULL; |
| } |
| -// To be run in the IO thread to notify all resource message filters that the |
| +// To be run in the IO thread to notify all resource message filters that the |
| // spellchecker has changed. |
| class NotifySpellcheckerChangeTask : public Task { |
| public: |
| @@ -728,7 +750,7 @@ |
| if (enable_spellcheck) { |
| std::wstring dict_dir; |
| PathService::Get(chrome::DIR_APP_DICTIONARIES, &dict_dir); |
| - // Note that, as the object pointed to by previously by spellchecker_ |
| + // Note that, as the object pointed to by previously by spellchecker_ |
| // is being deleted in the io thread, the spellchecker_ can be made to point |
| // to a new object (RE-initialized) in parallel in this UI thread. |
| spellchecker_ = new SpellChecker(dict_dir, |
| @@ -744,7 +766,7 @@ |
| scoped_spellchecker.spellchecker = spellchecker_; |
| if (io_thread) { |
| io_thread->message_loop()->PostTask( |
| - FROM_HERE, |
| + FROM_HERE, |
| new NotifySpellcheckerChangeTask(this, scoped_spellchecker)); |
| } |
| } |
| @@ -759,7 +781,7 @@ |
| // This is where spellchecker gets initialized. Note that this is being |
| // initialized in the ui_thread. However, this is not a problem as long as |
| // it is *used* in the io thread. |
| - // TODO (sidchat) One day, change everything so that spellchecker gets |
| + // TODO(sidchat): One day, change everything so that spellchecker gets |
| // initialized in the IO thread itself. |
| InitializeSpellChecker(false); |
| } |