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

Unified Diff: services/navigation/navigation.h

Issue 2268603002: Avoid UAF on ConnectionFilter impls (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/mus/render_widget_window_tree_client_factory.cc ('k') | services/navigation/navigation.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/navigation/navigation.h
diff --git a/services/navigation/navigation.h b/services/navigation/navigation.h
index 3a40a7b91d740e2eec8d50373d3a48d7a0441806..1c2b26bb1d73d9fda6cadb7eac304038be0fb6f0 100644
--- a/services/navigation/navigation.h
+++ b/services/navigation/navigation.h
@@ -6,6 +6,7 @@
#define SERVICES_NAVIGATION_NAVIGATION_H_
#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
#include "base/sequenced_task_runner.h"
#include "content/public/common/connection_filter.h"
#include "mojo/public/cpp/bindings/binding_set.h"
@@ -20,9 +21,7 @@ class BrowserContext;
namespace navigation {
-class Navigation : public content::ConnectionFilter,
- public shell::InterfaceFactory<mojom::ViewFactory>,
- public mojom::ViewFactory {
+class Navigation : public content::ConnectionFilter, public mojom::ViewFactory {
public:
Navigation();
~Navigation() override;
@@ -33,14 +32,11 @@ class Navigation : public content::ConnectionFilter,
shell::InterfaceRegistry* registry,
shell::Connector* connector) override;
- // shell::InterfaceFactory<mojom::ViewFactory>:
- void Create(const shell::Identity& remote_identity,
- mojom::ViewFactoryRequest request) override;
-
// mojom::ViewFactory:
void CreateView(mojom::ViewClientPtr client,
mojom::ViewRequest request) override;
+ void CreateViewFactory(mojom::ViewFactoryRequest request);
void ViewFactoryLost();
scoped_refptr<base::SequencedTaskRunner> view_task_runner_;
@@ -53,6 +49,8 @@ class Navigation : public content::ConnectionFilter,
mojo::BindingSet<mojom::ViewFactory> bindings_;
+ base::WeakPtrFactory<Navigation> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(Navigation);
};
« no previous file with comments | « content/renderer/mus/render_widget_window_tree_client_factory.cc ('k') | services/navigation/navigation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698