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

Issue 2181413002: [headless] Remove default browser context. (Closed)

Created:
4 years, 4 months ago by altimin
Modified:
4 years, 4 months ago
CC:
chromium-reviews, alex clarke (OOO till 29th), Eric Seckler
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[headless] Public API changes: - [incompatible] Removed default browser context from HeadlessBrowser and HeadlessBrowser::CreateWebContents methods. Now BrowserContext should be created explicitly. - [incompatible] ProtocolHandlers cannot be set in HeadlessBrowser::Options due to being move-only and not reusable across different BrowserContexts. - Added more configurable options to HeadlessBrowserContext. - Now user data directory can be set. - HeadlessBrowser::Shutdown now closes all WebContents. - All WebContents associated with a HeadlessBrowserContext are now deleted when user deletes a BrowserContext. Internal library changes: - Added HeadlessBrowserContextOptions class, allowing for more customization for BrowserContext and for fallback to default browser-wide settings from HeadlessBrowser::Options. - Removed SetOptionsForTesting. Now BrowserContext should be created for this purposes. Misc: - Made linter happy. BUG=546953, 624837 Committed: https://crrev.com/93a0240a75dafc41691457d253e090ac4d66506e Cr-Commit-Position: refs/heads/master@{#409527}

Patch Set 1 #

Patch Set 2 : Delete default browser context #

Total comments: 6

Patch Set 3 : Small fixes #

Total comments: 35

Patch Set 4 : Rebased to master #

Patch Set 5 : Fixes according to Sami's comments #

Total comments: 7

Patch Set 6 : Changes according to Alex's and Eric's comments & rebased to master #

Total comments: 2

Patch Set 7 : More fixes #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+902 lines, -466 lines) Patch
M headless/BUILD.gn View 1 3 chunks +123 lines, -184 lines 0 comments Download
M headless/app/headless_shell.cc View 1 5 chunks +12 lines, -1 line 0 comments Download
M headless/app/headless_shell_switches.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M headless/app/headless_shell_switches.cc View 1 2 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download
M headless/lib/browser/headless_browser_context_impl.h View 1 2 3 4 5 2 chunks +24 lines, -6 lines 0 comments Download
M headless/lib/browser/headless_browser_context_impl.cc View 1 2 3 4 7 chunks +103 lines, -20 lines 0 comments Download
A headless/lib/browser/headless_browser_context_options.h View 1 2 3 1 chunk +67 lines, -0 lines 0 comments Download
A headless/lib/browser/headless_browser_context_options.cc View 1 2 3 4 1 chunk +68 lines, -0 lines 0 comments Download
M headless/lib/browser/headless_browser_impl.h View 1 4 chunks +8 lines, -7 lines 0 comments Download
M headless/lib/browser/headless_browser_impl.cc View 1 2 3 6 chunks +39 lines, -34 lines 0 comments Download
M headless/lib/browser/headless_browser_main_parts.h View 1 1 chunk +0 lines, -3 lines 0 comments Download
M headless/lib/browser/headless_browser_main_parts.cc View 1 2 3 4 5 1 chunk +2 lines, -9 lines 0 comments Download
M headless/lib/browser/headless_content_browser_client.cc View 1 1 chunk +5 lines, -1 line 0 comments Download
M headless/lib/browser/headless_devtools.h View 1 1 chunk +4 lines, -3 lines 0 comments Download
M headless/lib/browser/headless_devtools.cc View 1 4 chunks +9 lines, -7 lines 0 comments Download
M headless/lib/browser/headless_devtools_manager_delegate.h View 1 3 chunks +10 lines, -0 lines 0 comments Download
M headless/lib/browser/headless_devtools_manager_delegate.cc View 1 2 3 4 chunks +27 lines, -13 lines 0 comments Download
M headless/lib/browser/headless_url_request_context_getter.h View 1 3 chunks +3 lines, -1 line 0 comments Download
M headless/lib/browser/headless_url_request_context_getter.cc View 1 2 3 4 2 chunks +8 lines, -10 lines 0 comments Download
M headless/lib/browser/headless_web_contents_impl.h View 1 4 chunks +12 lines, -8 lines 0 comments Download
M headless/lib/browser/headless_web_contents_impl.cc View 1 2 3 9 chunks +42 lines, -29 lines 0 comments Download
M headless/lib/embedder_mojo_browsertest.cc View 1 2 3 4 chunks +15 lines, -21 lines 0 comments Download
M headless/lib/headless_browser_browsertest.cc View 1 2 3 4 5 6 8 chunks +117 lines, -34 lines 0 comments Download
M headless/lib/headless_browser_context_browsertest.cc View 1 5 chunks +41 lines, -10 lines 0 comments Download
M headless/lib/headless_devtools_client_browsertest.cc View 1 2 3 2 chunks +69 lines, -0 lines 0 comments Download
M headless/lib/headless_web_contents_browsertest.cc View 1 2 chunks +8 lines, -4 lines 0 comments Download
M headless/public/headless_browser.h View 1 2 3 4 5 6 6 chunks +33 lines, -30 lines 1 comment Download
M headless/public/headless_browser.cc View 1 2 3 3 chunks +9 lines, -6 lines 0 comments Download
M headless/public/headless_browser_context.h View 1 2 3 4 5 5 chunks +28 lines, -4 lines 0 comments Download
M headless/public/headless_web_contents.h View 1 2 3 5 chunks +7 lines, -10 lines 0 comments Download
M headless/test/headless_browser_test.h View 1 2 chunks +1 line, -5 lines 0 comments Download
M headless/test/headless_browser_test.cc View 1 3 chunks +4 lines, -6 lines 0 comments Download

Messages

Total messages: 25 (9 generated)
altimin
4 years, 4 months ago (2016-08-02 18:15:16 UTC) #4
altimin
PTAL
4 years, 4 months ago (2016-08-02 18:30:34 UTC) #6
Sami
Great cleanup! Some suggestions below. https://codereview.chromium.org/2181413002/diff/20001/headless/app/headless_shell_switches.cc File headless/app/headless_shell_switches.cc (right): https://codereview.chromium.org/2181413002/diff/20001/headless/app/headless_shell_switches.cc#newcode34 headless/app/headless_shell_switches.cc:34: // User data directory ...
4 years, 4 months ago (2016-08-03 11:20:31 UTC) #8
altimin
PTAL https://codereview.chromium.org/2181413002/diff/20001/headless/app/headless_shell_switches.cc File headless/app/headless_shell_switches.cc (right): https://codereview.chromium.org/2181413002/diff/20001/headless/app/headless_shell_switches.cc#newcode34 headless/app/headless_shell_switches.cc:34: // User data directory for browser to store ...
4 years, 4 months ago (2016-08-03 11:54:10 UTC) #9
alex clarke (OOO till 29th)
https://codereview.chromium.org/2181413002/diff/40001/headless/app/headless_shell_switches.cc File headless/app/headless_shell_switches.cc (right): https://codereview.chromium.org/2181413002/diff/40001/headless/app/headless_shell_switches.cc#newcode34 headless/app/headless_shell_switches.cc:34: // User data directory for browser to store its ...
4 years, 4 months ago (2016-08-03 11:55:20 UTC) #10
Eric Seckler
+1 :) https://codereview.chromium.org/2181413002/diff/80001/headless/lib/browser/headless_browser_main_parts.cc File headless/lib/browser/headless_browser_main_parts.cc (right): https://codereview.chromium.org/2181413002/diff/80001/headless/lib/browser/headless_browser_main_parts.cc#newcode11 headless/lib/browser/headless_browser_main_parts.cc:11: #include "headless/lib/browser/headless_devtools_manager_delegate.h" Do we need this here? ...
4 years, 4 months ago (2016-08-03 12:17:58 UTC) #11
Sami
By the way, could you link this to bug 624837 since I think the data ...
4 years, 4 months ago (2016-08-03 12:40:30 UTC) #12
altimin
PTAL https://codereview.chromium.org/2181413002/diff/40001/headless/app/headless_shell_switches.cc File headless/app/headless_shell_switches.cc (right): https://codereview.chromium.org/2181413002/diff/40001/headless/app/headless_shell_switches.cc#newcode34 headless/app/headless_shell_switches.cc:34: // User data directory for browser to store ...
4 years, 4 months ago (2016-08-03 12:46:18 UTC) #14
Sami
https://codereview.chromium.org/2181413002/diff/40001/headless/lib/browser/headless_browser_impl.cc File headless/lib/browser/headless_browser_impl.cc (right): https://codereview.chromium.org/2181413002/diff/40001/headless/lib/browser/headless_browser_impl.cc#newcode84 headless/lib/browser/headless_browser_impl.cc:84: // We need to close all WebContents here. On ...
4 years, 4 months ago (2016-08-03 13:46:14 UTC) #15
Eric Seckler
https://codereview.chromium.org/2181413002/diff/80001/headless/lib/browser/headless_content_browser_client.cc File headless/lib/browser/headless_content_browser_client.cc (right): https://codereview.chromium.org/2181413002/diff/80001/headless/lib/browser/headless_content_browser_client.cc#newcode33 headless/lib/browser/headless_content_browser_client.cc:33: std::unique_ptr<HeadlessDevToolsManagerDelegate> devtools_manager_delegate = On 2016/08/03 12:46:18, altimin wrote: > ...
4 years, 4 months ago (2016-08-03 13:55:30 UTC) #16
altimin
PTAL https://codereview.chromium.org/2181413002/diff/40001/headless/lib/browser/headless_browser_impl.cc File headless/lib/browser/headless_browser_impl.cc (right): https://codereview.chromium.org/2181413002/diff/40001/headless/lib/browser/headless_browser_impl.cc#newcode84 headless/lib/browser/headless_browser_impl.cc:84: // We need to close all WebContents here. ...
4 years, 4 months ago (2016-08-03 14:18:51 UTC) #17
altimin
PTAL https://codereview.chromium.org/2181413002/diff/40001/headless/lib/browser/headless_browser_impl.cc File headless/lib/browser/headless_browser_impl.cc (right): https://codereview.chromium.org/2181413002/diff/40001/headless/lib/browser/headless_browser_impl.cc#newcode84 headless/lib/browser/headless_browser_impl.cc:84: // We need to close all WebContents here. ...
4 years, 4 months ago (2016-08-03 14:18:51 UTC) #18
Sami
lgtm. https://codereview.chromium.org/2181413002/diff/40001/headless/lib/headless_browser_browsertest.cc File headless/lib/headless_browser_browsertest.cc (right): https://codereview.chromium.org/2181413002/diff/40001/headless/lib/headless_browser_browsertest.cc#newcode40 headless/lib/headless_browser_browsertest.cc:40: EXPECT_EQ(browser()->GetAllWebContents(), On 2016/08/03 14:18:51, altimin wrote: > On ...
4 years, 4 months ago (2016-08-03 14:25:49 UTC) #19
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/2181413002/120001
4 years, 4 months ago (2016-08-03 14:28:04 UTC) #21
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years, 4 months ago (2016-08-03 16:27:04 UTC) #23
commit-bot: I haz the power
4 years, 4 months ago (2016-08-03 16:28:57 UTC) #25
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/93a0240a75dafc41691457d253e090ac4d66506e
Cr-Commit-Position: refs/heads/master@{#409527}

Powered by Google App Engine
This is Rietveld 408576698