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

Unified Diff: chrome/browser/search_engines/search_provider_install_data.cc

Issue 7558014: Add a URL param to indicate group selection in Instant field trial. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Thread safe handling of Profiles Created 9 years, 4 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/search_engines/search_provider_install_data.cc
diff --git a/chrome/browser/search_engines/search_provider_install_data.cc b/chrome/browser/search_engines/search_provider_install_data.cc
index 4f9994ecd1ed71dc63e60ff29a7d7e21ef2ae542..3522aabe1d5a9a106f52ca59d27e1d219a9736a3 100644
--- a/chrome/browser/search_engines/search_provider_install_data.cc
+++ b/chrome/browser/search_engines/search_provider_install_data.cc
@@ -104,7 +104,8 @@ class GoogleURLObserver : public NotificationObserver {
GoogleURLObserver(
GoogleURLChangeNotifier* change_notifier,
int ui_death_notification,
- const NotificationSource& ui_death_source);
+ const NotificationSource& ui_death_source,
+ Profile* profile);
// Implementation of NotificationObserver.
virtual void Observe(int type,
@@ -116,6 +117,7 @@ class GoogleURLObserver : public NotificationObserver {
scoped_refptr<GoogleURLChangeNotifier> change_notifier_;
NotificationRegistrar registrar_;
+ Profile* const profile_;
DISALLOW_COPY_AND_ASSIGN(GoogleURLObserver);
};
@@ -123,8 +125,10 @@ class GoogleURLObserver : public NotificationObserver {
GoogleURLObserver::GoogleURLObserver(
GoogleURLChangeNotifier* change_notifier,
int ui_death_notification,
- const NotificationSource& ui_death_source)
- : change_notifier_(change_notifier) {
+ const NotificationSource& ui_death_source,
+ Profile* profile)
+ : change_notifier_(change_notifier),
+ profile_(profile) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
registrar_.Add(this, chrome::NOTIFICATION_GOOGLE_URL_UPDATED,
NotificationService::AllSources());
@@ -137,8 +141,8 @@ void GoogleURLObserver::Observe(int type,
if (type == chrome::NOTIFICATION_GOOGLE_URL_UPDATED) {
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
NewRunnableMethod(change_notifier_.get(),
- &GoogleURLChangeNotifier::OnChange,
- UIThreadSearchTermsData().GoogleBaseURLValue()));
+ &GoogleURLChangeNotifier::OnChange,
+ UIThreadSearchTermsData(profile_).GoogleBaseURLValue()));
Peter Kasting 2011/08/10 20:54:06 Neither caller in this file is asking for the inst
} else {
// This must be the death notification.
delete this;
@@ -163,14 +167,15 @@ static bool IsSameOrigin(const GURL& requested_origin,
SearchProviderInstallData::SearchProviderInstallData(
WebDataService* web_service,
int ui_death_notification,
- const NotificationSource& ui_death_source)
+ const NotificationSource& ui_death_source,
+ Profile* profile)
: web_service_(web_service),
load_handle_(0),
- google_base_url_(UIThreadSearchTermsData().GoogleBaseURLValue()) {
+ google_base_url_(UIThreadSearchTermsData(profile).GoogleBaseURLValue()) {
// GoogleURLObserver is responsible for killing itself when
// the given notification occurs.
new GoogleURLObserver(new GoogleURLChangeNotifier(AsWeakPtr()),
- ui_death_notification, ui_death_source);
+ ui_death_notification, ui_death_source, profile);
DetachFromThread();
}

Powered by Google App Engine
This is Rietveld 408576698