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

Issue 178062: linux: call PR_Init on UI thread (Closed)

Created:
11 years, 3 months ago by Evan Martin
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

linux: call PR_Init on UI thread It complains about being shutdown on the wrong thread otherwise. BUG=18410

Patch Set 1 #

Patch Set 2 : include header #

Patch Set 3 : whitespace #

Total comments: 1

Patch Set 4 : reimplementation #

Patch Set 5 : copyrights #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+37 lines, -13 lines) Patch
M base/nss_init.h View 2 chunks +6 lines, -1 line 1 comment Download
M base/nss_init.cc View 1 2 3 4 4 chunks +22 lines, -9 lines 4 comments Download
M base/singleton.h View 4 2 chunks +2 lines, -2 lines 1 comment Download
M chrome/app/chrome_dll_main.cc View 4 3 chunks +7 lines, -1 line 2 comments Download

Messages

Total messages: 4 (0 generated)
Evan Martin
This is kind of a lame fix, but maybe you'll accept it
11 years, 3 months ago (2009-09-01 21:31:57 UTC) #1
wtc
LGTM. Another solution is to add an EnsureNSPRInit function and call it in BrowserMain. Call ...
11 years, 3 months ago (2009-09-01 22:13:35 UTC) #2
Evan Martin
Please look, reimplemented based on conversation with WTC.
11 years, 3 months ago (2009-09-02 00:57:08 UTC) #3
wtc
11 years, 3 months ago (2009-09-02 01:17:17 UTC) #4
You can check this in after fixing the issues below.
Please upload a new Patch Set before you check it in,
so I can doublecheck it after the fact.  Thanks!

http://codereview.chromium.org/178062/diff/8001/8002
File base/nss_init.cc (right):

http://codereview.chromium.org/178062/diff/8001/8002#newcode1
Line 1: // Copyright (c) 2009 The Chromium Authors. All rights reserved.
This should be 2008-2009.

http://codereview.chromium.org/178062/diff/8001/8002#newcode60
Line 60: // Separate from the NSS singleton because we initialize it on the UI
thread.
Nit: it => NSPR (otherwise it's not clear what "it" refers to)

Let's change "UI thread" to "main thread".

http://codereview.chromium.org/178062/diff/8001/8002#newcode71
Line 71: "Is NSPR getting destroyed on wrong thread?";
Since Singleton destructors run on the main thread, the
question should be "Is NSPR getting initialized on the
wrong thread?" or "Was NSPR initialized on the wrong thread?"
(not sure about the tense/grammar :-))

http://codereview.chromium.org/178062/diff/8001/8002#newcode79
Line 79: SECStatus status;
We should call EnsureNSPRInit here, so that the unit tests,
etc. will continue to call PR_Cleanup.

http://codereview.chromium.org/178062/diff/8001/8003
File base/nss_init.h (right):

http://codereview.chromium.org/178062/diff/8001/8003#newcode1
Line 1: // Copyright (c) 2009 The Chromium Authors. All rights reserved.
This should say 2008-2009.

http://codereview.chromium.org/178062/diff/8001/8004
File base/singleton.h (right):

http://codereview.chromium.org/178062/diff/8001/8004#newcode1
Line 1: // Copyright (c) 2009 The Chromium Authors. All rights reserved.
This should say 2006-2009.

http://codereview.chromium.org/178062/diff/8001/8005
File chrome/app/chrome_dll_main.cc (right):

http://codereview.chromium.org/178062/diff/8001/8005#newcode1
Line 1: // Copyright (c) 2009 The Chromium Authors. All rights reserved.
Should be 2006-2009.

http://codereview.chromium.org/178062/diff/8001/8005#newcode553
Line 553: base::EnsureNSPRInit();
Are we using NSS/NSPR in the renderer processes, too?
If not, we just need to call EnsureNSPRInit in BrowserMain.

We may need to call EnsureNSPRInit in the test shell...

Powered by Google App Engine
This is Rietveld 408576698