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

Unified Diff: ui/views/mus/surface_binding.cc

Issue 2040453002: views/mus: Create the BitmapUploader only when needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 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
Index: ui/views/mus/surface_binding.cc
diff --git a/ui/views/mus/surface_binding.cc b/ui/views/mus/surface_binding.cc
index 415e115535cdc3714697f28e58b12dcb913465bb..affe53d4d4c3d656cc8c3caf6365e1d73c9d571c 100644
--- a/ui/views/mus/surface_binding.cc
+++ b/ui/views/mus/surface_binding.cc
@@ -79,6 +79,9 @@ base::LazyInstance<base::ThreadLocalPointer<
SurfaceBinding::PerClientState* SurfaceBinding::PerClientState::Get(
shell::Connector* connector,
mus::WindowTreeClient* client) {
+ // |connector| can be null in some unit-tests.
+ if (!connector)
+ return nullptr;
ClientToStateMap* window_map = window_states.Pointer()->Get();
if (!window_map) {
window_map = new ClientToStateMap;
@@ -146,7 +149,7 @@ SurfaceBinding::SurfaceBinding(shell::Connector* connector,
SurfaceBinding::~SurfaceBinding() {}
std::unique_ptr<cc::OutputSurface> SurfaceBinding::CreateOutputSurface() {
- return state_->CreateOutputSurface(window_, surface_type_);
+ return state_ ? state_->CreateOutputSurface(window_, surface_type_) : nullptr;
}
} // namespace views

Powered by Google App Engine
This is Rietveld 408576698