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

Side by Side Diff: services/ui/ws/window_server.cc

Issue 2498073003: Fix GPU service and display initialization race. (Closed)
Patch Set: Make function abstract. Created 4 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 unified diff | Download patch
« no previous file with comments | « services/ui/ws/test_utils.cc ('k') | services/ui/ws/window_server_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "services/ui/ws/window_server.h" 5 #include "services/ui/ws/window_server.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 IsOperationSource(pair.first)); 743 IsOperationSource(pair.first));
744 } 744 }
745 } 745 }
746 746
747 void WindowServer::OnGpuChannelEstablished( 747 void WindowServer::OnGpuChannelEstablished(
748 scoped_refptr<gpu::GpuChannelHost> gpu_channel) { 748 scoped_refptr<gpu::GpuChannelHost> gpu_channel) {
749 gpu_channel_ = std::move(gpu_channel); 749 gpu_channel_ = std::move(gpu_channel);
750 const std::set<Display*>& displays = display_manager()->displays(); 750 const std::set<Display*>& displays = display_manager()->displays();
751 for (auto* display : displays) 751 for (auto* display : displays)
752 display->platform_display()->OnGpuChannelEstablished(gpu_channel_); 752 display->platform_display()->OnGpuChannelEstablished(gpu_channel_);
753 // TODO(kylechar): When gpu channel is removed, this can instead happen
754 // earlier, after GpuServiceProxy::OnInitialized().
755 delegate_->StartDisplayInit();
753 } 756 }
754 757
755 void WindowServer::OnSurfaceCreated(const cc::SurfaceId& surface_id, 758 void WindowServer::OnSurfaceCreated(const cc::SurfaceId& surface_id,
756 const gfx::Size& frame_size, 759 const gfx::Size& frame_size,
757 float device_scale_factor) { 760 float device_scale_factor) {
758 WindowId window_id( 761 WindowId window_id(
759 WindowIdFromTransportId(surface_id.frame_sink_id().client_id())); 762 WindowIdFromTransportId(surface_id.frame_sink_id().client_id()));
760 mojom::CompositorFrameSinkType compositor_frame_sink_type( 763 mojom::CompositorFrameSinkType compositor_frame_sink_type(
761 static_cast<mojom::CompositorFrameSinkType>( 764 static_cast<mojom::CompositorFrameSinkType>(
762 surface_id.frame_sink_id().sink_id())); 765 surface_id.frame_sink_id().sink_id()));
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
796 void WindowServer::OnUserIdAdded(const UserId& id) { 799 void WindowServer::OnUserIdAdded(const UserId& id) {
797 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); 800 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr);
798 } 801 }
799 802
800 void WindowServer::OnUserIdRemoved(const UserId& id) { 803 void WindowServer::OnUserIdRemoved(const UserId& id) {
801 activity_monitor_map_.erase(id); 804 activity_monitor_map_.erase(id);
802 } 805 }
803 806
804 } // namespace ws 807 } // namespace ws
805 } // namespace ui 808 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/test_utils.cc ('k') | services/ui/ws/window_server_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698