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

Issue 7740055: Set user-visible machine names and devices types for synced sessions. (Closed)

Created:
9 years, 3 months ago by Yaron
Modified:
9 years, 3 months ago
CC:
chromium-reviews, ncarter (slow), idana, Raghu Simha, brettw-cc_chromium.org, Paweł Hajdan Jr., tim (not reviewing)
Visibility:
Public.

Description

Set user-visible machine names and devices types for synced sessions. On OSX: - Read the computer name, falling back to reading hw.model and stripping any trialing numbers. This will give us something like MacBookPro, iMac, MacBookAir. On Linux: - Use distro name which gives something like "Ubuntu 10.04.2 LTS". On Windows: - Use the computer name On ChromeOS: - Use "Chromebook" BUG=94693, 59672 TEST=enable session sync, sync two clients, and then look at the entries in about:sync and see that the "client_name" is set Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=99391 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=99450

Patch Set 1 #

Patch Set 2 : Add usage of TYPE_OTHER #

Patch Set 3 : Set device_type for SessionHeader #

Total comments: 22

Patch Set 4 : Split off platform-specific code to various util files, addressed comments #

Total comments: 15

Patch Set 5 : Localized changes back sync/glue/ #

Total comments: 10

Patch Set 6 : Changed mac name retrieval, other fixes #

Total comments: 10

Patch Set 7 : Mac cleanup #

Total comments: 1

Patch Set 8 : style fix #

Patch Set 9 : Fix tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+342 lines, -52 lines) Patch
M chrome/browser/sessions/session_types.h View 1 2 3 4 1 chunk +0 lines, -11 lines 0 comments Download
M chrome/browser/sessions/session_types.cc View 1 2 3 4 1 chunk +0 lines, -10 lines 0 comments Download
M chrome/browser/sync/glue/session_model_associator.h View 1 2 3 4 5 8 chunks +36 lines, -1 line 0 comments Download
M chrome/browser/sync/glue/session_model_associator.cc View 1 2 3 4 5 6 7 8 10 chunks +128 lines, -8 lines 0 comments Download
A chrome/browser/sync/glue/session_model_associator_mac.mm View 1 2 3 4 5 6 7 1 chunk +52 lines, -0 lines 0 comments Download
M chrome/browser/sync/glue/session_model_associator_unittest.cc View 1 2 3 4 5 6 3 chunks +31 lines, -1 line 0 comments Download
A chrome/browser/sync/glue/synced_session.h View 1 2 3 4 5 1 chunk +42 lines, -0 lines 0 comments Download
A chrome/browser/sync/glue/synced_session.cc View 1 2 3 4 1 chunk +19 lines, -0 lines 0 comments Download
M chrome/browser/sync/glue/synced_session_tracker.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_session_unittest.cc View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/ui/webui/sessions_ui.cc View 1 2 3 4 6 chunks +16 lines, -12 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/test/live_sync/performance/sessions_sync_perf_test.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/live_sync/sessions_helper.h View 1 2 3 4 5 3 chunks +5 lines, -3 lines 0 comments Download
M chrome/test/live_sync/sessions_helper.cc View 1 2 3 4 5 4 chunks +6 lines, -5 lines 0 comments Download

Messages

Total messages: 26 (0 generated)
Yaron
I'll add sky@ to look at the non sync bits if you like this approach. ...
9 years, 3 months ago (2011-08-30 20:26:09 UTC) #1
Nicolas Zea
http://codereview.chromium.org/7740055/diff/3001/chrome/browser/sync/glue/session_model_associator.cc File chrome/browser/sync/glue/session_model_associator.cc (right): http://codereview.chromium.org/7740055/diff/3001/chrome/browser/sync/glue/session_model_associator.cc#newcode50 chrome/browser/sync/glue/session_model_associator.cc:50: std::string SessionModelAssociator::current_machine_name_ = ""; You can remove this line ...
9 years, 3 months ago (2011-08-30 21:29:58 UTC) #2
Nicolas Zea
Could you also add 59672 to the bug list?
9 years, 3 months ago (2011-08-30 23:12:45 UTC) #3
Yaron
Comments addressed and added additional reviewers. sky for chrome/browser/sessions darin for base/win and chrome/browser thakis ...
9 years, 3 months ago (2011-08-31 03:26:12 UTC) #4
sky
http://codereview.chromium.org/7740055/diff/7004/chrome/browser/browser_main.cc File chrome/browser/browser_main.cc (right): http://codereview.chromium.org/7740055/diff/7004/chrome/browser/browser_main.cc#newcode1429 chrome/browser/browser_main.cc:1429: g_browser_process->file_thread()->message_loop()->PostTask(FROM_HERE, Why do we need the linux distro if ...
9 years, 3 months ago (2011-08-31 03:35:15 UTC) #5
Nico
http://codereview.chromium.org/7740055/diff/7004/base/mac/mac_util.mm File base/mac/mac_util.mm (right): http://codereview.chromium.org/7740055/diff/7004/base/mac/mac_util.mm#newcode370 base/mac/mac_util.mm:370: } Don't you want [[NSHost currentHost] localizedName];?
9 years, 3 months ago (2011-08-31 03:55:50 UTC) #6
Nico
http://codereview.chromium.org/7740055/diff/7004/base/mac/mac_util.mm File base/mac/mac_util.mm (right): http://codereview.chromium.org/7740055/diff/7004/base/mac/mac_util.mm#newcode370 base/mac/mac_util.mm:370: } On 2011/08/31 03:55:50, Nico wrote: > Don't you ...
9 years, 3 months ago (2011-08-31 03:58:22 UTC) #7
darin (slow to review)
http://codereview.chromium.org/7740055/diff/7004/base/win/win_util.cc File base/win/win_util.cc (right): http://codereview.chromium.org/7740055/diff/7004/base/win/win_util.cc#newcode80 base/win/win_util.cc:80: return ""; return std::string(); http://codereview.chromium.org/7740055/diff/7004/base/win/win_util.h File base/win/win_util.h (right): http://codereview.chromium.org/7740055/diff/7004/base/win/win_util.h#newcode8 ...
9 years, 3 months ago (2011-08-31 05:52:01 UTC) #8
Nicolas Zea
http://codereview.chromium.org/7740055/diff/3001/chrome/browser/sync/glue/session_model_associator.cc File chrome/browser/sync/glue/session_model_associator.cc (right): http://codereview.chromium.org/7740055/diff/3001/chrome/browser/sync/glue/session_model_associator.cc#newcode50 chrome/browser/sync/glue/session_model_associator.cc:50: std::string SessionModelAssociator::current_machine_name_ = ""; On 2011/08/31 03:26:12, Yaron wrote: ...
9 years, 3 months ago (2011-08-31 18:23:00 UTC) #9
Yaron
Comments addressed and the code has been pushed back into sync/glue/. So I suppose thakis ...
9 years, 3 months ago (2011-08-31 23:23:21 UTC) #10
Nico
http://codereview.chromium.org/7740055/diff/7004/base/mac/mac_util.mm File base/mac/mac_util.mm (right): http://codereview.chromium.org/7740055/diff/7004/base/mac/mac_util.mm#newcode370 base/mac/mac_util.mm:370: } On 2011/08/31 23:23:22, Yaron wrote: > On 2011/08/31 ...
9 years, 3 months ago (2011-08-31 23:27:13 UTC) #11
sky
chrome/browser/sessions LGTM .
9 years, 3 months ago (2011-08-31 23:32:19 UTC) #12
Nicolas Zea
http://codereview.chromium.org/7740055/diff/8001/chrome/browser/sync/glue/session_model_associator.cc File chrome/browser/sync/glue/session_model_associator.cc (right): http://codereview.chromium.org/7740055/diff/8001/chrome/browser/sync/glue/session_model_associator.cc#newcode142 chrome/browser/sync/glue/session_model_associator.cc:142: header_s->set_device_type(sync_pb::SessionHeader_DeviceType_TYPE_PC); Shouldn't this be TYPE_OTHER? http://codereview.chromium.org/7740055/diff/8001/chrome/browser/sync/glue/session_model_associator.cc#newcode560 chrome/browser/sync/glue/session_model_associator.cc:560: g_browser_process->file_thread()->message_loop()->PostTask(FROM_HERE, BrowserThread::PostTask(BrowserThread::FILE, ...
9 years, 3 months ago (2011-09-01 00:03:36 UTC) #13
Yaron
Thanks for you help with the Mac stuff, Nico. Should be ready for another look. ...
9 years, 3 months ago (2011-09-01 20:16:17 UTC) #14
Nico
Cool! http://codereview.chromium.org/7740055/diff/13001/chrome/browser/sync/glue/session_model_associator_mac.mm File chrome/browser/sync/glue/session_model_associator_mac.mm (right): http://codereview.chromium.org/7740055/diff/13001/chrome/browser/sync/glue/session_model_associator_mac.mm#newcode17 chrome/browser/sync/glue/session_model_associator_mac.mm:17: - (NSString *)localizedName; No space after * http://codereview.chromium.org/7740055/diff/13001/chrome/browser/sync/glue/session_model_associator_mac.mm#newcode27 ...
9 years, 3 months ago (2011-09-01 20:20:41 UTC) #15
Yaron
http://codereview.chromium.org/7740055/diff/13001/chrome/browser/sync/glue/session_model_associator_mac.mm File chrome/browser/sync/glue/session_model_associator_mac.mm (right): http://codereview.chromium.org/7740055/diff/13001/chrome/browser/sync/glue/session_model_associator_mac.mm#newcode17 chrome/browser/sync/glue/session_model_associator_mac.mm:17: - (NSString *)localizedName; On 2011/09/01 20:20:41, Nico wrote: > ...
9 years, 3 months ago (2011-09-01 22:19:46 UTC) #16
Nico
chrome/browser/sync/glue/session_model_associator_mac.mm LGTM
9 years, 3 months ago (2011-09-01 23:03:19 UTC) #17
Nicolas Zea
Lgtm On Sep 1, 2011 4:03 PM, <thakis@chromium.org> wrote: > chrome/browser/sync/glue/session_model_associator_mac.mm LGTM > > http://codereview.chromium.org/7740055/
9 years, 3 months ago (2011-09-01 23:58:29 UTC) #18
Yaron
On 2011/09/01 23:58:29, nzea wrote: > Lgtm > On Sep 1, 2011 4:03 PM, <mailto:thakis@chromium.org> ...
9 years, 3 months ago (2011-09-02 00:58:49 UTC) #19
commit-bot: I haz the power
Presubmit check for 7740055-19002 failed and returned exit status 1. Running presubmit commit checks ...
9 years, 3 months ago (2011-09-02 01:04:43 UTC) #20
commit-bot: I haz the power
Presubmit check for 7740055-19002 failed and returned exit status 1. Running presubmit commit checks ...
9 years, 3 months ago (2011-09-02 01:46:30 UTC) #21
Yaron
On 2011/09/02 01:46:30, I haz the power (commit-bot) wrote: > Presubmit check for 7740055-19002 failed ...
9 years, 3 months ago (2011-09-02 03:28:18 UTC) #22
(unused - use chromium)
On Thu, Sep 1, 2011 at 8:28 PM, <yfriedman@chromium.org> wrote: > On 2011/09/02 01:46:30, I ...
9 years, 3 months ago (2011-09-02 04:42:10 UTC) #23
yfriedman
Ya I did but he's ooo On Sep 1, 2011 9:42 PM, "Nico Weber" <thakis@google.com> ...
9 years, 3 months ago (2011-09-02 05:38:59 UTC) #24
Yaron
On 2011/09/02 05:38:59, yfriedman_google.com wrote: > Ya I did but he's ooo > On Sep ...
9 years, 3 months ago (2011-09-02 16:32:14 UTC) #25
Yaron
9 years, 3 months ago (2011-09-02 19:54:22 UTC) #26
On 2011/09/02 16:32:14, Yaron wrote:
> On 2011/09/02 05:38:59, http://yfriedman_google.com wrote:
> > Ya I did but he's ooo
> > On Sep 1, 2011 9:42 PM, "Nico Weber" <mailto:thakis@google.com> wrote:
> > > On Thu, Sep 1, 2011 at 8:28 PM, <mailto:yfriedman@chromium.org> wrote:
> > >> On 2011/09/02 01:46:30, I haz the power (commit-bot) wrote:
> > >>>
> > >>> Presubmit check for 7740055-19002 failed and returned exit status 1.
> > >>
> > >>> Running presubmit commit checks ...
> > >>
> > >>> ** Presubmit Warnings **
> > >>> You might be calling functions intended only for testing from
> > >>> production code. Please verify that the following usages are OK,
> > >>> and email mailto:joi@chromium.org if you are seeing false positives:
> > >>>   chrome/browser/sync/glue/session_model_associator.cc:214
> > >>>     if (waiting_for_change_) QuitLoopForTest(); \
> > >>>   chrome/browser/sync/glue/session_model_associator.cc:233
> > >>>     if (waiting_for_change_) QuitLoopForTest();
> > >>
> > >>> Presubmit checks took 4.1s to calculate.
> > >>
> > >> Is there a way to override the presubmit check?
> > >
> > > Ask Joi? :-)
> > >
> > > If you're sure that this is harmless, you can commit manually. I don't
> > > know if the commit bot supports it.
> > >
> > >>
> > >> http://codereview.chromium.org/7740055/
> > >>
> 
> I'm not a committer yet so I don't believe I can commit manually. Is it
possible
> for you to sponsor me for provisional or land on my behalf? I think nzea is at
> an offsite. I can try and find someone else if you're busy.


Uploaded a fix and confirmed that cros unittests passes on trybot:
http://build.chromium.org/p/tryserver.chromium/builders/linux_chromeos/builds...

Powered by Google App Engine
This is Rietveld 408576698