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

Unified Diff: sky/viewer/document_view.cc

Issue 741453002: Make sure that Content Handled application can be connected multiple times. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: 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
« sky/viewer/content_handler_impl.cc ('K') | « sky/viewer/document_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/viewer/document_view.cc
diff --git a/sky/viewer/document_view.cc b/sky/viewer/document_view.cc
index 0bfbeca61cc1ae882737332713e88baaba237217..a90d43b18105eca39dba8091beebc8de39931309 100644
--- a/sky/viewer/document_view.cc
+++ b/sky/viewer/document_view.cc
@@ -65,18 +65,22 @@ mojo::Target WebNavigationPolicyToNavigationTarget(
} // namespace
DocumentView::DocumentView(
+ const base::Closure& destruction_callback,
+ mojo::ServiceProviderPtr provider,
mojo::URLResponsePtr response,
- mojo::ShellPtr shell,
+ mojo::Shell* shell,
scoped_refptr<base::MessageLoopProxy> compositor_thread)
- : response_(response.Pass()),
- shell_(shell.Pass()),
+ : destruction_callback_(destruction_callback),
+ response_(response.Pass()),
+ shell_(shell),
web_view_(NULL),
root_(NULL),
- view_manager_client_factory_(shell_.get(), this),
+ view_manager_client_factory_(shell_, this),
inspector_service_factory_(this),
compositor_thread_(compositor_thread),
weak_factory_(this) {
- shell_.set_client(this);
+ exported_services_.AddService(&view_manager_client_factory_);
+ mojo::WeakBindToPipe(&exported_services_, provider.PassMessagePipe());
}
DocumentView::~DocumentView() {
@@ -84,21 +88,13 @@ DocumentView::~DocumentView() {
web_view_->close();
if (root_)
root_->RemoveObserver(this);
+ destruction_callback_.Run();
}
base::WeakPtr<DocumentView> DocumentView::GetWeakPtr() {
return weak_factory_.GetWeakPtr();
}
-void DocumentView::AcceptConnection(const mojo::String& requestor_url,
- mojo::ServiceProviderPtr provider) {
- exported_services_.AddService(&view_manager_client_factory_);
- mojo::WeakBindToPipe(&exported_services_, provider.PassMessagePipe());
-}
-
-void DocumentView::Initialize(mojo::Array<mojo::String> args) {
-}
-
void DocumentView::OnEmbed(
mojo::ViewManager* view_manager,
mojo::View* root,
« sky/viewer/content_handler_impl.cc ('K') | « sky/viewer/document_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698