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

Unified Diff: mojo/services/view_manager/view_manager_init_service_context.cc

Issue 534843002: Convert view manager to surfaces with uploading shim in client lib (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove overzealous shutdown check in cc/surfaces, add NON_EXPORTED_BASE for windows build, saturate… Created 6 years, 3 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
Index: mojo/services/view_manager/view_manager_init_service_context.cc
diff --git a/mojo/services/view_manager/view_manager_init_service_context.cc b/mojo/services/view_manager/view_manager_init_service_context.cc
index 99e40fca15ea056a3ca280f596038d47b5dfa1c3..79a7067bf13213897c1ed29513851d6b9f803432 100644
--- a/mojo/services/view_manager/view_manager_init_service_context.cc
+++ b/mojo/services/view_manager/view_manager_init_service_context.cc
@@ -17,8 +17,8 @@ ViewManagerInitServiceContext::ConnectParams::ConnectParams() {}
ViewManagerInitServiceContext::ConnectParams::~ConnectParams() {}
ViewManagerInitServiceContext::ViewManagerInitServiceContext()
- : is_tree_host_ready_(false),
- deleting_connection_(false) {}
+ : deleting_connection_(false) {
+}
ViewManagerInitServiceContext::~ViewManagerInitServiceContext() {}
void ViewManagerInitServiceContext::AddConnection(
@@ -49,7 +49,6 @@ void ViewManagerInitServiceContext::ConfigureIncomingConnection(
if (!connection_manager_.get()) {
connection_manager_.reset(new ConnectionManager(
connection,
- this,
base::Bind(&ViewManagerInitServiceContext::OnNativeViewportDeleted,
base::Unretained(this))));
}
@@ -59,18 +58,8 @@ void ViewManagerInitServiceContext::Embed(
const String& url,
ServiceProviderPtr service_provider,
const Callback<void(bool)>& callback) {
- ConnectParams* params = new ConnectParams;
- params->url = url.To<std::string>();
- params->callback = callback;
- params->service_provider.Bind(service_provider.PassMessagePipe());
- connect_params_.push_back(params);
- MaybeEmbed();
-}
-
-void ViewManagerInitServiceContext::OnDisplayManagerWindowTreeHostCreated() {
- DCHECK(!is_tree_host_ready_);
- is_tree_host_ready_ = true;
- MaybeEmbed();
+ connection_manager_->EmbedRoot(url, Get(&service_provider));
+ callback.Run(true);
}
void ViewManagerInitServiceContext::OnNativeViewportDeleted() {
@@ -85,17 +74,5 @@ void ViewManagerInitServiceContext::OnNativeViewportDeleted() {
connection_manager_.reset();
}
-void ViewManagerInitServiceContext::MaybeEmbed() {
- if (!is_tree_host_ready_)
- return;
-
- for (ScopedVector<ConnectParams>::const_iterator it = connect_params_.begin();
- it != connect_params_.end(); ++it) {
- connection_manager_->EmbedRoot((*it)->url, (*it)->service_provider.Pass());
- (*it)->callback.Run(true);
- }
- connect_params_.clear();
-}
-
} // namespace service
} // namespace mojo
« no previous file with comments | « mojo/services/view_manager/view_manager_init_service_context.h ('k') | mojo/services/view_manager/view_manager_service_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698