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

Unified Diff: sky/viewer/internals.cc

Issue 858103002: Remove [Client=] annotation from ServiceProvider (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: rebase for trybots (no code changes from ps2) Created 5 years, 11 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
« no previous file with comments | « sky/viewer/document_view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/viewer/internals.cc
diff --git a/sky/viewer/internals.cc b/sky/viewer/internals.cc
index 5edf79affc691598f4274f8550c0ada50d0d28a1..952fdc9439c9a7b11e72e4db213b5352950ebf43 100644
--- a/sky/viewer/internals.cc
+++ b/sky/viewer/internals.cc
@@ -39,7 +39,8 @@ gin::Handle<Internals> Internals::Create(
Internals::Internals(DocumentView* document_view)
: document_view_(document_view->GetWeakPtr()),
shell_binding_(this) {
- mojo::ConnectToService(document_view->imported_services(), &test_harness_);
+ if (document_view_->imported_services())
+ mojo::ConnectToService(document_view_->imported_services(), &test_harness_);
}
Internals::~Internals() {
@@ -74,13 +75,15 @@ std::string Internals::ContentAsText() {
void Internals::NotifyTestComplete(const std::string& test_result) {
std::vector<unsigned char> pixels;
document_view_->GetPixelsForTesting(&pixels);
- test_harness_->OnTestComplete(test_result,
- mojo::Array<uint8_t>::From(pixels));
+ if (test_harness_) {
+ test_harness_->OnTestComplete(test_result,
+ mojo::Array<uint8_t>::From(pixels));
+ }
}
mojo::Handle Internals::ConnectToEmbedderService(
const std::string& interface_name) {
- if (!document_view_)
+ if (!document_view_ || !document_view_->imported_services())
return mojo::Handle();
mojo::MessagePipe pipe;
« no previous file with comments | « sky/viewer/document_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698