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

Unified Diff: mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.cc

Issue 728133002: Update mojo sdk to rev e01f9a49449381a5eb430c1fd88bf2cae73ec35a (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: android + ios gyp fixes Created 6 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
Index: mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.cc
diff --git a/mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.cc b/mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.cc
index 860beb57c3b8982f2b90e0151fe028722e731789..9421e180ed388d1ab0f0bcdbd4652c91d80d3d40 100644
--- a/mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.cc
+++ b/mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.cc
@@ -92,8 +92,16 @@ class RootObserver : public ViewObserver {
};
ViewManagerClientImpl::ViewManagerClientImpl(ViewManagerDelegate* delegate,
- Shell* shell)
- : connected_(false), connection_id_(0), next_id_(1), delegate_(delegate) {
+ Shell* shell,
+ ScopedMessagePipeHandle handle,
+ bool delete_on_error)
+ : connected_(false),
+ connection_id_(0),
+ next_id_(1),
+ delegate_(delegate),
+ binding_(this, handle.Pass()),
+ service_(binding_.client()),
+ delete_on_error_(delete_on_error) {
}
ViewManagerClientImpl::~ViewManagerClientImpl() {
@@ -199,8 +207,9 @@ void ViewManagerClientImpl::Embed(
Id view_id,
ServiceProviderPtr service_provider) {
DCHECK(connected_);
- service_->Embed(url, view_id, service_provider.Pass(),
- ActionCompletedCallback());
+ service_->Embed(url, view_id,
+ MakeRequest<ServiceProvider>(service_provider.PassMessagePipe()),
+ ActionCompletedCallback());
}
void ViewManagerClientImpl::AddView(View* view) {
@@ -231,13 +240,6 @@ View* ViewManagerClientImpl::GetViewById(Id id) {
}
////////////////////////////////////////////////////////////////////////////////
-// ViewManagerClientImpl, InterfaceImpl overrides:
-
-void ViewManagerClientImpl::OnConnectionEstablished() {
- service_ = client();
-}
-
-////////////////////////////////////////////////////////////////////////////////
// ViewManagerClientImpl, ViewManagerClient implementation:
void ViewManagerClientImpl::OnEmbed(
@@ -395,6 +397,13 @@ void ViewManagerClientImpl::OnActiveWindowChanged(Id old_focused_window,
Id new_focused_window) {}
////////////////////////////////////////////////////////////////////////////////
+// OnConnectionError, private:
+void ViewManagerClientImpl::OnConnectionError() {
+ if (delete_on_error_)
+ delete this;
+}
+
+////////////////////////////////////////////////////////////////////////////////
// ViewManagerClientImpl, private:
void ViewManagerClientImpl::RemoveRoot(View* root) {

Powered by Google App Engine
This is Rietveld 408576698