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

Side by Side Diff: chrome/browser/rlz/rlz.cc

Issue 3200: Load RLZ in 20 seconds instead of 100 seconds.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // This code glues the RLZ library DLL with Chrome. It allows Chrome to work 5 // This code glues the RLZ library DLL with Chrome. It allows Chrome to work
6 // with or without the DLL being present. If the DLL is not present the 6 // with or without the DLL being present. If the DLL is not present the
7 // functions do nothing and just return false. 7 // functions do nothing and just return false.
8 8
9 #include "chrome/browser/rlz/rlz.h" 9 #include "chrome/browser/rlz/rlz.h"
10 10
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 : directory_key_(directory_key), first_run_(first_run) { 145 : directory_key_(directory_key), first_run_(first_run) {
146 } 146 }
147 virtual ~DelayedInitTask() { 147 virtual ~DelayedInitTask() {
148 } 148 }
149 virtual void Run() { 149 virtual void Run() {
150 if (!LoadRLZLibrary(directory_key_)) 150 if (!LoadRLZLibrary(directory_key_))
151 return; 151 return;
152 // For non-interactive tests we don't do the rest of the initialization. 152 // For non-interactive tests we don't do the rest of the initialization.
153 if (::GetEnvironmentVariableW(env_vars::kHeadless, NULL, 0)) 153 if (::GetEnvironmentVariableW(env_vars::kHeadless, NULL, 0))
154 return; 154 return;
155 if (first_run_) { 155
156 std::wstring omnibox_rlz;
157 RLZTracker::GetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, &omnibox_rlz);
158
159 if (first_run_ || omnibox_rlz.empty()) {
156 // Record the installation of chrome. 160 // Record the installation of chrome.
157 RLZTracker::RecordProductEvent(RLZTracker::CHROME, 161 RLZTracker::RecordProductEvent(RLZTracker::CHROME,
158 RLZTracker::CHROME_OMNIBOX, 162 RLZTracker::CHROME_OMNIBOX,
159 RLZTracker::INSTALL); 163 RLZTracker::INSTALL);
160 RLZTracker::RecordProductEvent(RLZTracker::CHROME, 164 RLZTracker::RecordProductEvent(RLZTracker::CHROME,
161 RLZTracker::CHROME_HOME_PAGE, 165 RLZTracker::CHROME_HOME_PAGE,
162 RLZTracker::INSTALL); 166 RLZTracker::INSTALL);
163 // Record if google is the initial search provider. 167 // Record if google is the initial search provider.
164 if (IsGoogleDefaultSearch()) { 168 if (IsGoogleDefaultSearch()) {
165 RLZTracker::RecordProductEvent(RLZTracker::CHROME, 169 RLZTracker::RecordProductEvent(RLZTracker::CHROME,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 }; 201 };
198 202
199 } // namespace 203 } // namespace
200 204
201 bool RLZTracker::InitRlz(int directory_key) { 205 bool RLZTracker::InitRlz(int directory_key) {
202 return LoadRLZLibrary(directory_key); 206 return LoadRLZLibrary(directory_key);
203 } 207 }
204 208
205 bool RLZTracker::InitRlzDelayed(int directory_key, bool first_run) { 209 bool RLZTracker::InitRlzDelayed(int directory_key, bool first_run) {
206 // Schedule the delayed init items. 210 // Schedule the delayed init items.
207 const int kOneHundredSeconds = 100000; 211 const int kTwentySeconds = 20 * 1000;
208 MessageLoop::current()->PostDelayedTask(FROM_HERE, 212 MessageLoop::current()->PostDelayedTask(FROM_HERE,
209 new DelayedInitTask(directory_key, first_run), kOneHundredSeconds); 213 new DelayedInitTask(directory_key, first_run), kTwentySeconds);
210 return true; 214 return true;
211 } 215 }
212 216
213 bool RLZTracker::RecordProductEvent(Product product, AccessPoint point, 217 bool RLZTracker::RecordProductEvent(Product product, AccessPoint point,
214 Event event) { 218 Event event) {
215 return (record_event) ? record_event(product, point, event, NULL) : false; 219 return (record_event) ? record_event(product, point, event, NULL) : false;
216 } 220 }
217 221
218 bool RLZTracker::ClearAllProductEvents(Product product) { 222 bool RLZTracker::ClearAllProductEvents(Product product) {
219 return (clear_all_events) ? clear_all_events(product, NULL) : false; 223 return (clear_all_events) ? clear_all_events(product, NULL) : false;
(...skipping 26 matching lines...) Expand all
246 bool RLZTracker::SendFinancialPing(Product product, 250 bool RLZTracker::SendFinancialPing(Product product,
247 const wchar_t* product_signature, 251 const wchar_t* product_signature,
248 const wchar_t* product_brand, 252 const wchar_t* product_brand,
249 const wchar_t* product_id, 253 const wchar_t* product_id,
250 const wchar_t* product_lang) { 254 const wchar_t* product_lang) {
251 AccessPoint points[] = {CHROME_OMNIBOX, CHROME_HOME_PAGE, NO_ACCESS_POINT}; 255 AccessPoint points[] = {CHROME_OMNIBOX, CHROME_HOME_PAGE, NO_ACCESS_POINT};
252 return (send_ping) ? send_ping(product, points, product_signature, 256 return (send_ping) ? send_ping(product, points, product_signature,
253 product_brand, product_id, product_lang, NULL) : false; 257 product_brand, product_id, product_lang, NULL) : false;
254 } 258 }
255 259
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698