diff options
author | rogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-22 18:44:05 +0000 |
---|---|---|
committer | rogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-22 18:44:05 +0000 |
commit | 59f994ca94ee8bcb4e87467eed3d3f50b358fd5a (patch) | |
tree | 50716a661a9af6ed5a21b06ac71a8d62b8524b7c /chrome/browser/rlz/rlz.cc | |
parent | fab6ffba259d7ee0a88680279d2f947ccd228c2c (diff) | |
download | chromium_src-59f994ca94ee8bcb4e87467eed3d3f50b358fd5a.zip chromium_src-59f994ca94ee8bcb4e87467eed3d3f50b358fd5a.tar.gz chromium_src-59f994ca94ee8bcb4e87467eed3d3f50b358fd5a.tar.bz2 |
After a successful ping of the RLZ server, make sure to update the cached
RLZ strings for the omnibox and home page access points instead of just
invalidating, so that the first time the code tries to use the strings after
the ping they are valid.
BUG=None
TEST=Install chrome. Chrome will start automatically, do not stop it.
Wait for the RLZ ping to be sent. Perform a search with the omnibox
and make sure an rlz= CGI parameter is present. Visit the home page and
make the request contains an X-Rlz-String HTTP header.
To perform these tests, install an official chrome build with a non-organic
brand code.
Review URL: http://codereview.chromium.org/7980013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102321 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/rlz/rlz.cc')
-rw-r--r-- | chrome/browser/rlz/rlz.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/chrome/browser/rlz/rlz.cc b/chrome/browser/rlz/rlz.cc index ea208a3..f6f720e 100644 --- a/chrome/browser/rlz/rlz.cc +++ b/chrome/browser/rlz/rlz.cc @@ -246,7 +246,7 @@ void _cdecl RLZTracker::PingNow(void* arg) { } void RLZTracker::PingNowImpl() { - // Needs to be evaluated. See http://crbug.com/62328. + // This is the entry point of a background thread, so I/O is allowed. base::ThreadRestrictions::ScopedAllowIO allow_io; std::wstring lang; @@ -259,8 +259,15 @@ void RLZTracker::PingNowImpl() { GoogleUpdateSettings::GetReferral(&referral); if (SendFinancialPing(brand, lang, referral, is_organic(brand))) { GoogleUpdateSettings::ClearReferral(); - base::AutoLock lock(cache_lock_); - rlz_cache_.clear(); + + { + base::AutoLock lock(cache_lock_); + rlz_cache_.clear(); + } + + // Prime the RLZ cache for the access points we are interested in. + GetAccessPointRlz(rlz_lib::CHROME_OMNIBOX, NULL); + GetAccessPointRlz(rlz_lib::CHROME_HOME_PAGE, NULL); } } @@ -378,7 +385,7 @@ bool RLZTracker::GetAccessPointRlzImpl(rlz_lib::AccessPoint point, } bool RLZTracker::ScheduleGetAccessPointRlz(rlz_lib::AccessPoint point) { - if (BrowserThread::CurrentlyOn(BrowserThread::FILE)) + if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) return false; std::wstring* not_used = NULL; |