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

Unified Diff: mojo/application/public/cpp/lib/application_impl.cc

Issue 1474563002: Make CapabilityFilter non-nullable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 1 month 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 | « mojo/application/public/cpp/application_impl.h ('k') | mojo/application/public/interfaces/shell.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/application/public/cpp/lib/application_impl.cc
diff --git a/mojo/application/public/cpp/lib/application_impl.cc b/mojo/application/public/cpp/lib/application_impl.cc
index 3f98a15caf093c9b1b3dafbea42ee90116330462..82fa7d88effffd3afa0ff96d7fa764771c3ed6af 100644
--- a/mojo/application/public/cpp/lib/application_impl.cc
+++ b/mojo/application/public/cpp/lib/application_impl.cc
@@ -27,9 +27,11 @@ void DefaultTerminationClosure() {
} // namespace
ApplicationImpl::ConnectParams::ConnectParams(const std::string& url)
- : request_(URLRequest::From(url)) {}
+ : ConnectParams(URLRequest::From(url)) {}
ApplicationImpl::ConnectParams::ConnectParams(URLRequestPtr request)
- : request_(request.Pass()) {}
+ : request_(request.Pass()), filter_(CapabilityFilter::New()) {
+ filter_->filter.mark_non_null();
+}
ApplicationImpl::ConnectParams::~ConnectParams() {}
ApplicationImpl::ApplicationImpl(ApplicationDelegate* delegate,
@@ -55,6 +57,7 @@ ApplicationImpl::~ApplicationImpl() {
scoped_ptr<ApplicationConnection> ApplicationImpl::ConnectToApplication(
const std::string& url) {
ConnectParams params(url);
+ params.set_filter(CreatePermissiveCapabilityFilter());
return ConnectToApplication(&params);
}
@@ -167,4 +170,12 @@ void ApplicationImpl::UnbindConnections(
shell->Bind(shell_.PassInterface());
}
+CapabilityFilterPtr CreatePermissiveCapabilityFilter() {
+ CapabilityFilterPtr filter(CapabilityFilter::New());
+ Array<String> all_interfaces;
+ all_interfaces.push_back("*");
+ filter->filter.insert("*", all_interfaces.Pass());
+ return filter.Pass();
+}
+
} // namespace mojo
« no previous file with comments | « mojo/application/public/cpp/application_impl.h ('k') | mojo/application/public/interfaces/shell.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698