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

Issue 215024: Fix appcache_service and request_context referencing. (Closed)

Created:
11 years, 3 months ago by michaeln
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com, darin (slow to review), brettw, jam, Ben Goodger (Google)
Visibility:
Public.

Description

Fix appcache_service and request_context referencing. There is one appcache service per profile and several request context per profile. The profile holds a reference to the appcache service. Those request contexts which are subject to retrieval from appcaches hold a reference to the appcache service too. The appcache service is provided with a pointer back to the 'main' request context, this context is used when updating appcaches. Initialization is a little tricky because profiles can't be used on the IO thread and request contexts can't be used on the UI thread. BUG=22597, 22125 TEST=many existing tests exercise profile/context creation Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=26844

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Total comments: 3

Patch Set 6 : '' #

Total comments: 30

Patch Set 7 : '' #

Total comments: 1

Patch Set 8 : '' #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+101 lines, -61 lines) Patch
M chrome/browser/net/chrome_url_request_context.h View 1 2 3 3 chunks +11 lines, -6 lines 0 comments Download
M chrome/browser/net/chrome_url_request_context.cc View 1 2 3 4 5 6 7 9 chunks +33 lines, -15 lines 0 comments Download
M chrome/browser/profile.h View 1 2 3 chunks +6 lines, -1 line 0 comments Download
M chrome/browser/profile.cc View 1 2 3 4 5 6 7 10 chunks +31 lines, -22 lines 0 comments Download
M chrome/common/appcache/chrome_appcache_service.h View 3 4 5 6 7 3 chunks +10 lines, -8 lines 0 comments Download
M webkit/appcache/appcache_service.h View 1 2 3 4 5 6 4 chunks +8 lines, -8 lines 1 comment Download
M webkit/appcache/appcache_service.cc View 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 21 (0 generated)
michaeln
http://codereview.chromium.org/215024/diff/4012/7007 File webkit/appcache/appcache_service.h (right): http://codereview.chromium.org/215024/diff/4012/7007#newcode52 Line 52: request_context_ = context; oh... i need to null ...
11 years, 3 months ago (2009-09-21 01:28:21 UTC) #1
michaeln
new snapshot... * null initted the data member mentioned before * removed setting application_cache_enabled to ...
11 years, 3 months ago (2009-09-21 20:35:05 UTC) #2
jorlow
I don't understand everything here super well, so it might be best if Darin still ...
11 years, 3 months ago (2009-09-21 22:31:01 UTC) #3
michaeln
new spanshot uploaded http://codereview.chromium.org/215024/diff/16/21 File chrome/browser/net/chrome_url_request_context.cc (right): http://codereview.chromium.org/215024/diff/16/21#newcode116 Line 116: ChromeURLRequestContext* context = new ChromeURLRequestContext( ...
11 years, 3 months ago (2009-09-21 23:32:00 UTC) #4
michaeln
About the 'enable' flag... yes i want to turn that asap, but i want to ...
11 years, 3 months ago (2009-09-21 23:35:05 UTC) #5
michaeln
http://codereview.chromium.org/215024/diff/3020/2014 File chrome/browser/net/chrome_url_request_context.cc (right): http://codereview.chromium.org/215024/diff/3020/2014#newcode213 Line 213: i've removed this blank line in my local ...
11 years, 3 months ago (2009-09-21 23:49:25 UTC) #6
michaeln
Responding to this specifically... > Overall, I think it'd be a good thing if you ...
11 years, 3 months ago (2009-09-22 00:41:03 UTC) #7
jorlow
My responses to your comments. Have not looked at the new code yet: On 2009/09/22 ...
11 years, 3 months ago (2009-09-22 01:03:58 UTC) #8
michaeln
I've poked at the io_thread() usage a little to more closely match other usages in ...
11 years, 3 months ago (2009-09-22 01:15:26 UTC) #9
michaeln
http://codereview.chromium.org/215024/diff/16/21 File chrome/browser/net/chrome_url_request_context.cc (right): http://codereview.chromium.org/215024/diff/16/21#newcode116 Line 116: ChromeURLRequestContext* context = new ChromeURLRequestContext( > I meant ...
11 years, 3 months ago (2009-09-22 01:32:54 UTC) #10
michaeln
http://codereview.chromium.org/215024/diff/8003/8004 File webkit/appcache/appcache_service.h (right): http://codereview.chromium.org/215024/diff/8003/8004#newcode16 Line 16: #include "net/url_request/url_request_context.h" i've removed the #include in my ...
11 years, 3 months ago (2009-09-22 01:59:12 UTC) #11
michaeln
added bug number, this CL fixes that bug
11 years, 3 months ago (2009-09-22 16:12:36 UTC) #12
michaeln
and another (bug 22125) this may resolve (not 100% sure about the second)
11 years, 3 months ago (2009-09-22 16:38:08 UTC) #13
Evan Martin
typo in change description: "excersise"
11 years, 3 months ago (2009-09-22 17:32:53 UTC) #14
michaeln
On 2009/09/22 17:32:53, Evan Martin wrote: > typo in change description: "excersise" fixed
11 years, 3 months ago (2009-09-22 17:38:27 UTC) #15
darin (slow to review)
LGTM It makes me very sad that we have these cases where the io_thread may ...
11 years, 3 months ago (2009-09-22 18:57:32 UTC) #16
jorlow1
Agreed. Is there any way to assert we're in a unit test? On Tue, Sep ...
11 years, 3 months ago (2009-09-22 19:18:17 UTC) #17
jorlow1
Besides prefering the test-only code paths have a dcheck or something (if it's possible), LGTM ...
11 years, 3 months ago (2009-09-22 19:28:03 UTC) #18
michaeln
Is there a bug open to track code cleanup of Profile vs profile related stuff ...
11 years, 3 months ago (2009-09-22 19:56:57 UTC) #19
jorlow1
From my limited knowledge of the subject, that seems like a fine solution. Not so ...
11 years, 3 months ago (2009-09-22 20:50:58 UTC) #20
jorlow1
11 years, 3 months ago (2009-09-22 20:51:28 UTC) #21
On Tue, Sep 22, 2009 at 1:50 PM, Jeremy Orlow <jorlow@google.com> wrote:

> From my limited knowledge of the subject, that seems like a fine solution.
>  Not so sure about the name though.  :-)
> // Classes owned by the IO thread, even though they're initialized here in
> the UI thread.
> class IOThreadOwnedData
>

Er...to clarify...that was a suggested name and type of comment you might
have above it to make it super clear why it exists.


> Do the members need to be refptr's?  in some/all cases, they may not need
> to be.
>
> On Tue, Sep 22, 2009 at 12:56 PM, <michaeln@chromium.org> wrote:
>
>> Is there a bug open to track code cleanup of Profile vs profile related
>> stuff
>> for use on the IO thread specifically?
>>
>>
>> Some thoughts on the topic... also mention in
>> http://code.google.com/p/chromium/issues/detail?id=22597
>>
>>
>> What's missing seems to be a class ProfileForIO type of thing, on which
>> the
>> various structures NOT
>> accessible on the UI thread hang (like request contexts).
>>
>> class Profile {
>>  void Profile() {
>>    ScheduleInitForIO();  // this is racey thou, InitOnIO can execute prior
>> to
>> return
>>                          // resulting in refcounting bugs, maybe defer
>> scheduling
>>                          // the task to be run on the IO thread till SOON
>>  }
>>  void InitForIO() {
>>    profile_for_io_  = new ProfileForIO();
>>  }
>>  ~Profile() {
>>    ScheduleReleaseForIO(profile_for_io_.release());
>>  }
>>  scoped_refptr<ProfileForIO> profile_for_io_;
>> };
>>
>> // Created empty on the UI thread, finally released on the IO thread
>> class ProfileForIO {
>>  scoped_refptr<ChromeURLRequestContext> main_request_context_;
>>  scoped_refptr<ChromeURLRequestContext> blah_request_context_;
>>  scoped_refptr<ChromeAppCacheService> appcache_service_;
>>
>> };
>>
>> http://codereview.chromium.org/215024
>>
>
>

Powered by Google App Engine
This is Rietveld 408576698