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

Issue 2043603004: headless: Introduce a browser context (Closed)

Created:
4 years, 6 months ago by Sami
Modified:
4 years, 6 months ago
CC:
chromium-reviews, pfeldman, devtools-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

headless: Introduce a browser context A headless browser context can be used to isolate different WebContents from one another. Each context has a separate cache, cookies, local storage and other profile-related data. This patch also adds a way to create a HeadlessWebContents using a specific browser context instead of the default one. This can be used to isolate tabs from one another. Design doc: https://docs.google.com/document/d/1XAKvrxtSEoe65vNghSWC5S3kJ--z2Zpt2UWW1Fi8GiM/edit?pref=2&pli=1#heading=h.7r3ycehq63g2 BUG=546953, 617931 Committed: https://crrev.com/25c2c0123425d8ab3c9c02998d02d7accd1c42e2 Cr-Commit-Position: refs/heads/master@{#398853}

Patch Set 1 #

Patch Set 2 : Added a test. #

Patch Set 3 : Added WebContents builder #

Patch Set 4 : Add a builder for contexts too #

Patch Set 5 : Cleanup #

Total comments: 8

Patch Set 6 : Review comments #

Total comments: 4

Patch Set 7 : Address nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+492 lines, -377 lines) Patch
M headless/BUILD.gn View 2 chunks +3 lines, -2 lines 0 comments Download
M headless/app/headless_shell.cc View 1 2 1 chunk +4 lines, -7 lines 0 comments Download
D headless/lib/browser/headless_browser_context.h View 1 chunk +0 lines, -68 lines 0 comments Download
D headless/lib/browser/headless_browser_context.cc View 1 chunk +0 lines, -178 lines 0 comments Download
A + headless/lib/browser/headless_browser_context_impl.h View 1 2 3 4 5 4 chunks +13 lines, -8 lines 0 comments Download
A + headless/lib/browser/headless_browser_context_impl.cc View 1 2 3 4 5 4 chunks +41 lines, -20 lines 0 comments Download
M headless/lib/browser/headless_browser_impl.h View 1 2 3 3 chunks +3 lines, -3 lines 0 comments Download
M headless/lib/browser/headless_browser_impl.cc View 1 2 3 4 5 5 chunks +28 lines, -15 lines 0 comments Download
M headless/lib/browser/headless_browser_main_parts.h View 2 chunks +3 lines, -3 lines 0 comments Download
M headless/lib/browser/headless_browser_main_parts.cc View 3 chunks +4 lines, -3 lines 0 comments Download
M headless/lib/browser/headless_devtools.h View 1 chunk +2 lines, -2 lines 0 comments Download
M headless/lib/browser/headless_devtools.cc View 2 chunks +2 lines, -3 lines 0 comments Download
M headless/lib/browser/headless_url_request_context_getter.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M headless/lib/browser/headless_web_contents_impl.h View 1 2 3 4 5 1 chunk +1 line, -2 lines 0 comments Download
M headless/lib/browser/headless_web_contents_impl.cc View 1 2 3 4 5 3 chunks +40 lines, -5 lines 0 comments Download
M headless/lib/headless_browser_browsertest.cc View 1 2 3 4 5 8 chunks +160 lines, -10 lines 0 comments Download
M headless/lib/headless_web_contents_browsertest.cc View 1 2 2 chunks +10 lines, -4 lines 0 comments Download
M headless/public/headless_browser.h View 1 2 3 4 chunks +11 lines, -6 lines 0 comments Download
M headless/public/headless_browser.cc View 1 2 1 chunk +0 lines, -1 line 0 comments Download
A headless/public/headless_browser_context.h View 1 2 3 4 5 6 1 chunk +51 lines, -0 lines 0 comments Download
M headless/public/headless_web_contents.h View 1 2 3 4 5 6 2 chunks +43 lines, -0 lines 0 comments Download
M headless/test/headless_browser_test.h View 1 2 3 4 2 chunks +26 lines, -0 lines 0 comments Download
M headless/test/headless_browser_test.cc View 1 2 5 chunks +44 lines, -37 lines 0 comments Download

Messages

Total messages: 15 (7 generated)
Sami
4 years, 6 months ago (2016-06-08 16:31:19 UTC) #3
alex clarke (OOO till 29th)
https://codereview.chromium.org/2043603004/diff/80001/headless/lib/browser/headless_browser_impl.cc File headless/lib/browser/headless_browser_impl.cc (right): https://codereview.chromium.org/2043603004/diff/80001/headless/lib/browser/headless_browser_impl.cc#newcode52 headless/lib/browser/headless_browser_impl.cc:52: browser_context_impl = reinterpret_cast<HeadlessBrowserContextImpl*>( Nit: Elsewhere we've used the style ...
4 years, 6 months ago (2016-06-09 09:15:08 UTC) #4
Sami
Thanks for the review -- all addressed. https://codereview.chromium.org/2043603004/diff/80001/headless/lib/browser/headless_browser_impl.cc File headless/lib/browser/headless_browser_impl.cc (right): https://codereview.chromium.org/2043603004/diff/80001/headless/lib/browser/headless_browser_impl.cc#newcode52 headless/lib/browser/headless_browser_impl.cc:52: browser_context_impl = ...
4 years, 6 months ago (2016-06-09 11:14:39 UTC) #6
alex clarke (OOO till 29th)
LGTM modulo two nits. https://codereview.chromium.org/2043603004/diff/100001/headless/public/headless_web_contents.h File headless/public/headless_web_contents.h (right): https://codereview.chromium.org/2043603004/diff/100001/headless/public/headless_web_contents.h#newcode90 headless/public/headless_web_contents.h:90: Builder(HeadlessBrowserImpl* browser); nit: explicit https://codereview.chromium.org/2043603004/diff/100001/headless/public/headless_web_contents.h#newcode95 ...
4 years, 6 months ago (2016-06-09 11:26:08 UTC) #7
Sami
https://codereview.chromium.org/2043603004/diff/100001/headless/public/headless_web_contents.h File headless/public/headless_web_contents.h (right): https://codereview.chromium.org/2043603004/diff/100001/headless/public/headless_web_contents.h#newcode90 headless/public/headless_web_contents.h:90: Builder(HeadlessBrowserImpl* browser); On 2016/06/09 11:26:08, alex clarke wrote: > ...
4 years, 6 months ago (2016-06-09 11:33:17 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2043603004/120001
4 years, 6 months ago (2016-06-09 11:33:33 UTC) #11
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years, 6 months ago (2016-06-09 12:54:24 UTC) #13
commit-bot: I haz the power
4 years, 6 months ago (2016-06-09 12:55:59 UTC) #15
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/25c2c0123425d8ab3c9c02998d02d7accd1c42e2
Cr-Commit-Position: refs/heads/master@{#398853}

Powered by Google App Engine
This is Rietveld 408576698