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

Unified Diff: components/view_manager/display_manager.cc

Issue 1229553002: Mandoline: ConnectToApplication and ConnectToService should fail gracefully (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 | « no previous file | mojo/application/public/cpp/application_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/view_manager/display_manager.cc
diff --git a/components/view_manager/display_manager.cc b/components/view_manager/display_manager.cc
index f82d549a38dd0c32b8171e7dd877ed2da85b0f2d..df6b60bc47c85859113c1862be77bff6b9fc14b6 100644
--- a/components/view_manager/display_manager.cc
+++ b/components/view_manager/display_manager.cc
@@ -119,6 +119,10 @@ void DefaultDisplayManager::Init(DisplayManagerDelegate* delegate) {
mojo::URLRequestPtr request(mojo::URLRequest::New());
request->url = mojo::String::From("mojo:surfaces_service");
app_impl_->ConnectToService(request.Pass(), &display_factory);
+ // TODO(fsamuel): We should indicate to the delegate that this object failed
+ // to initialize.
+ if (!display_factory)
+ return;
display_factory->Create(context_provider.Pass(),
nullptr, // returner - we never submit resources.
GetProxy(&display_));
@@ -167,9 +171,11 @@ void DefaultDisplayManager::Draw() {
frame->passes.push_back(pass.Pass());
frame->resources.resize(0u);
frame_pending_ = true;
- display_->SubmitFrame(
- frame.Pass(),
- base::Bind(&DefaultDisplayManager::DidDraw, base::Unretained(this)));
+ if (display_) {
+ display_->SubmitFrame(
+ frame.Pass(),
+ base::Bind(&DefaultDisplayManager::DidDraw, base::Unretained(this)));
+ }
dirty_rect_ = gfx::Rect();
}
« no previous file with comments | « no previous file | mojo/application/public/cpp/application_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698