OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "mojo/shell/application_instance.h" | 5 #include "mojo/shell/application_instance.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "mojo/application/public/interfaces/content_handler.mojom.h" | 9 #include "mojo/application/public/interfaces/content_handler.mojom.h" |
10 #include "mojo/common/common_type_converters.h" | 10 #include "mojo/common/common_type_converters.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 if (!url.is_valid()) { | 88 if (!url.is_valid()) { |
89 LOG(ERROR) << "Error: invalid URL: " << url_string; | 89 LOG(ERROR) << "Error: invalid URL: " << url_string; |
90 callback.Run(kInvalidContentHandlerID); | 90 callback.Run(kInvalidContentHandlerID); |
91 return; | 91 return; |
92 } | 92 } |
93 if (allow_any_application_ || filter_.find(url.spec()) != filter_.end()) { | 93 if (allow_any_application_ || filter_.find(url.spec()) != filter_.end()) { |
94 CapabilityFilter capability_filter = GetPermissiveCapabilityFilter(); | 94 CapabilityFilter capability_filter = GetPermissiveCapabilityFilter(); |
95 if (!filter.is_null()) | 95 if (!filter.is_null()) |
96 capability_filter = filter->filter.To<CapabilityFilter>(); | 96 capability_filter = filter->filter.To<CapabilityFilter>(); |
97 manager_->ConnectToApplication( | 97 manager_->ConnectToApplication( |
98 this, app_request.Pass(), std::string(), GURL(), services.Pass(), | 98 this, app_request.Pass(), std::string(), services.Pass(), |
99 exposed_services.Pass(), capability_filter, base::Closure(), callback); | 99 exposed_services.Pass(), capability_filter, base::Closure(), callback); |
100 } else { | 100 } else { |
101 LOG(WARNING) << "CapabilityFilter prevented connection from: " << | 101 LOG(WARNING) << "CapabilityFilter prevented connection from: " << |
102 identity_.url << " to: " << url.spec(); | 102 identity_.url << " to: " << url.spec(); |
103 callback.Run(kInvalidContentHandlerID); | 103 callback.Run(kInvalidContentHandlerID); |
104 } | 104 } |
105 } | 105 } |
106 | 106 |
107 void ApplicationInstance::QuitApplication() { | 107 void ApplicationInstance::QuitApplication() { |
108 queue_requests_ = true; | 108 queue_requests_ = true; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 | 168 |
169 queue_requests_ = false; | 169 queue_requests_ = false; |
170 for (auto request : queued_client_requests_) | 170 for (auto request : queued_client_requests_) |
171 CallAcceptConnection(make_scoped_ptr(request)); | 171 CallAcceptConnection(make_scoped_ptr(request)); |
172 | 172 |
173 queued_client_requests_.clear(); | 173 queued_client_requests_.clear(); |
174 } | 174 } |
175 | 175 |
176 } // namespace shell | 176 } // namespace shell |
177 } // namespace mojo | 177 } // namespace mojo |
OLD | NEW |