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

Issue 5915004: Introduce incognito preference settings. (Closed)

Created:
10 years ago by battre
Modified:
4 years, 6 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, idana, Raghu Simha, Erik does not do reviews, ncarter (slow), Aaron Boodman, pam+watch_chromium.org, Paweł Hajdan Jr., darin-cc_chromium.org, tim (not reviewing), nkostylev+cc_chromium.org, davemoore+watch_chromium.org, Nico
Visibility:
Public.

Description

Introduce incognito preference settings. This CL introduces preference settings for incognito windows. The semantics are the following: - An extension can set regular preferences as before. These affect regular and incognito windows. - An extension can set regular preferences *and* incognito preferences. In this case, the incognito preferences affect only incognito windows. - If extension A sets reg+incognito, extension B sets reg but no incognito, extension B has higher precedence than A --> B's preferences hold for all regular and incognito windows. - Incognito preferences are never persisted to disk. In order to realize this, the ExtensionPrefs class allows setting regular and incognito extension controlled preferences. It allows creating an incognito version of the PrefService with an independent PrefValueStore. This (incognito) PrefValueStore and the original PrefValueStore share several of their PrefStores (i.e. DefaultPrefStore, CommandLinePrefStore, Configuration PrefStores) but differ in two pref stores: - We maintain two separate ExtensionPrefStores containing the effective preferences for regular and incognito windows. - We maintain two separate user pref stores. The regular JsonPrefStore is expanded by an OverlayPersistentPrefStore that maintains all write-operations in an in-memory overlay. Therefore, incognito changes are not visible in the file-backed JsonPrefStore. The two ExtensionPrefStores retrieve their effective values from a shared ExtensionPrefValueMap. The OffTheRecordProfileImpl provides a request_context_ that uses the new PrefService already. BUG=66027, 69057 TEST=unit tests, will be fully testable once the Proxy Settings API allows incognito settings. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=72489

Patch Set 1 #

Patch Set 2 : Whitespaces + fixes for trybot #

Total comments: 23

Patch Set 3 : Addressed comments #

Total comments: 34

Patch Set 4 : Addressed comments #

Patch Set 5 : Continuation of addressing comments of patch set 3 #

Patch Set 6 : Continued work from last year #

Total comments: 112

Patch Set 7 : Addressed Mattias' feedback #

Total comments: 28

Patch Set 8 : Addressed Matthias' feedback #

Patch Set 9 : Rebased to ToT #

Patch Set 10 : Fixed crashers in TranslateManager and a unit test #

Patch Set 11 : Implement instantiation of incognito profile #

Patch Set 12 : Nits #

Total comments: 26

Patch Set 13 : Rebase to ToT #

Patch Set 14 : fix thread access to IO, and last ToT merge #

Patch Set 15 : Fixed nits and crasher on Mac #

Total comments: 10

Patch Set 16 : Addressed nit-comments #

Patch Set 17 : Nicer ProfileImpl::GetExtensionPrefValueMa #

Patch Set 18 : Fixed whitespaces in mac files #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+1909 lines, -939 lines) Patch
M chrome/browser/extensions/extension_pref_store.h View 1 2 3 4 5 6 2 chunks +20 lines, -18 lines 0 comments Download
M chrome/browser/extensions/extension_pref_store.cc View 1 2 3 4 5 6 7 1 chunk +27 lines, -13 lines 0 comments Download
A chrome/browser/extensions/extension_pref_value_map.h View 1 2 3 4 5 6 7 1 chunk +144 lines, -0 lines 0 comments Download
A chrome/browser/extensions/extension_pref_value_map.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +181 lines, -0 lines 0 comments Download
A chrome/browser/extensions/extension_pref_value_map_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +326 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_prefs.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 7 chunks +11 lines, -27 lines 0 comments Download
M chrome/browser/extensions/extension_prefs.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 9 chunks +55 lines, -121 lines 0 comments Download
M chrome/browser/extensions/extension_prefs_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 11 chunks +124 lines, -155 lines 0 comments Download
M chrome/browser/extensions/extension_proxy_api.cc View 1 2 3 4 5 6 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/extensions/extension_service.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/extension_updater_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 8 chunks +11 lines, -9 lines 0 comments Download
M chrome/browser/extensions/test_extension_prefs.h View 1 2 3 4 5 6 2 chunks +4 lines, -0 lines 0 comments Download
M chrome/browser/extensions/test_extension_prefs.cc View 1 2 3 4 5 6 5 chunks +17 lines, -8 lines 0 comments Download
M chrome/browser/host_zoom_map_unittest.cc View 1 2 3 4 5 2 chunks +4 lines, -2 lines 0 comments Download
M chrome/browser/net/chrome_url_request_context.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +8 lines, -1 line 0 comments Download
M chrome/browser/policy/configuration_policy_pref_store_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 26 chunks +107 lines, -92 lines 0 comments Download
M chrome/browser/prefs/command_line_pref_store_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 8 chunks +35 lines, -26 lines 0 comments Download
M chrome/browser/prefs/default_pref_store.h View 1 2 3 4 5 2 chunks +10 lines, -8 lines 0 comments Download
A chrome/browser/prefs/default_pref_store.cc View 1 2 3 4 5 1 chunk +20 lines, -0 lines 0 comments Download
A chrome/browser/prefs/overlay_persistent_pref_store.h View 1 2 3 4 5 6 1 chunk +54 lines, -0 lines 0 comments Download
A chrome/browser/prefs/overlay_persistent_pref_store.cc View 1 2 3 4 5 1 chunk +77 lines, -0 lines 0 comments Download
A chrome/browser/prefs/overlay_persistent_pref_store_unittest.cc View 1 2 3 4 5 6 1 chunk +119 lines, -0 lines 0 comments Download
M chrome/browser/prefs/pref_change_registrar.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/prefs/pref_member.h View 1 2 3 4 5 6 7 2 chunks +9 lines, -0 lines 0 comments Download
M chrome/browser/prefs/pref_member.cc View 1 2 3 4 5 6 7 8 9 2 chunks +8 lines, -1 line 3 comments Download
M chrome/browser/prefs/pref_service.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 7 chunks +25 lines, -10 lines 0 comments Download
M chrome/browser/prefs/pref_service.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 11 chunks +55 lines, -35 lines 0 comments Download
M chrome/browser/prefs/pref_service_mock_builder.h View 1 2 3 4 5 6 7 8 2 chunks +7 lines, -7 lines 0 comments Download
M chrome/browser/prefs/pref_service_mock_builder.cc View 1 2 3 4 5 6 7 8 2 chunks +30 lines, -22 lines 0 comments Download
M chrome/browser/prefs/pref_service_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 7 chunks +30 lines, -15 lines 0 comments Download
M chrome/browser/prefs/pref_value_map.h View 1 2 3 4 5 3 chunks +9 lines, -1 line 0 comments Download
M chrome/browser/prefs/pref_value_map.cc View 1 2 3 4 5 2 chunks +17 lines, -1 line 0 comments Download
M chrome/browser/prefs/pref_value_store.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 5 chunks +19 lines, -27 lines 0 comments Download
M chrome/browser/prefs/pref_value_store.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 6 chunks +46 lines, -54 lines 0 comments Download
M chrome/browser/prefs/pref_value_store_unittest.cc View 1 2 3 4 5 10 chunks +24 lines, -138 lines 0 comments Download
M chrome/browser/profiles/profile.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +5 lines, -0 lines 0 comments Download
M chrome/browser/profiles/profile.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 7 chunks +22 lines, -2 lines 0 comments Download
M chrome/browser/profiles/profile_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +5 lines, -0 lines 0 comments Download
M chrome/browser/profiles/profile_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +11 lines, -5 lines 0 comments Download
M chrome/browser/sync/glue/preference_model_associator_unittest.cc View 1 2 3 4 5 6 chunks +1 line, -44 lines 0 comments Download
M chrome/browser/translate/translate_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/browser.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/browser_window_controller_unittest.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +9 lines, -3 lines 0 comments Download
M chrome/browser/ui/cocoa/extensions/extension_action_context_menu.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +9 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/extensions/extension_action_context_menu.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 4 chunks +37 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/extensions/extension_popup_controller_unittest.mm View 1 2 3 4 5 6 3 chunks +5 lines, -4 lines 0 comments Download
M chrome/browser/ui/cocoa/window_size_autosaver_unittest.mm View 1 2 3 4 5 3 chunks +7 lines, -3 lines 0 comments Download
M chrome/browser/ui/views/frame/browser_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +3 lines, -0 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 2 chunks +5 lines, -0 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 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/common/json_pref_store_unittest.cc View 1 2 3 4 5 7 chunks +28 lines, -24 lines 0 comments Download
M chrome/common/persistent_pref_store.h View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/common/pref_store.h View 1 2 3 4 5 6 5 chunks +8 lines, -3 lines 0 comments Download
M chrome/test/testing_pref_service.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 5 chunks +23 lines, -8 lines 0 comments Download
M chrome/test/testing_pref_service.cc View 1 2 3 4 5 6 2 chunks +41 lines, -24 lines 0 comments Download
M chrome/test/testing_profile.h View 1 2 3 4 5 6 7 8 9 10 11 12 6 chunks +11 lines, -8 lines 0 comments Download
M chrome/test/testing_profile.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +18 lines, -11 lines 0 comments Download
M net/base/network_config_watcher_mac.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 net/proxy/proxy_config_service_linux.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +6 lines, -0 lines 0 comments Download

Messages

Total messages: 23 (1 generated)
battre
Sorry for the large CL. Replacing scoped_ptrs to scoped_refptrs turned out to be necessary but ...
10 years ago (2010-12-16 16:14:32 UTC) #1
Mattias Nissler (ping if slow)
Here's a first round of high level comments. I didn't do a thorough pass through ...
10 years ago (2010-12-20 14:50:00 UTC) #2
battre
I have addressed the comments and the CL is significantly smaller. Currently the unit tests ...
10 years ago (2010-12-21 18:51:59 UTC) #3
danno
a first round of comments, more to come http://codereview.chromium.org/5915004/diff/45002/chrome/browser/extensions/extension_prefs.cc File chrome/browser/extensions/extension_prefs.cc (right): http://codereview.chromium.org/5915004/diff/45002/chrome/browser/extensions/extension_prefs.cc#newcode831 chrome/browser/extensions/extension_prefs.cc:831: for ...
10 years ago (2010-12-22 10:48:21 UTC) #4
Mattias Nissler (ping if slow)
some high-level comments to consider. http://codereview.chromium.org/5915004/diff/45002/chrome/browser/extensions/extension_prefs.h File chrome/browser/extensions/extension_prefs.h (right): http://codereview.chromium.org/5915004/diff/45002/chrome/browser/extensions/extension_prefs.h#newcode63 chrome/browser/extensions/extension_prefs.h:63: // Does not assume ...
10 years ago (2010-12-22 12:09:03 UTC) #5
battre
I have addressed the first batch of comments. No need to review, yet, as the ...
10 years ago (2010-12-22 18:34:52 UTC) #6
battre
I think this CL is now complete. I appreciate your reviews. http://codereview.chromium.org/5915004/diff/60002/chrome/browser/extensions/extension_pref_value_map.h File chrome/browser/extensions/extension_pref_value_map.h (right): ...
9 years, 11 months ago (2011-01-05 09:59:40 UTC) #7
Mattias Nissler (ping if slow)
Design-wise I like this revision much better! http://codereview.chromium.org/5915004/diff/60002/chrome/browser/extensions/extension_pref_store.h File chrome/browser/extensions/extension_pref_store.h (right): http://codereview.chromium.org/5915004/diff/60002/chrome/browser/extensions/extension_pref_store.h#newcode46 chrome/browser/extensions/extension_pref_store.h:46: // ExtensionPrefValueMap. ...
9 years, 11 months ago (2011-01-05 12:08:07 UTC) #8
battre
Next iteration. :-) http://codereview.chromium.org/5915004/diff/60002/chrome/browser/extensions/extension_pref_store.h File chrome/browser/extensions/extension_pref_store.h (right): http://codereview.chromium.org/5915004/diff/60002/chrome/browser/extensions/extension_pref_store.h#newcode46 chrome/browser/extensions/extension_pref_store.h:46: // ExtensionPrefValueMap. On 2011/01/05 12:08:07, Mattias ...
9 years, 11 months ago (2011-01-05 20:23:08 UTC) #9
Mattias Nissler (ping if slow)
I very much like the current version of this! Do you think it is worthwhile ...
9 years, 11 months ago (2011-01-07 10:12:57 UTC) #10
battre
Addressed Matthias comments. http://codereview.chromium.org/5915004/diff/101001/chrome/browser/extensions/extension_pref_store.cc File chrome/browser/extensions/extension_pref_store.cc (right): http://codereview.chromium.org/5915004/diff/101001/chrome/browser/extensions/extension_pref_store.cc#newcode15 chrome/browser/extensions/extension_pref_store.cc:15: if (extension_pref_value_map_) On 2011/01/07 10:12:58, Mattias ...
9 years, 11 months ago (2011-01-10 16:55:47 UTC) #11
battre
@aa: Please let me know whether you want to review this. @danno: Please review this ...
9 years, 11 months ago (2011-01-10 16:58:41 UTC) #12
danno
LGTM with few comments, mostly nits. http://codereview.chromium.org/5915004/diff/139001/chrome/browser/extensions/extension_pref_value_map.cc File chrome/browser/extensions/extension_pref_value_map.cc (right): http://codereview.chromium.org/5915004/diff/139001/chrome/browser/extensions/extension_pref_value_map.cc#newcode49 chrome/browser/extensions/extension_pref_value_map.cc:49: ExtensionEntryMap::iterator i = ...
9 years, 11 months ago (2011-01-14 13:05:09 UTC) #13
battre
Addressed the nits and fixed a nasty crasher on MacOS. Please review the changes since ...
9 years, 11 months ago (2011-01-20 17:59:28 UTC) #14
battre
+eroman --> Could you please review the changes in net/ +Nico --> FYI: chrome/browser/ui/cocoa/extensions/extension_action_context_menu.* is ...
9 years, 11 months ago (2011-01-20 18:04:37 UTC) #15
eroman
> +eroman --> Could you please review the changes in net/ LGTM for the changes ...
9 years, 11 months ago (2011-01-20 23:17:25 UTC) #16
Mattias Nissler (ping if slow)
I felt like nitting a bit in the morning :-P No, just had a quick ...
9 years, 11 months ago (2011-01-21 08:53:05 UTC) #17
battre
Addressed nits. http://codereview.chromium.org/5915004/diff/142002/chrome/browser/extensions/extension_prefs.cc File chrome/browser/extensions/extension_prefs.cc (right): http://codereview.chromium.org/5915004/diff/142002/chrome/browser/extensions/extension_prefs.cc#newcode1188 chrome/browser/extensions/extension_prefs.cc:1188: // Store winning preference for each extension ...
9 years, 11 months ago (2011-01-24 17:47:18 UTC) #18
Dan Beam
https://codereview.chromium.org/5915004/diff/145019/chrome/browser/prefs/pref_member.cc File chrome/browser/prefs/pref_member.cc (right): https://codereview.chromium.org/5915004/diff/145019/chrome/browser/prefs/pref_member.cc#newcode44 chrome/browser/prefs/pref_member.cc:44: } out of curiosity, could pref_name_.clear() be called here ...
4 years, 6 months ago (2016-06-17 21:56:16 UTC) #19
battre
https://codereview.chromium.org/5915004/diff/145019/chrome/browser/prefs/pref_member.cc File chrome/browser/prefs/pref_member.cc (right): https://codereview.chromium.org/5915004/diff/145019/chrome/browser/prefs/pref_member.cc#newcode44 chrome/browser/prefs/pref_member.cc:44: } On 2016/06/17 21:56:15, Dan Beam wrote: > out ...
4 years, 6 months ago (2016-06-20 07:53:47 UTC) #20
Dan Beam
https://codereview.chromium.org/5915004/diff/145019/chrome/browser/prefs/pref_member.cc File chrome/browser/prefs/pref_member.cc (right): https://codereview.chromium.org/5915004/diff/145019/chrome/browser/prefs/pref_member.cc#newcode44 chrome/browser/prefs/pref_member.cc:44: } On 2016/06/20 07:53:46, battre wrote: > On 2016/06/17 ...
4 years, 6 months ago (2016-06-21 22:50:41 UTC) #22
battre
4 years, 6 months ago (2016-06-22 05:03:04 UTC) #23
Message was sent while issue was closed.
On 2016/06/21 22:50:41, Dan Beam wrote:
>
https://codereview.chromium.org/5915004/diff/145019/chrome/browser/prefs/pref...
> File chrome/browser/prefs/pref_member.cc (right):
> 
>
https://codereview.chromium.org/5915004/diff/145019/chrome/browser/prefs/pref...
> chrome/browser/prefs/pref_member.cc:44: }
> On 2016/06/20 07:53:46, battre wrote:
> > On 2016/06/17 21:56:15, Dan Beam wrote:
> > > out of curiosity, could pref_name_.clear() be called here so that
> PrefMembers
> > > could be later Init()ialized?
> > 
> > I did not find anything subtle that would break.
> 
> I think making Destroy() private and encouraging folks to use
> unique_ptr<PrefMember> + reset() might be better.

I think that the downside is that you need to call reset() on the correct
thread.

Powered by Google App Engine
This is Rietveld 408576698