Skip to content

webview: partition attribute - #2459

Merged
zcbenz merged 6 commits into
electron:masterfrom
deepak1556:web_view_partition_patch
Sep 4, 2015
Merged

zcbenz merged 6 commits into
electron:masterfrom
deepak1556:web_view_partition_patch

Conversation

@deepak1556

Copy link
Copy Markdown
Member
  • Create separate browser context for each partition
  • Fix Devtools not shown for partitions
  • Pass tests

Depends on electron-archive/brightray#136
Fixes #1010

@deepak1556
deepak1556 force-pushed the web_view_partition_patch branch 5 times, most recently from 57b2105 to be79874 Compare August 10, 2015 22:04
@deepak1556
deepak1556 force-pushed the web_view_partition_patch branch 5 times, most recently from b7ef8f4 to 379202b Compare August 22, 2015 03:19
@zcbenz

zcbenz commented Aug 25, 2015

Copy link
Copy Markdown
Contributor

Can we refactor this to use a new BrowserContext for each partition instead of allocating a new request context for each partition in one BrowserContext?

The trouble comes from the cookies API because it assumes each BrowserContext has only one request context however this implementation breaks this assumption, the consequence is we are not able to use cookies API for the webview partitions unless we add a new bunch of APIs by mapping RequestContext to JavaScript. And in future it will add more and more trouble when we try to add more APIs around BrowserContext.

However simply mapping each partition to a new BrowserContext solves all the troubles, we no longer need to manage the whole storage partition things, and our APIs keep simple.

@deepak1556
deepak1556 force-pushed the web_view_partition_patch branch 4 times, most recently from 2d8a587 to 710bdae Compare August 27, 2015 00:42
@deepak1556

Copy link
Copy Markdown
Member Author

@zcbenz have updated the PR to use separate browser context for each partition. Also regarding this issue #1720 requesting cache disable in webview, this is now possible with temporary partition, guess that can be considered to be fixed ?

Also this will be a breaking change, people already using webview need to add a partition attribute with persist: if they need cache support and persist storage. The default is temporary partition.

@zcbenz

zcbenz commented Aug 28, 2015

Copy link
Copy Markdown
Contributor

Also regarding this issue #1720 requesting cache disable in webview, this is now possible with temporary partition, guess that can be considered to be fixed ?

Disabling cache requires every request to be uncached, I think temporary partition still has caching?

Also this will be a breaking change, people already using webview need to add a partition attribute with persist: if they need cache support and persist storage. The default is temporary partition.

When partition is not specified I think we should use the host's BrowserContext, though it behaves differently from Chrome's webview. Generally we should always avoid breaking changes unless we have to.

@deepak1556
deepak1556 force-pushed the web_view_partition_patch branch from 1888da0 to 2039937 Compare August 28, 2015 07:31
@deepak1556

Copy link
Copy Markdown
Member Author

I think temporary partition still has caching?

yeah, my bad did some wrong tests.

When partition is not specified I think we should use the host's BrowserContext, though it behaves differently from Chrome's webview. Generally we should always avoid breaking changes unless we have to.

Fixed.

@deepak1556

Copy link
Copy Markdown
Member Author

@zcbenz anything missed here ?

Comment thread atom/browser/atom_browser_main_parts.h Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a base::ScopedPtrHashMap for storing pointers, using map to manage pointers is discouraged.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@deepak1556
deepak1556 force-pushed the web_view_partition_patch branch from 6b3935d to b8b8981 Compare August 31, 2015 22:25
@deepak1556
deepak1556 force-pushed the web_view_partition_patch branch 2 times, most recently from 9c65eea to 2035d20 Compare September 3, 2015 15:38
@deepak1556

Copy link
Copy Markdown
Member Author

@zcbenz have addressed all the points, thanks!

@deepak1556
deepak1556 force-pushed the web_view_partition_patch branch from 2035d20 to 03ba953 Compare September 3, 2015 15:59
zcbenz added a commit that referenced this pull request Sep 4, 2015
@zcbenz
zcbenz merged commit 6f9d822 into electron:master Sep 4, 2015
@zcbenz

zcbenz commented Sep 4, 2015

Copy link
Copy Markdown
Contributor

Thanks!

etiktin pushed a commit to etiktin/electron that referenced this pull request Sep 4, 2015
build.py would fail on Windows due to a couple of changes made in electron#2459.

This commit fixes those issues.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants