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

Issue 2210323002: [headless] Do not give ownership of HeadlessBrowserContext to user. (Closed)

Created:
4 years, 4 months ago by altimin
Modified:
4 years, 4 months ago
CC:
chromium-reviews, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, devtools-reviews_chromium.org, darin (slow to review), ben+mojo_chromium.org, pfeldman
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[headless] Do not give ownership of HeadlessBrowserContext to user. Public API changes: - HeadlessBrowserContext::Builder::Build now returns raw pointer instead of unique_ptr. Lifetime of HeadlessBrowserContexts is managed by the browser now. - Added HeadlessBrowserContext::Close method to give used the option to delete HeadlessBrowserContext. - Added HeadlessBrowserContext::Id and HeadlessBrowser::GetBrowserContextForId methods for BrowserContext identification. Internal changes: - HeadlessWebContents are owned by HeadlessBrowserContext. - HeadlessBrowserContexts are now owned by HeadlessBrowser. - Instead of browser having a weak pointer to HeadlessDevToolsManagerDelegate opposite happens: HeadlessDevToolsManagerDelegate weakly references HeadlessBrowser. BUG=546953 Committed: https://crrev.com/bf875c9ce90acb08c5be5f26b1df53085013e0e2 Cr-Commit-Position: refs/heads/master@{#409816}

Patch Set 1 #

Patch Set 2 : Added GetWeakPtr() to HeadlessBrowserImpl #

Patch Set 3 : Removed browser_context_map_ from HeadlessDevToolsManagerDelegate #

Total comments: 6

Patch Set 4 : Fixes according to comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+374 lines, -233 lines) Patch
M headless/app/headless_shell.cc View 3 chunks +4 lines, -3 lines 0 comments Download
M headless/lib/browser/headless_browser_context_impl.h View 1 2 3 2 chunks +22 lines, -9 lines 0 comments Download
M headless/lib/browser/headless_browser_context_impl.cc View 1 2 3 8 chunks +73 lines, -25 lines 0 comments Download
M headless/lib/browser/headless_browser_impl.h View 1 2 3 3 chunks +19 lines, -14 lines 0 comments Download
M headless/lib/browser/headless_browser_impl.cc View 1 2 3 3 chunks +54 lines, -51 lines 0 comments Download
M headless/lib/browser/headless_content_browser_client.cc View 1 1 chunk +1 line, -5 lines 0 comments Download
M headless/lib/browser/headless_devtools_manager_delegate.h View 1 2 3 chunks +4 lines, -12 lines 0 comments Download
M headless/lib/browser/headless_devtools_manager_delegate.cc View 1 2 3 9 chunks +25 lines, -40 lines 0 comments Download
M headless/lib/browser/headless_web_contents_impl.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M headless/lib/browser/headless_web_contents_impl.cc View 1 2 3 4 chunks +6 lines, -6 lines 0 comments Download
M headless/lib/embedder_mojo_browsertest.cc View 1 3 chunks +5 lines, -3 lines 0 comments Download
M headless/lib/headless_browser_browsertest.cc View 12 chunks +89 lines, -34 lines 0 comments Download
M headless/lib/headless_browser_context_browsertest.cc View 1 5 chunks +7 lines, -6 lines 0 comments Download
M headless/lib/headless_devtools_client_browsertest.cc View 1 2 3 8 chunks +24 lines, -7 lines 0 comments Download
M headless/lib/headless_web_contents_browsertest.cc View 4 chunks +9 lines, -11 lines 0 comments Download
M headless/public/headless_browser.h View 1 2 3 2 chunks +12 lines, -4 lines 0 comments Download
M headless/public/headless_browser_context.h View 1 2 3 2 chunks +17 lines, -1 line 0 comments Download
M headless/test/headless_browser_test.h View 1 chunk +1 line, -1 line 0 comments Download
M headless/test/headless_browser_test.cc View 1 chunk +2 lines, -1 line 0 comments Download
A + headless/testserver.log View 1 2 3 0 chunks +-1 lines, --1 lines 0 comments Download

Messages

Total messages: 15 (8 generated)
altimin
PTAL
4 years, 4 months ago (2016-08-04 15:03:32 UTC) #3
Eric Seckler
lgtm Nice refactoring, the owner-hierarchy makes more sense to me now :) https://codereview.chromium.org/2210323002/diff/40001/headless/lib/headless_devtools_client_browsertest.cc File headless/lib/headless_devtools_client_browsertest.cc ...
4 years, 4 months ago (2016-08-04 15:43:37 UTC) #5
Sami
lgtm, thanks for the refactor. https://codereview.chromium.org/2210323002/diff/40001/headless/lib/browser/headless_browser_context_impl.h File headless/lib/browser/headless_browser_context_impl.h (right): https://codereview.chromium.org/2210323002/diff/40001/headless/lib/browser/headless_browser_context_impl.h#newcode41 headless/lib/browser/headless_browser_context_impl.h:41: HeadlessWebContents* GetWebContentsForDevtoolsAgentHostId( typo: DevTools ...
4 years, 4 months ago (2016-08-04 16:09:02 UTC) #6
alex clarke (OOO till 29th)
lgtm https://codereview.chromium.org/2210323002/diff/40001/headless/lib/browser/headless_devtools_manager_delegate.cc File headless/lib/browser/headless_devtools_manager_delegate.cc (right): https://codereview.chromium.org/2210323002/diff/40001/headless/lib/browser/headless_devtools_manager_delegate.cc#newcode75 headless/lib/browser/headless_devtools_manager_delegate.cc:75: HeadlessBrowserContext* context = On 2016/08/04 16:09:01, Sami wrote: ...
4 years, 4 months ago (2016-08-04 16:24:19 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2210323002/60001
4 years, 4 months ago (2016-08-04 16:29:22 UTC) #11
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 4 months ago (2016-08-04 17:09:23 UTC) #13
commit-bot: I haz the power
4 years, 4 months ago (2016-08-04 17:12:37 UTC) #15
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/bf875c9ce90acb08c5be5f26b1df53085013e0e2
Cr-Commit-Position: refs/heads/master@{#409816}

Powered by Google App Engine
This is Rietveld 408576698