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

Issue 113043: Fix gconf for the linux proxy config service.... (Closed)

Created:
11 years, 7 months ago by sdoyon
Modified:
9 years, 7 months ago
Reviewers:
Dean McNamee, eroman
CC:
chromium-reviews_googlegroups.com, darin (slow to review)
Visibility:
Public.

Description

Fix gconf for the linux proxy config service. -Reenables fetching of settings from gconf. -Moves all gconf access to happen from the UI thread only, (where the default glib main loop runs). -Adds support for gconf notifications, avoiding having to poll the settings. -Fixes a small initialization glitch in the unittest. Plus minor code style tweaks. -Permanently removes gdk and glib threading initialization calls that were previously disabled. -Slight reorganization of ProxyService creation to pass down the IO thread MessageLoop. BUG=11111 TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=16739

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 8

Patch Set 3 : '' #

Total comments: 5

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Total comments: 7

Patch Set 7 : '' #

Patch Set 8 : '' #

Total comments: 2

Patch Set 9 : '' #

Patch Set 10 : '' #

Total comments: 11

Patch Set 11 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+625 lines, -192 lines) Patch
M chrome/app/chrome_dll_main.cc View 1 2 3 4 5 6 7 8 9 1 chunk +5 lines, -11 lines 0 comments Download
M chrome/browser/net/chrome_url_request_context.cc View 1 2 3 4 5 6 7 8 9 1 chunk +5 lines, -3 lines 0 comments Download
M net/http/http_network_transaction_unittest.cc View 10 1 chunk +1 line, -1 line 0 comments Download
M net/proxy/proxy_config.h View 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M net/proxy/proxy_config_service_linux.h View 1 2 3 4 5 6 7 8 9 3 chunks +158 lines, -43 lines 0 comments Download
M net/proxy/proxy_config_service_linux.cc View 1 2 3 4 5 6 7 8 9 10 16 chunks +250 lines, -83 lines 0 comments Download
M net/proxy/proxy_config_service_linux_unittest.cc View 1 2 3 4 5 6 7 8 9 9 chunks +144 lines, -17 lines 0 comments Download
M net/proxy/proxy_script_fetcher_unittest.cc View 10 1 chunk +1 line, -1 line 0 comments Download
M net/proxy/proxy_service.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +19 lines, -10 lines 0 comments Download
M net/proxy/proxy_service.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +37 lines, -20 lines 0 comments Download
M net/url_request/url_request_unittest.h View 10 1 chunk +1 line, -1 line 0 comments Download
M webkit/tools/test_shell/run_all_tests.cc View 1 chunk +1 line, -1 line 0 comments Download
M webkit/tools/test_shell/test_shell_request_context.cc View 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 29 (0 generated)
sdoyon
11 years, 7 months ago (2009-05-06 19:30:29 UTC) #1
sdoyon
This is much inspired by eroman's excellent pseudo-code in http://codereview.chromium.org/99126.
11 years, 7 months ago (2009-05-06 20:04:40 UTC) #2
Dean McNamee
I just have some mostly style comments. Eric is going to have to do the ...
11 years, 7 months ago (2009-05-07 09:42:05 UTC) #3
sdoyon
On Thu, 7 May 2009, deanm@chromium.org wrote: > http://codereview.chromium.org/113043/diff/20/1010 > File chrome/app/chrome_dll_main.cc (right): > > ...
11 years, 7 months ago (2009-05-07 15:34:47 UTC) #4
sdoyon
Oops, ui_tests break: the assert in the destructor ~ProxyConfigServiceLinux(), about running on the UI thread, ...
11 years, 7 months ago (2009-05-07 15:51:19 UTC) #5
eroman
I haven't gone through all the details yet, but sending some initial comments. I will ...
11 years, 7 months ago (2009-05-07 22:44:54 UTC) #6
sdoyon
On Thu, 7 May 2009, eroman@chromium.org wrote: > I will be looking at the tear-down ...
11 years, 7 months ago (2009-05-08 06:31:02 UTC) #7
sdoyon
OK, the try server says ui_tests succeeded! And I figured out the deal with the ...
11 years, 7 months ago (2009-05-08 13:12:07 UTC) #8
sdoyon
> I don't like affecting other classes and having a specialpurpose > Destroy method, so ...
11 years, 7 months ago (2009-05-11 16:49:21 UTC) #9
eroman
Yeah that approach sounds good, I was going to suggest something similar :) I apologize ...
11 years, 7 months ago (2009-05-11 18:58:05 UTC) #10
sdoyon
Try success! It's ready for review. Thanks
11 years, 7 months ago (2009-05-11 19:04:53 UTC) #11
eroman
I liked your change of moving into internal refcounted. My main comment is that having ...
11 years, 7 months ago (2009-05-12 07:20:48 UTC) #12
sdoyon
On Tue, 12 May 2009, eroman@chromium.org wrote: > I liked your change of moving into ...
11 years, 7 months ago (2009-05-12 13:17:25 UTC) #13
eroman
That teardown sequence is still pretty tricky. I feel it could be simplified by removing ...
11 years, 7 months ago (2009-05-12 20:28:52 UTC) #14
sdoyon
On Tue, 12 May 2009, eroman@chromium.org wrote: > That teardown sequence is still pretty tricky. ...
11 years, 7 months ago (2009-05-13 18:08:00 UTC) #15
eroman
LGTM > Only thing I can think to do is to force an extra round ...
11 years, 7 months ago (2009-05-13 19:36:28 UTC) #16
eroman
Actually, I just spoke to Darin, and it is intentional to not call RunAllPending() during ...
11 years, 7 months ago (2009-05-13 19:48:17 UTC) #17
sdoyon
On Wed, 13 May 2009, eroman@chromium.org wrote: > Actually, I just spoke to Darin, and ...
11 years, 7 months ago (2009-05-14 13:47:47 UTC) #18
eroman
Sure we can save the task posting if we're already on the > right thread, ...
11 years, 7 months ago (2009-05-14 18:36:26 UTC) #19
eroman
Adding Darin who had some suggestions on how to do the teardown using a service.
11 years, 7 months ago (2009-05-14 18:37:32 UTC) #20
sdoyon
OK, a service? Can you elaborate?
11 years, 7 months ago (2009-05-15 12:22:45 UTC) #21
eroman
This looks good to me... Unless Darin has alternate suggestions, I would say to check ...
11 years, 7 months ago (2009-05-18 22:22:36 UTC) #22
sdoyon
Reorganized creation of ProxyService to resolve conflict with r16413. eroman@ -->> please check that part ...
11 years, 7 months ago (2009-05-20 20:37:58 UTC) #23
eroman
lgtm http://codereview.chromium.org/113043/diff/1077/119 File net/proxy/proxy_config_service_linux_unittest.cc (right): http://codereview.chromium.org/113043/diff/1077/119#newcode36 Line 36: // Undo macro pollution from GDK includes ...
11 years, 7 months ago (2009-05-20 21:23:14 UTC) #24
sdoyon
Woops, this doesn't actually work. webkit/tools/test_shell/test_shell_request_context.cc creates a proxy service that may have either a ...
11 years, 7 months ago (2009-05-20 21:24:26 UTC) #25
eroman
> I'm not familiar with that code. I'll take a look. > Hints welcome. I ...
11 years, 7 months ago (2009-05-20 22:06:51 UTC) #26
sdoyon
On Wed, 20 May 2009, eroman@chromium.org wrote: > lgtm > > > http://codereview.chromium.org/113043/diff/1077/119 > File ...
11 years, 7 months ago (2009-05-21 15:52:33 UTC) #27
eroman
lgtm. > OK here's a different idea: how about allowing a NULL io_loop to be ...
11 years, 7 months ago (2009-05-21 19:38:36 UTC) #28
sdoyon
11 years, 7 months ago (2009-05-22 14:06:24 UTC) #29
On Thu, 21 May 2009, eroman@chromium.org wrote:

>> webkit/tools/test_shell/run_all_tests.cc instantiates a default type
>> loop. OK' I'll just change it to instantiate a UI loop. Hope that's
>> appropriate.
>
> Seems OK.
> Although could you also solve the DCHECK by changing:
> loop_ = MessageLoopForUI::current();
> to:
> loop_ = MessageLoop::current();

In GConfSettingGetterImpl::Init()? I don't think that'd be intirely
safe.

In fact the first assertion that we'll hit would be from
ProxyConfigService* ProxyService::CreateSystemProxyConfigService()
doing
  MessageLoop* glib_default_loop = MessageLoopForUI::current();

That'll DCHECK if the current thread's loop is not of TYPE_UI.

Here's my understanding and logic:

I'm having it skip gconf notifications when the io_loop is NULL, but
it still does the initial gconf fetch, which still needs to be on the
thread running the default glib loop. The ForUI part is to try to
check that we're indeed on the thread with the default glib
context. That happens in message_pump_glib.cc:

MessagePumpForUI::MessagePumpForUI()
    : state_(NULL),
      context_(g_main_context_default()) {

If I understand correctly, the TYPE_DEFAULT MessageLoop won't refer
to glib at all. Now if no thread runs the glib context at all, then
our gconf usage should be safe, (only idles and timeouts might not run
but that probably doesn't matter in a simple test setup). But it seems
safer to ensure that we're on the thread running the default glib main
loop, so as not to make the assumption that no other thread will be
running the glib loop.

> Agreed, please don't block on this! (As a reviewer I much prefer smaller
> iterative patches... losing steam on this one).

I can imagine. Same here. Thanks for your help and patience.

Powered by Google App Engine
This is Rietveld 408576698