Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Workspace directory for usedata directory #1548

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

amartya4256
Copy link
Contributor

With this contribution, Edge browser uses the workspace directory for the userdata directory for the separation of the usage of userdata directory per workspace by the webview2Environment.

Depends on eclipse-platform/eclipse.platform.ui#2434

contributes to #1013

@iloveeclipse
Copy link
Member

I'm not sure if workspace is the right place for user data of Edge browser that can be used on workspace free RCP applications.

Copy link
Contributor

github-actions bot commented Oct 21, 2024

Test Results

   483 files  ±0     483 suites  ±0   8m 25s ⏱️ -26s
 4 135 tests ±0   4 125 ✅ ±0   7 💤 ±0  3 ❌ ±0 
16 333 runs  ±0  16 240 ✅ ±0  90 💤 ±0  3 ❌ ±0 

For more details on these failures, see this check.

Results for commit f232fd7. ± Comparison against base commit b8ec749.

♻️ This comment has been updated with latest results.

@HeikoKlare
Copy link
Contributor

I'm not sure if workspace is the right place for user data of Edge browser that can be used on workspace free RCP applications.

I would rather propose to use the workspace directory whenever there is such a directory and in other cases use a different one (probably the ordinary user-data folder as used now).

In addition, SWT should not depend on the concept of a "workspace URL". There should rather be some "custom edge data folder", "display-specific edge data folder" or the like instead. Also, we cannot replace the usage of the existing system property, because people may still want to use that opportunity (in particular in plain SWT applicationS).

So what about using these values in decreasing preference:

  • Use the value of the existing system property if provided?
  • Use a value for some "custom edge data directory" defined as data in the display if specified (which can then be used by the Eclipse platform to define some specific value, may it workspace-dependent or not).
  • Use the default value.

@laeubi
Copy link
Contributor

laeubi commented Oct 21, 2024

I'm not sure what the edge user data directory is actually storing, but from OSGi perspective there is

https://docs.osgi.org/javadoc/osgi.core/8.0.0/org/osgi/framework/Bundle.html#getDataFile-java.lang.String-

@akurtakov
Copy link
Member

I'm not sure what the edge user data directory is actually storing, but from OSGi perspective there is

https://docs.osgi.org/javadoc/osgi.core/8.0.0/org/osgi/framework/Bundle.html#getDataFile-java.lang.String-

SWT should stay usable in non-OSGi environment too.

@fedejeanne fedejeanne linked an issue Oct 25, 2024 that may be closed by this pull request
@amartya4256 amartya4256 force-pushed the edge_use_workspace_for_userdata branch from 1ff728a to 864b5d0 Compare October 25, 2024 10:16
With this contribution, Edge browser uses the workspace directory for
the userdata directory for the separation of the usage of userdata
directory per workspace by the webview2Environment.

contributes to eclipse-platform#1013
@amartya4256 amartya4256 force-pushed the edge_use_workspace_for_userdata branch from 864b5d0 to f232fd7 Compare October 25, 2024 10:25
Comment on lines +480 to +482
if (dataDir == null) {
dataDir = (String) browser.getDisplay().getData(DISPLAY_USER_DATA_FOLDER);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Extract the logic to calculate dataDir to its own method: getDataDir(...).

Also, why use both browser.getDisplay() and Display.getCurrent() as the displays when fetching the data? (see lines below too)

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.

No more handle exceptions with the Edge browser
6 participants