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

Add a way to remove all resources from the resource cache that have a certain namespace #1435

Closed
wants to merge 1 commit into from

Conversation

@nical
Copy link
Collaborator

nical commented Jun 29, 2017

This is a tad ugly but it makes it a lot easier in firefox when a content-process crashes, to clean up every resources that were associated to it. The alternative is to maintain a map of all of the image and font keys in use in gecko-land.


This change is Reviewable

… certain namespace.

This is a tad ugly but it makes it a lot easier in firefox when a content-process crashes, to clean up every resources that were associated to it. The alternative is to maintain a map of all of the image and font keys in use in gecko-land.
@nical
Copy link
Collaborator Author

nical commented Jun 29, 2017

@@ -62,6 +62,7 @@ pub enum ApiMsg {
/// to forward gecko-specific messages to the render thread preserving the ordering
/// within the other messages.
ExternalEvent(ExternalEvent),
RemoveAllResourcesWithNamespace(IdNamespace),

This comment has been minimized.

@kvark

kvark Jun 30, 2017

Member

Perhaps, just ClearNamespace?

@@ -764,6 +764,11 @@ impl ResourceCache {
debug_assert_eq!(self.state, State::QueryResources);
self.state = State::Idle;
}

pub fn remove_all_resources_with_namespace(&mut self, namespace: IdNamespace) {
self.resources.image_templates.images.retain(|key: &ImageKey, _|{ key.0 != namespace.0 });

This comment has been minimized.

@kvark

kvark Jun 30, 2017

Member

I'm about to make a PR to make namespaces more explicit

@bors-servo
Copy link
Contributor

bors-servo commented Jun 30, 2017

The latest upstream changes (presumably #1381) made this pull request unmergeable. Please resolve the merge conflicts.

@kvark
Copy link
Member

kvark commented Jul 1, 2017

Replaced by #1445
Otherwise, would need a rebase plus fix to compile on 1.17

@kvark kvark closed this Jul 1, 2017
bors-servo added a commit that referenced this pull request Jul 20, 2017
Clear resources in a namespace

Builds upon #1435

cc @nical
r? @glennw

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/1445)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.