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

Issue 7672009: Lazy creating of background pages --enable-lazy-background-pages) (Closed)

Created:
9 years, 4 months ago by Tessa MacDuff
Modified:
9 years, 3 months ago
CC:
chromium-reviews, Erik does not do reviews, mihaip+watch_chromium.org
Visibility:
Public.

Description

Lazy creation of background pages with --enable-lazy-background-pages BUG=81752 TEST=None Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=98981

Patch Set 1 #

Total comments: 5

Patch Set 2 : Move implementation to ExtensionEventRouter and store pending events in a queue #

Total comments: 20

Patch Set 3 : used linked_ptr and Tasks and no more 'Maybe' functions #

Patch Set 4 : fix broken test #

Total comments: 13

Patch Set 5 : address comments #

Patch Set 6 : use ExtensionEvent for args to DispatchEventImpl #

Total comments: 5

Patch Set 7 : Switch from Task to ExtensionEvent #

Total comments: 2

Patch Set 8 : create ExtensionEvent on the heap #

Patch Set 9 : fix memory leak #

Unified diffs Side-by-side diffs Delta from patch set Stats (+195 lines, -50 lines) Patch
M chrome/app/generated_resources.grd View 1 2 3 4 5 6 7 8 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/about_flags.cc View 1 2 3 4 5 6 1 chunk +7 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_event_router.h View 1 2 3 4 5 6 7 8 4 chunks +23 lines, -8 lines 0 comments Download
M chrome/browser/extensions/extension_event_router.cc View 1 2 3 4 5 6 7 8 8 chunks +128 lines, -22 lines 0 comments Download
M chrome/browser/extensions/extension_menu_manager_unittest.cc View 1 2 3 4 5 6 2 chunks +11 lines, -12 lines 0 comments Download
M chrome/browser/extensions/extension_process_manager.cc View 1 2 3 4 7 chunks +15 lines, -8 lines 0 comments Download
M chrome/common/chrome_switches.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/chrome_switches.cc View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 32 (0 generated)
Tessa MacDuff
I just got this working so I wanted to send it to you for quick ...
9 years, 4 months ago (2011-08-17 00:51:12 UTC) #1
Aaron Boodman
This will work, but if we follow this pattern, it will lead to a lot ...
9 years, 4 months ago (2011-08-17 04:24:14 UTC) #2
Tessa MacDuff
I agree, that makes a lot more sense. I'll take a whack at it today.
9 years, 4 months ago (2011-08-17 17:10:12 UTC) #3
Tessa MacDuff
http://codereview.chromium.org/7672009/diff/1/chrome/browser/extensions/extension_process_manager.cc File chrome/browser/extensions/extension_process_manager.cc (right): http://codereview.chromium.org/7672009/diff/1/chrome/browser/extensions/extension_process_manager.cc#newcode64 chrome/browser/extensions/extension_process_manager.cc:64: !CommandLine::ForCurrentProcess()->HasSwitch( On 2011/08/17 04:24:15, Aaron Boodman wrote: > If ...
9 years, 4 months ago (2011-08-17 17:51:24 UTC) #4
Aaron Boodman
http://codereview.chromium.org/7672009/diff/1/chrome/browser/extensions/extension_process_manager.cc File chrome/browser/extensions/extension_process_manager.cc (right): http://codereview.chromium.org/7672009/diff/1/chrome/browser/extensions/extension_process_manager.cc#newcode64 chrome/browser/extensions/extension_process_manager.cc:64: !CommandLine::ForCurrentProcess()->HasSwitch( On 2011/08/17 17:51:24, Tessa MacDuff wrote: > On ...
9 years, 4 months ago (2011-08-17 18:13:35 UTC) #5
Aaron Boodman
Matt and I had a perhaps useful idea: instead of having the queue contain 'events ...
9 years, 4 months ago (2011-08-17 20:38:55 UTC) #6
Tessa MacDuff
I moved all the background page creation stuff to ExtensionEventRouter and implemented a simple pending ...
9 years, 4 months ago (2011-08-18 16:58:09 UTC) #7
Aaron Boodman
http://codereview.chromium.org/7672009/diff/5002/chrome/browser/extensions/extension_event_router.cc File chrome/browser/extensions/extension_event_router.cc (right): http://codereview.chromium.org/7672009/diff/5002/chrome/browser/extensions/extension_event_router.cc#newcode190 chrome/browser/extensions/extension_event_router.cc:190: void ExtensionEventRouter::MaybeDispatchEventImpl( Another 'maybe' function. You could eliminate this ...
9 years, 4 months ago (2011-08-18 19:25:55 UTC) #8
Aaron Boodman
http://codereview.chromium.org/7672009/diff/5002/chrome/browser/extensions/extension_event_router.cc File chrome/browser/extensions/extension_event_router.cc (right): http://codereview.chromium.org/7672009/diff/5002/chrome/browser/extensions/extension_event_router.cc#newcode289 chrome/browser/extensions/extension_event_router.cc:289: pending_events_[extension_id].clear(); Little nit: If these one-liner methods aren't called ...
9 years, 4 months ago (2011-08-18 19:29:06 UTC) #9
Tessa MacDuff
I agree with all your comments and will address them. Wanted to discuss a few, ...
9 years, 4 months ago (2011-08-18 20:49:39 UTC) #10
Aaron Boodman
http://codereview.chromium.org/7672009/diff/5002/chrome/browser/extensions/extension_event_router.cc File chrome/browser/extensions/extension_event_router.cc (right): http://codereview.chromium.org/7672009/diff/5002/chrome/browser/extensions/extension_event_router.cc#newcode298 chrome/browser/extensions/extension_event_router.cc:298: // being re-enqueued if the Background Page still isn't ...
9 years, 4 months ago (2011-08-18 21:19:23 UTC) #11
Tessa MacDuff
There are still a couple TODOs (including handing broadcast Events) and some try bots failing. ...
9 years, 4 months ago (2011-08-23 18:18:42 UTC) #12
Aaron Boodman
Cool almost there. http://codereview.chromium.org/7672009/diff/11009/chrome/browser/extensions/extension_event_router.cc File chrome/browser/extensions/extension_event_router.cc (right): http://codereview.chromium.org/7672009/diff/11009/chrome/browser/extensions/extension_event_router.cc#newcode82 chrome/browser/extensions/extension_event_router.cc:82: task_factory_.RevokeAll(); Not necessary -- this happens ...
9 years, 4 months ago (2011-08-23 22:41:16 UTC) #13
Tessa MacDuff
http://codereview.chromium.org/7672009/diff/11009/chrome/browser/extensions/extension_event_router.cc File chrome/browser/extensions/extension_event_router.cc (right): http://codereview.chromium.org/7672009/diff/11009/chrome/browser/extensions/extension_event_router.cc#newcode82 chrome/browser/extensions/extension_event_router.cc:82: task_factory_.RevokeAll(); On 2011/08/23 22:41:16, Aaron Boodman wrote: > Not ...
9 years, 4 months ago (2011-08-24 00:34:22 UTC) #14
Aaron Boodman
LGTM, you'll need to get approval from an owner of base/. http://codereview.chromium.org/7672009/diff/11009/chrome/browser/extensions/extension_event_router.cc File chrome/browser/extensions/extension_event_router.cc (right): ...
9 years, 4 months ago (2011-08-24 18:49:32 UTC) #15
Tessa MacDuff
Hi Darin, This change adds to task.h a version of NewRunnableMethod() that takes method and ...
9 years, 4 months ago (2011-08-24 20:06:46 UTC) #16
Aaron Boodman
+brettw, evan (darin is pretty busy) OWNERS: I realize that large numbers of params to ...
9 years, 4 months ago (2011-08-24 21:12:32 UTC) #17
Evan Martin
I wonder if rather than a special-purpose struct, a struct named ExtensionEvent would be an ...
9 years, 4 months ago (2011-08-24 21:31:32 UTC) #18
brettw
base LGTM
9 years, 4 months ago (2011-08-24 21:36:59 UTC) #19
Tessa MacDuff
Thanks for the speedy reply! Unless you feel strongly Evan, I'll commit this using Brett's ...
9 years, 4 months ago (2011-08-24 22:03:08 UTC) #20
brettw
On 2011/08/24 21:36:59, brettw wrote: > base LGTM I only looked at the one file ...
9 years, 4 months ago (2011-08-24 22:13:47 UTC) #21
Aaron Boodman
On 2011/08/24 21:31:32, Evan Martin wrote: > I wonder if rather than a special-purpose struct, ...
9 years, 4 months ago (2011-08-24 22:24:32 UTC) #22
Tessa MacDuff
Since the args differ a bit for all the public DispatchEvent...() functions I'd like to ...
9 years, 4 months ago (2011-08-24 22:34:06 UTC) #23
Aaron Boodman
On 2011/08/24 22:34:06, Tessa MacDuff wrote: > Since the args differ a bit for all ...
9 years, 4 months ago (2011-08-25 19:32:41 UTC) #24
Tessa MacDuff
Ok, I changed DispatchEventImpl and APpendEvent to use a new ExtensionEvent struct. And I dropped ...
9 years, 4 months ago (2011-08-25 23:40:44 UTC) #25
Matt Perry
drive-by great start! http://codereview.chromium.org/7672009/diff/25001/chrome/browser/extensions/extension_event_router.cc File chrome/browser/extensions/extension_event_router.cc (right): http://codereview.chromium.org/7672009/diff/25001/chrome/browser/extensions/extension_event_router.cc#newcode237 chrome/browser/extensions/extension_event_router.cc:237: CHECK(!was_pending); Since it can actually happen ...
9 years, 4 months ago (2011-08-26 00:13:00 UTC) #26
Tessa MacDuff
I'll ping when the changes are ready, but I'll give Aaron a chance to object. ...
9 years, 4 months ago (2011-08-26 01:12:53 UTC) #27
Aaron Boodman
On 2011/08/26 01:12:53, Tessa MacDuff wrote: > I think adding a task list to ExtensionProcessManager ...
9 years, 4 months ago (2011-08-26 22:59:12 UTC) #28
Tessa MacDuff
I made the change Matt suggested but it's not working. A DCHECK has started failing ...
9 years, 3 months ago (2011-08-29 19:21:40 UTC) #29
Tessa MacDuff
http://codereview.chromium.org/7672009/diff/29001/chrome/browser/extensions/extension_event_router.h File chrome/browser/extensions/extension_event_router.h (right): http://codereview.chromium.org/7672009/diff/29001/chrome/browser/extensions/extension_event_router.h#newcode128 chrome/browser/extensions/extension_event_router.h:128: typedef std::vector<linked_ptr<const ExtensionEvent> > PendingEventsList; IfI make this a ...
9 years, 3 months ago (2011-08-29 20:15:32 UTC) #30
Tessa MacDuff
Ok, I think I fixed it. (Wow, lunch helps me think!) The ExtensionEvent was being ...
9 years, 3 months ago (2011-08-29 20:38:51 UTC) #31
commit-bot: I haz the power
9 years, 3 months ago (2011-08-31 16:27:49 UTC) #32
Change committed as 98981

Powered by Google App Engine
This is Rietveld 408576698