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

Issue 3391028: Reland r59972: Eagerly set the IO loop used for OCSP. (Closed)

Created:
10 years, 2 months ago by willchan no longer on Chromium
Modified:
9 years, 7 months ago
Reviewers:
wtc
CC:
chromium-reviews, cbentzel+watch_chromium.org, ben+cc_chromium.org, darin-cc_chromium.org, brettw-cc_chromium.org
Base URL:
http://src.chromium.org/git/chromium.git
Visibility:
Public.

Description

Reland r59972: Eagerly set the IO loop used for OCSP. ChromeOS will create a special Profile for login. Previously, OCSP initialization was done for the "default" ChromeURLRequestContext for each Profile. Since we can have multiple profiles, this causes the initialization (and uninitialization) to happen multiple times, which causes problems for OCSP since we use statics. The solution is to identify the "main" Profile. We create said Profile in BrowserMain. I add an "is_main_" variable to URLRequestContextGetter and URLRequestContext, so that only the "main" URLRequestContext will initialize OCSP. The only change from r59972 is the location that I set_is_main(). I set it when we set the default request context. This is because, by the time I had called set_is_main() in BrowserMain, the ChromeURLRequestContextGetter was already created (it gets created during the CreateProfile() function). So I was too late. BUG=55940 TEST=Manual Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=60739

Patch Set 1 #

Patch Set 2 : Here's the delta. #

Total comments: 3

Patch Set 3 : Address wtc comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+225 lines, -102 lines) Patch
M chrome/browser/browser_main.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/io_thread.cc View 2 chunks +9 lines, -0 lines 0 comments Download
M chrome/browser/net/chrome_url_request_context.h View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/net/chrome_url_request_context.cc View 3 chunks +10 lines, -6 lines 0 comments Download
M chrome/browser/profile_impl.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/net/url_request_context_getter.h View 1 2 chunks +17 lines, -1 line 0 comments Download
M net/ocsp/nss_ocsp.h View 1 chunk +5 lines, -0 lines 0 comments Download
M net/ocsp/nss_ocsp.cc View 7 chunks +172 lines, -92 lines 0 comments Download
M net/url_request/url_request_context.h View 1 2 2 chunks +8 lines, -0 lines 0 comments Download
M net/url_request/url_request_context.cc View 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 2 (0 generated)
willchan no longer on Chromium
I'm still waiting for my valgrind run to finish. It's been running for 12 hours ...
10 years, 2 months ago (2010-09-27 23:03:37 UTC) #1
wtc
10 years, 2 months ago (2010-09-27 23:58:19 UTC) #2
LGTM.  I'm glad you tracked this down.

Do you think "is_default" is better than "is_main"?  Just a
thought.  No need to let this renaming delay the relanding.

I have two minor fixes below.

http://codereview.chromium.org/3391028/diff/2001/3001
File chrome/browser/browser_main.cc (right):

http://codereview.chromium.org/3391028/diff/2001/3001#newcode52
chrome/browser/browser_main.cc:52: #include
"chrome/browser/net/chrome_url_request_context.h"
Nit: remove "chrome/browser/net/chrome_url_request_context.h".
It's no longer needed.

http://codereview.chromium.org/3391028/diff/2001/3005
File chrome/browser/profile_impl.cc (right):

http://codereview.chromium.org/3391028/diff/2001/3005#newcode710
chrome/browser/profile_impl.cc:710: default_request_context_ = request_context_;
I am not familiar with this code, but this does seem like the
earliest possible time we know a request context is marked as
the default/main request context.

http://codereview.chromium.org/3391028/diff/2001/3006
File chrome/common/net/url_request_context_getter.h (right):

http://codereview.chromium.org/3391028/diff/2001/3006#newcode44
chrome/common/net/url_request_context_getter.h:44: void set_is_main(bool
is_main) { is_main_ = is_main; }
Nice catch.  On the other hand, since you only pass 'true'
to set_is_main, the original code should not have caused a
bug.

BUG: the set_is_main() method in net/url_request/url_request_context.h
needs the same fix.

Powered by Google App Engine
This is Rietveld 408576698