summaryrefslogtreecommitdiffstats
path: root/chrome/browser/rlz
diff options
context:
space:
mode:
authorcpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-23 20:34:33 +0000
committercpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-23 20:34:33 +0000
commit0aaaa256de3da10ffdb145bfd12dc0d51933c4bb (patch)
treeca99448294f9404c0afbfafe120a1985a2329415 /chrome/browser/rlz
parent616bacb20b3b415fac061e34101be6ce0a882904 (diff)
downloadchromium_src-0aaaa256de3da10ffdb145bfd12dc0d51933c4bb.zip
chromium_src-0aaaa256de3da10ffdb145bfd12dc0d51933c4bb.tar.gz
chromium_src-0aaaa256de3da10ffdb145bfd12dc0d51933c4bb.tar.bz2
Try to re-land issue 3200
- it was causing trouble in the distributed tests - now does not try to load the dll in headless configs Review URL: http://codereview.chromium.org/4233 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2520 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/rlz')
-rw-r--r--chrome/browser/rlz/rlz.cc20
1 files changed, 13 insertions, 7 deletions
diff --git a/chrome/browser/rlz/rlz.cc b/chrome/browser/rlz/rlz.cc
index b319626..72db942 100644
--- a/chrome/browser/rlz/rlz.cc
+++ b/chrome/browser/rlz/rlz.cc
@@ -103,7 +103,7 @@ bool LoadRLZLibrary(int directory_key) {
WireExport<ClearAllProductEventsFn>(rlz_dll, "ClearAllProductEvents");
send_ping =
WireExport<SendFinancialPingFn>(rlz_dll, "SendFinancialPing");
- return true;
+ return (record_event && get_access_point && clear_all_events && send_ping);
}
return false;
}
@@ -147,12 +147,18 @@ class DelayedInitTask : public Task {
virtual ~DelayedInitTask() {
}
virtual void Run() {
- if (!LoadRLZLibrary(directory_key_))
- return;
- // For non-interactive tests we don't do the rest of the initialization.
+ // For non-interactive tests we don't do the rest of the initialization
+ // because sometimes the very act of loading the dll causes QEMU to crash.
if (::GetEnvironmentVariableW(env_vars::kHeadless, NULL, 0))
return;
- if (first_run_) {
+ if (!LoadRLZLibrary(directory_key_))
+ return;
+ // Do the initial event recording if is the first run or if we have an
+ // empty rlz which means we haven't got a chance to do it.
+ std::wstring omnibox_rlz;
+ RLZTracker::GetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, &omnibox_rlz);
+
+ if (first_run_ || omnibox_rlz.empty()) {
// Record the installation of chrome.
RLZTracker::RecordProductEvent(RLZTracker::CHROME,
RLZTracker::CHROME_OMNIBOX,
@@ -204,9 +210,9 @@ bool RLZTracker::InitRlz(int directory_key) {
bool RLZTracker::InitRlzDelayed(int directory_key, bool first_run) {
// Schedule the delayed init items.
- const int kOneHundredSeconds = 100000;
+ const int kTwentySeconds = 20 * 1000;
MessageLoop::current()->PostDelayedTask(FROM_HERE,
- new DelayedInitTask(directory_key, first_run), kOneHundredSeconds);
+ new DelayedInitTask(directory_key, first_run), kTwentySeconds);
return true;
}