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

Issue 9699054: rlz: Hook up on mac, switch to chrome's network stack on win. (Closed)

Created:
8 years, 9 months ago by Nico
Modified:
8 years, 8 months ago
CC:
chromium-reviews, Aaron Boodman, mihaip+watch_chromium.org, willchan no longer on Chromium, akalin
Visibility:
Public.

Description

rlz: Hook up on mac, switch to chrome's network stack on win. This CL conceptually does several things (most of them just one line). 1. Roll RLZ 105:118 106: Fix "expression result unused" warning caused by VERIFY() use. 107: rlz: Add an implementation of PingServer() that uses chrome's net stack. 108: Implement RlzValueStoreMac. 109: Move GetMachineId() to its own file. No intended behavior change. 110: Implement GetSystemTimeAsInt64() on mac. 111: Minor cleanups. 112: Don't pay a static initializer for expected_assertion_ when it's not used. 113: Rename rlz_lib2.cc and win/lib/rlz_lib.cc to win/lib/rlz_lib_win.cc 114: mac: Implement GetMachineId(). 115: mac: Implement the locking part of ScopedRlzValueStoreLock. 116: Tweaks to make the use of chrome's net stack forceable through gyp. 117: Push RLZ_NETWORK_IMPLEMENTATION_ define to dependent targets. 118: Use base::mac::ScopedNSAutorleasePool only on mac. 2. Change rlz.cpp to use the blocking pool instead of the file thread. 3. Enable on mac. 4. Switch to chrome's network stack on windows 5. Switch RlzSendFinancialPingFunction to be an AsyncExtensionFunction that calls SendFinancialPing on a worker thread. This is required because extension functions run with a MessageLoop, so the MessageLoop in SendFinancialPing in rlz would trigger an assert (and making that inner loop nestable seems like a very bad idea). This change also removes one instance of ScopedAllowIO and fixes a TODO. BUG=46579 TEST= 1.) Do an official chrome build 2.) Add gratuitous logging in rlz.cc and other places and check that by default: * The channel is reported as "stable" * The brand code is the empty string * This brand code counts as organic install * RLZ exits early. 3.) Create ~/Library/Google/Google\ Chrome\ Brand.plist and add e.g. the string "BRAND" for key KSBrandID, restart chrome. * Brand code is now "BRAND" (this depends on Chrome's Info.plist not having a KSBrandID key, which has precedence. Currently our Chromes seem to never have this key.) * A ping is scheduled, but nothing is sent. * Use the omnibox a little, which causes product events to be recorded. 4.) Restart chrome yet again, wait a bit. * Logging in "SendFinancialPing()" should print: pinging http://clients1.google.com:80/tools/pso/ping?as=chrome&brand=BRAND&pid=&hl=en&events=C1F,C1S&rep=2&rlz=C1:1C1_____enUS476,C2:1C2_____enUS476&id=0926C138C2EA77A791CB450D322D0183E5A8079300000001B5 ping completed! TBR=sky Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=129028

Patch Set 1 #

Patch Set 2 : . #

Patch Set 3 : . #

Patch Set 4 : rebase #

Patch Set 5 : rebase #

Patch Set 6 : foo #

Patch Set 7 : blocking pool #

Patch Set 8 : . #

Patch Set 9 : . #

Patch Set 10 : . #

Patch Set 11 : . #

Patch Set 12 : oops #

Patch Set 13 : . #

Total comments: 6

Patch Set 14 : comments #

Patch Set 15 : search terms & test #

Patch Set 16 : 116 #

Patch Set 17 : one more place #

Patch Set 18 : compile in (but do not use) rlz extension apis for non-branded builds #

Patch Set 19 : . #

Patch Set 20 : 117 #

Patch Set 21 : 118 #

Patch Set 22 : Forgot to enable a few tests on mac #

Patch Set 23 : extension on worker pool #

Patch Set 24 : . #

Patch Set 25 : last test should pass #

Total comments: 16

Patch Set 26 : comments #

Patch Set 27 : different thread #

Patch Set 28 : rebase #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+251 lines, -114 lines) Patch
M DEPS View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 1 chunk +1 line, -1 line 0 comments Download
M build/common.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +7 lines, -0 lines 0 comments Download
M chrome/browser/browser_shutdown.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +4 lines, -1 line 0 comments Download
M chrome/browser/chrome_browser_main.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 4 chunks +7 lines, -4 lines 0 comments Download
M chrome/browser/extensions/extension_function_registry.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/rlz/rlz.h View 1 2 3 4 5 6 7 8 9 10 14 15 16 17 4 chunks +7 lines, -2 lines 0 comments Download
M chrome/browser/rlz/rlz.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 6 chunks +31 lines, -14 lines 2 comments Download
M chrome/browser/rlz/rlz_extension_api.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 3 chunks +21 lines, -3 lines 0 comments Download
M chrome/browser/rlz/rlz_extension_api.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 4 chunks +43 lines, -27 lines 0 comments Download
M chrome/browser/rlz/rlz_extension_apitest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 6 chunks +19 lines, -2 lines 0 comments Download
M chrome/browser/rlz/rlz_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 13 chunks +53 lines, -16 lines 0 comments Download
M chrome/browser/search_engines/search_terms_data.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/search_engines/search_terms_data.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/search_engines/template_url.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -3 lines 0 comments Download
M chrome/browser/search_engines/template_url_service.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/search_engines/template_url_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +11 lines, -3 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 3 chunks +10 lines, -6 lines 0 comments Download
M chrome/chrome_browser_extensions.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +0 lines, -5 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 4 chunks +10 lines, -2 lines 0 comments Download
M chrome/test/data/extensions/api_test/rlz/test.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +18 lines, -18 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
Nico
Alright gentlemen, this is it. It looks like there's already a side channel for injection ...
8 years, 9 months ago (2012-03-24 00:36:39 UTC) #1
Roger Tawa OOO till Jul 10th
Looks good Nico, and great to see the light at the end of the tunnel ...
8 years, 9 months ago (2012-03-24 01:10:42 UTC) #2
Nico
Thanks! I'll talk to ananthak about testing. https://chromiumcodereview.appspot.com/9699054/diff/16003/chrome/browser/rlz/rlz.cc File chrome/browser/rlz/rlz.cc (right): https://chromiumcodereview.appspot.com/9699054/diff/16003/chrome/browser/rlz/rlz.cc#newcode164 chrome/browser/rlz/rlz.cc:164: worker_pool_token_ = ...
8 years, 9 months ago (2012-03-24 01:29:47 UTC) #3
Nico
I noticed I missed the search terms replacement – now added. I think TemplateURLTest.RLZ also ...
8 years, 9 months ago (2012-03-24 02:14:47 UTC) #4
Roger Tawa OOO till Jul 10th
http://codereview.chromium.org/9699054/diff/20074/chrome/browser/chrome_browser_main.cc File chrome/browser/chrome_browser_main.cc (right): http://codereview.chromium.org/9699054/diff/20074/chrome/browser/chrome_browser_main.cc#newcode169 chrome/browser/chrome_browser_main.cc:169: #include "chrome/browser/rlz/rlz.h" maybe remove line 153 above and this ...
8 years, 9 months ago (2012-03-26 18:52:37 UTC) #5
Mark Mentovai
https://chromiumcodereview.appspot.com/9699054/diff/20074/chrome/browser/chrome_browser_main.cc File chrome/browser/chrome_browser_main.cc (right): https://chromiumcodereview.appspot.com/9699054/diff/20074/chrome/browser/chrome_browser_main.cc#newcode169 chrome/browser/chrome_browser_main.cc:169: #include "chrome/browser/rlz/rlz.h" On 2012/03/26 18:52:38, Roger Tawa wrote: > ...
8 years, 9 months ago (2012-03-26 19:52:18 UTC) #6
Roger Tawa OOO till Jul 10th
http://codereview.chromium.org/9699054/diff/20074/chrome/chrome_tests.gypi File chrome/chrome_tests.gypi (right): http://codereview.chromium.org/9699054/diff/20074/chrome/chrome_tests.gypi#newcode2350 chrome/chrome_tests.gypi:2350: ['OS!="win" and OS!="mac"', { On 2012/03/26 19:52:18, Mark Mentovai ...
8 years, 9 months ago (2012-03-26 19:57:14 UTC) #7
Mark Mentovai
How much of RLZ gets built into open-source Chromium, then? That’s undesirable.
8 years, 9 months ago (2012-03-26 20:00:47 UTC) #8
Roger Tawa OOO till Jul 10th
On 2012/03/26 20:00:47, Mark Mentovai wrote: > How much of RLZ gets built into open-source ...
8 years, 9 months ago (2012-03-26 20:10:23 UTC) #9
Nico
rogerta: Please see the "rlz extension api is active in chromium" comment below. I'm pretty ...
8 years, 9 months ago (2012-03-26 20:26:57 UTC) #10
Nico
Thanks!
8 years, 9 months ago (2012-03-26 20:27:16 UTC) #11
Mark Mentovai
I’m surprised to see RLZ built into open-source Chromium. If this is intended, then LGTM. ...
8 years, 9 months ago (2012-03-26 20:30:01 UTC) #12
Roger Tawa OOO till Jul 10th
lgtm About rlz code in chromium builds, I should have been clearer in what I ...
8 years, 9 months ago (2012-03-26 21:06:53 UTC) #13
Nico
+sky for chrome/browser/search_engine/OWNERS (why is that setnoparent?)
8 years, 9 months ago (2012-03-26 22:27:17 UTC) #14
sky
LGTM
8 years, 9 months ago (2012-03-26 22:45:09 UTC) #15
willchan no longer on Chromium
https://chromiumcodereview.appspot.com/9699054/diff/14045/chrome/browser/rlz/rlz.cc File chrome/browser/rlz/rlz.cc (right): https://chromiumcodereview.appspot.com/9699054/diff/14045/chrome/browser/rlz/rlz.cc#newcode217 chrome/browser/rlz/rlz.cc:217: rlz_lib::SetURLRequestContext(g_browser_process->system_request_context()); This is a race. This runs on the ...
8 years, 9 months ago (2012-03-27 12:14:53 UTC) #16
Nico
8 years, 8 months ago (2012-03-28 19:47:37 UTC) #17
https://chromiumcodereview.appspot.com/9699054/diff/14045/chrome/browser/rlz/...
File chrome/browser/rlz/rlz.cc (right):

https://chromiumcodereview.appspot.com/9699054/diff/14045/chrome/browser/rlz/...
chrome/browser/rlz/rlz.cc:217:
rlz_lib::SetURLRequestContext(g_browser_process->system_request_context());
On 2012/03/27 12:14:53, willchan wrote:
> This is a race. This runs on the FILE thread. g_browser_process may already be
> getting deleted (it's a UI thread object). You need to bind a copy of the
system
> URLRequestContextGetter scoped_refptr.

https://chromiumcodereview.appspot.com/9877017/

Powered by Google App Engine
This is Rietveld 408576698