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

Unified Diff: mojo/services/html_viewer/html_document_view.cc

Issue 776553003: Fix html viewer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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/html_viewer/html_document_view.cc
diff --git a/mojo/services/html_viewer/html_document_view.cc b/mojo/services/html_viewer/html_document_view.cc
index 80b7bcd6272e90ca5ce46462f371bdb7bdb22b22..7d5c88c90d7322d7100912503f55bcd7e9e97a9f 100644
--- a/mojo/services/html_viewer/html_document_view.cc
+++ b/mojo/services/html_viewer/html_document_view.cc
@@ -86,18 +86,23 @@ bool CanNavigateLocally(blink::WebFrame* frame,
} // namespace
HTMLDocumentView::HTMLDocumentView(
+ const base::Closure& destruction_callback,
+ mojo::ServiceProviderPtr provider,
URLResponsePtr response,
- ShellPtr shell,
+ Shell* shell,
scoped_refptr<base::MessageLoopProxy> compositor_thread,
WebMediaPlayerFactory* web_media_player_factory)
- : response_(response.Pass()),
- shell_(shell.Pass()),
+ : destruction_callback_(destruction_callback),
+ response_(response.Pass()),
+ shell_(shell),
Aaron Boodman 2014/12/03 16:42:11 This raw ptr is another way we can crash if the ap
qsr 2014/12/03 16:56:53 This raw ptr is owned by the application, and the
Aaron Boodman 2014/12/03 17:32:37 Right.
web_view_(NULL),
root_(NULL),
- view_manager_client_factory_(shell_.get(), this),
+ view_manager_client_factory_(shell_, this),
compositor_thread_(compositor_thread),
web_media_player_factory_(web_media_player_factory) {
- shell_.set_client(this);
+ exported_services_.AddService(this);
+ exported_services_.AddService(&view_manager_client_factory_);
+ WeakBindToPipe(&exported_services_, provider.PassMessagePipe());
Aaron Boodman 2014/12/03 16:42:11 What deletes this class?
qsr 2014/12/03 16:56:53 Which class? exported_services_ is a member of thi
Aaron Boodman 2014/12/03 17:32:37 I meant HTMLDocumentView. I don't think OnViewDes
qsr 2014/12/04 10:11:17 Hum, what would be the right signal? This is not t
}
HTMLDocumentView::~HTMLDocumentView() {
@@ -107,17 +112,7 @@ HTMLDocumentView::~HTMLDocumentView() {
web_view_->close();
if (root_)
root_->RemoveObserver(this);
-}
-
-void HTMLDocumentView::AcceptConnection(const String& requestor_url,
- ServiceProviderPtr provider) {
- exported_services_.AddService(this);
- exported_services_.AddService(&view_manager_client_factory_);
- WeakBindToPipe(&exported_services_, provider.PassMessagePipe());
- Load(response_.Pass());
-}
-
-void HTMLDocumentView::Initialize(Array<String> args) {
+ destruction_callback_.Run();
}
void HTMLDocumentView::OnEmbed(
@@ -129,6 +124,8 @@ void HTMLDocumentView::OnEmbed(
embedder_service_provider_ = embedder_service_provider.Pass();
navigator_host_.set_service_provider(embedder_service_provider_.get());
+ Load(response_.Pass());
+
blink::WebSize root_size(root_->bounds().width, root_->bounds().height);
web_view_->resize(root_size);
web_layer_tree_view_impl_->setViewportSize(root_size);
@@ -196,8 +193,8 @@ blink::WebMediaPlayer* HTMLDocumentView::createMediaPlayer(
blink::WebLocalFrame* frame,
const blink::WebURL& url,
blink::WebMediaPlayerClient* client) {
- return web_media_player_factory_->CreateMediaPlayer(
- frame, url, client, shell_.get());
+ return web_media_player_factory_->CreateMediaPlayer(frame, url, client,
+ shell_);
}
blink::WebMediaPlayer* HTMLDocumentView::createMediaPlayer(

Powered by Google App Engine
This is Rietveld 408576698