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

Issue 258008: Move initialization of ChromeURLRequestContexts to the IO thread. (Closed)

Created:
11 years, 2 months ago by eroman
Modified:
9 years, 6 months ago
CC:
chromium-reviews_googlegroups.com, brettw+cc_chromium.org, ncarter (slow), Paul Godavari, ben+cc_chromium.org, Erik does not do reviews, idana, jam, pam+watch_chromium.org, Paweł Hajdan Jr., kuchhal, darin (slow to review)
Visibility:
Public.

Description

Move initialization of ChromeURLRequestContexts to the IO thread. Before, these URLRequestContexts were lazily created from the UI thread. Unfortunately that model made it easy for consumers on the UI thread to poke at stuff which was being used from the IO thread, and introduce races. So instead of providing a URLRequestContext*, the Profile now vends a URLRequestContextGetter*. The consequence of this is: * Consumers on the UI thread can no longer get access to a URLRequestContext. * Consumers on the IO thread need to call URLRequestContextGetter::GetURLRequestContext() to get at the context. This uses the same style lazy-creation of URLRequestContexts, albeit from the IO thread. OK, so now the smelly part: There were a couple of consumers of URLRequestContext on the UI thread that can't easily be moved to the IO thread -- these are the consumers of the cookie store. Before they could happily mess with the cookie store from the UI thread, and this was fine since CookieStore is threadsafe. However under the new model, they have no way to get at the URLRequestContext from the UI thread, hence can't get a pointer to the cookie store. To support that use-cases, I bastardized the API some by adding a URLRequestContextGetter::GetCookieStore() method that lets UI thread consumers get a pointer to the cookie store, since we know this particular cross-thread usage is safe. BUG=http://crbug.com/22294 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=29880

Patch Set 1 #

Patch Set 2 : update with more progress #

Patch Set 3 : sync and fix more problems #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Patch Set 7 : '' #

Patch Set 8 : '' #

Patch Set 9 : '' #

Patch Set 10 : '' #

Patch Set 11 : Add svn:eol-style LF to a new file #

Patch Set 12 : add some comments #

Patch Set 13 : '' #

Patch Set 14 : build fix for linux #

Patch Set 15 : Move ProxyConfigService initialization to UI thread as linux is expecting to use gconf #

Patch Set 16 : add missing file #

Total comments: 5

Patch Set 17 : Rename ChromeRequestContext --> ChromeURLRequestContextGetter #

Total comments: 21

Patch Set 18 : address darin's comments #

Patch Set 19 : Sync up #

Total comments: 4

Patch Set 20 : Address mnordman's comments #

Patch Set 21 : Release reference to AutomationProfileImpl::alternate_request_context_ from IO thread #

Total comments: 16

Patch Set 22 : Sync #

Patch Set 23 : Address tim's comments #

Patch Set 24 : checkpoint after merges #

Patch Set 25 : sync again, just in case #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1307 lines, -572 lines) Patch
M chrome/browser/automation/automation_profile_impl.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 5 chunks +8 lines, -9 lines 0 comments Download
M chrome/browser/automation/automation_profile_impl.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 4 chunks +65 lines, -14 lines 0 comments Download
M chrome/browser/automation/automation_provider.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 +26 lines, -18 lines 0 comments Download
M chrome/browser/browsing_data_remover.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 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/browsing_data_remover.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 5 chunks +12 lines, -6 lines 0 comments Download
M chrome/browser/chrome_plugin_host.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 3 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/cookies_table_model.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 3 chunks +7 lines, -3 lines 0 comments Download
M chrome/browser/dom_ui/new_tab_page_sync_handler.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 2 chunks +4 lines, -2 lines 0 comments Download
M chrome/browser/download/download_file.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 +6 lines, -3 lines 0 comments Download
M chrome/browser/download/download_file.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 4 chunks +22 lines, -12 lines 0 comments Download
M chrome/browser/download/download_manager.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 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/download/download_manager.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 3 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/download/save_file_manager.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 +3 lines, -3 lines 0 comments Download
M chrome/browser/download/save_file_manager.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 4 chunks +11 lines, -8 lines 0 comments Download
M chrome/browser/download/save_package.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 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/download/save_package.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 3 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/extensions/extensions_service.cc View 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 2 chunks +14 lines, -11 lines 0 comments Download
M chrome/browser/gtk/options/cookies_view_unittest.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 14 chunks +36 lines, -29 lines 0 comments Download
M chrome/browser/importer/toolbar_importer.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 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/net/chrome_url_request_context.h View 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 +227 lines, -40 lines 0 comments Download
M chrome/browser/net/chrome_url_request_context.cc View 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 14 chunks +469 lines, -127 lines 0 comments Download
M chrome/browser/net/resolve_proxy_msg_helper.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 2 chunks +5 lines, -3 lines 0 comments Download
M chrome/browser/net/sdch_dictionary_fetcher.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 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/net/url_fetcher.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 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/net/url_fetcher.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 +8 lines, -6 lines 0 comments Download
M chrome/browser/net/url_fetcher_unittest.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 7 chunks +33 lines, -4 lines 0 comments Download
A chrome/browser/net/url_request_context_getter.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +30 lines, -0 lines 0 comments Download
A chrome/browser/net/url_request_context_getter.cc View 10 11 12 13 14 15 16 17 1 chunk +10 lines, -0 lines 0 comments Download
M chrome/browser/plugin_process_host.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 3 chunks +4 lines, -2 lines 0 comments Download
M chrome/browser/profile.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 10 chunks +15 lines, -23 lines 0 comments Download
M chrome/browser/profile.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 15 chunks +22 lines, -72 lines 0 comments Download
M chrome/browser/profile_manager.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 2 chunks +5 lines, -2 lines 0 comments Download
M chrome/browser/renderer_host/resource_dispatcher_host.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 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/renderer_host/resource_dispatcher_host.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 1 chunk +6 lines, -2 lines 0 comments Download
M chrome/browser/renderer_host/resource_message_filter.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 4 chunks +9 lines, -3 lines 0 comments Download
M chrome/browser/renderer_host/resource_message_filter.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 10 chunks +25 lines, -17 lines 0 comments Download
M chrome/browser/spellchecker.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 +3 lines, -3 lines 0 comments Download
M chrome/browser/spellchecker.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 4 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/sync/glue/http_bridge.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 6 chunks +37 lines, -9 lines 0 comments Download
M chrome/browser/sync/glue/http_bridge.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 +37 lines, -20 lines 0 comments Download
M chrome/browser/sync/glue/http_bridge_unittest.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 5 chunks +36 lines, -18 lines 0 comments Download
M chrome/browser/sync/glue/sync_backend_host.h View 19 20 21 22 23 24 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/sync/glue/sync_backend_host.cc View 19 20 21 22 23 24 2 chunks +5 lines, -4 lines 0 comments Download
M chrome/chrome.gyp 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 +2 lines, -0 lines 0 comments Download
M chrome/common/appcache/appcache_dispatcher_host.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 +10 lines, -1 line 0 comments Download
M chrome/common/appcache/appcache_dispatcher_host.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 2 chunks +11 lines, -2 lines 0 comments Download
M chrome/common/appcache/chrome_appcache_service.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 1 chunk +7 lines, -36 lines 0 comments Download
M chrome/common/chrome_plugin_unittest.cc View 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 5 chunks +15 lines, -3 lines 0 comments Download
M chrome/test/testing_profile.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 2 chunks +5 lines, -4 lines 0 comments Download
M net/proxy/proxy_config_service_fixed.h View 15 16 17 18 19 20 21 22 23 24 1 chunk +1 line, -0 lines 0 comments Download
M net/proxy/proxy_service.h View 15 16 17 18 19 20 21 22 23 24 3 chunks +10 lines, -14 lines 0 comments Download
M net/proxy/proxy_service.cc View 15 16 17 18 19 20 21 22 23 24 2 chunks +3 lines, -8 lines 0 comments Download
M webkit/tools/test_shell/test_shell_request_context.cc View 16 17 18 19 20 21 22 23 24 2 chunks +12 lines, -7 lines 0 comments Download

Messages

Total messages: 22 (0 generated)
eroman
@timsteele: Please review the changes to sync. @michaeln: Please review the changes to app cache. ...
11 years, 2 months ago (2009-10-02 09:56:21 UTC) #1
darin (slow to review)
i started reviewing this, but i think it'd be best for us to chat in ...
11 years, 2 months ago (2009-10-05 22:18:26 UTC) #2
eroman
Per our discussion, I've renamed ChromeRequestContext --> ChromeURLRequestContextGetter. http://codereview.chromium.org/258008/diff/9174/5218 File chrome/browser/net/url_request_context_getter.h (right): http://codereview.chromium.org/258008/diff/9174/5218#newcode16 Line 16: ...
11 years, 2 months ago (2009-10-06 17:16:56 UTC) #3
darin (slow to review)
I wasn't sure if the ProxyService changes were strictly needed in this CL, but they ...
11 years, 2 months ago (2009-10-06 18:08:40 UTC) #4
eroman
> I wasn't sure if the ProxyService changes were strictly needed in > this CL, ...
11 years, 2 months ago (2009-10-06 19:19:51 UTC) #5
darin (slow to review)
On Tue, Oct 6, 2009 at 12:19 PM, <eroman@chromium.org> wrote: > I wasn't sure if ...
11 years, 2 months ago (2009-10-06 20:06:16 UTC) #6
amit
The relevant test for Chrome frame is: CFACWithChrome_UseHostNetworkStack The concern about ChromeUrlRequestContext getting deleted in ...
11 years, 2 months ago (2009-10-08 00:42:53 UTC) #7
michaeln
These changes don't simplify things too much. They do address some correctness and allow us ...
11 years, 2 months ago (2009-10-09 05:05:46 UTC) #8
eroman
Thanks Michael, I believe I have addressed the sharing issue with AppCacheService between incognito and ...
11 years, 2 months ago (2009-10-12 23:49:51 UTC) #9
michaeln
Yup, those changes look right to me, thnx!
11 years, 2 months ago (2009-10-13 06:04:50 UTC) #10
tim (not reviewing)
On 2009/10/13 06:04:50, michaeln wrote: > Yup, those changes look right to me, thnx! So, ...
11 years, 2 months ago (2009-10-16 05:21:58 UTC) #11
michaeln
On 2009/10/16 05:21:58, timsteele wrote: > On 2009/10/13 06:04:50, michaeln wrote: > > Yup, those ...
11 years, 2 months ago (2009-10-16 16:48:59 UTC) #12
eroman
On Thu, Oct 15, 2009 at 10:21 PM, <tim@chromium.org> wrote: > On 2009/10/13 06:04:50, michaeln ...
11 years, 2 months ago (2009-10-16 18:23:37 UTC) #13
eroman
@amit: I made the changes to AutomationProfileImpl that we discussed, please review those deltas here: ...
11 years, 2 months ago (2009-10-16 21:17:29 UTC) #14
eroman
http://codereview.chromium.org/258008/diff/167/10014 File chrome/browser/automation/automation_profile_impl.cc (right): http://codereview.chromium.org/258008/diff/167/10014#newcode131 Line 131: new AutomationCookieStore(profile_, On 2009/10/06 18:08:40, darin wrote: > ...
11 years, 2 months ago (2009-10-16 21:20:33 UTC) #15
amit
http://codereview.chromium.org/258008/diff/21001/21015 File chrome/browser/automation/automation_profile_impl.cc (right): http://codereview.chromium.org/258008/diff/21001/21015#newcode121 Line 121: tab_handle_(profile->tab_handle()), There's an issue here. This happens in ...
11 years, 2 months ago (2009-10-16 22:21:51 UTC) #16
eroman
http://codereview.chromium.org/258008/diff/21001/21015 File chrome/browser/automation/automation_profile_impl.cc (right): http://codereview.chromium.org/258008/diff/21001/21015#newcode121 Line 121: tab_handle_(profile->tab_handle()), On 2009/10/16 22:21:51, amit wrote: > There's ...
11 years, 2 months ago (2009-10-17 00:59:31 UTC) #17
amit
OK, lgtm On Fri, Oct 16, 2009 at 5:59 PM, <eroman@chromium.org> wrote: > > http://codereview.chromium.org/258008/diff/21001/21015 ...
11 years, 2 months ago (2009-10-17 14:21:11 UTC) #18
tim (not reviewing)
http://codereview.chromium.org/258008/diff/21001/21008 File chrome/browser/sync/glue/http_bridge.cc (left): http://codereview.chromium.org/258008/diff/21001/21008#oldcode156 Line 156: DCHECK(context_for_request_->is_user_agent_set()) << "User agent not set"; I think ...
11 years, 2 months ago (2009-10-19 19:01:32 UTC) #19
eroman
http://codereview.chromium.org/258008/diff/21001/21008 File chrome/browser/sync/glue/http_bridge.cc (left): http://codereview.chromium.org/258008/diff/21001/21008#oldcode156 Line 156: DCHECK(context_for_request_->is_user_agent_set()) << "User agent not set"; On 2009/10/19 ...
11 years, 2 months ago (2009-10-20 04:02:57 UTC) #20
tim (not reviewing)
Sync changes LGTM http://codereview.chromium.org/258008/diff/21001/21008 File chrome/browser/sync/glue/http_bridge.cc (left): http://codereview.chromium.org/258008/diff/21001/21008#oldcode156 Line 156: DCHECK(context_for_request_->is_user_agent_set()) << "User agent not ...
11 years, 2 months ago (2009-10-20 05:48:36 UTC) #21
darin (slow to review)
11 years, 2 months ago (2009-10-20 17:35:52 UTC) #22
LGTM

good luck with the landing!

Powered by Google App Engine
This is Rietveld 408576698