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

Side by Side Diff: components/mus/ws/server_window_surface_manager.cc

Issue 1906623003: Convert //components/mus from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « components/mus/ws/server_window_surface_manager.h ('k') | components/mus/ws/test_utils.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/mus/ws/server_window_surface_manager.h" 5 #include "components/mus/ws/server_window_surface_manager.h"
6 6
7 #include "components/mus/surfaces/surfaces_state.h" 7 #include "components/mus/surfaces/surfaces_state.h"
8 #include "components/mus/ws/server_window.h" 8 #include "components/mus/ws/server_window.h"
9 #include "components/mus/ws/server_window_delegate.h" 9 #include "components/mus/ws/server_window_delegate.h"
10 #include "components/mus/ws/server_window_surface.h" 10 #include "components/mus/ws/server_window_surface.h"
(...skipping 23 matching lines...) Expand all
34 waiting_for_initial_frames_ = 34 waiting_for_initial_frames_ =
35 !IsSurfaceReadyAndNonEmpty(mojom::SurfaceType::DEFAULT) || 35 !IsSurfaceReadyAndNonEmpty(mojom::SurfaceType::DEFAULT) ||
36 !IsSurfaceReadyAndNonEmpty(mojom::SurfaceType::UNDERLAY); 36 !IsSurfaceReadyAndNonEmpty(mojom::SurfaceType::UNDERLAY);
37 return !waiting_for_initial_frames_; 37 return !waiting_for_initial_frames_;
38 } 38 }
39 39
40 void ServerWindowSurfaceManager::CreateSurface( 40 void ServerWindowSurfaceManager::CreateSurface(
41 mojom::SurfaceType surface_type, 41 mojom::SurfaceType surface_type,
42 mojo::InterfaceRequest<mojom::Surface> request, 42 mojo::InterfaceRequest<mojom::Surface> request,
43 mojom::SurfaceClientPtr client) { 43 mojom::SurfaceClientPtr client) {
44 scoped_ptr<ServerWindowSurface> surface(new ServerWindowSurface( 44 std::unique_ptr<ServerWindowSurface> surface(new ServerWindowSurface(
45 this, surface_type, std::move(request), std::move(client))); 45 this, surface_type, std::move(request), std::move(client)));
46 if (!HasAnySurface()) { 46 if (!HasAnySurface()) {
47 // Only one SurfaceFactoryClient can be registered per surface id namespace, 47 // Only one SurfaceFactoryClient can be registered per surface id namespace,
48 // so register the first one. Since all surfaces created by this manager 48 // so register the first one. Since all surfaces created by this manager
49 // represent the same window, the begin frame source can be shared by 49 // represent the same window, the begin frame source can be shared by
50 // all surfaces created here. 50 // all surfaces created here.
51 surface->RegisterForBeginFrames(); 51 surface->RegisterForBeginFrames();
52 } 52 }
53 type_to_surface_map_[surface_type] = std::move(surface); 53 type_to_surface_map_[surface_type] = std::move(surface);
54 } 54 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 return last_submitted_frame_size.width() >= window_->bounds().width() && 92 return last_submitted_frame_size.width() >= window_->bounds().width() &&
93 last_submitted_frame_size.height() >= window_->bounds().height(); 93 last_submitted_frame_size.height() >= window_->bounds().height();
94 } 94 }
95 95
96 cc::SurfaceId ServerWindowSurfaceManager::GenerateId() { 96 cc::SurfaceId ServerWindowSurfaceManager::GenerateId() {
97 return surface_id_allocator_.GenerateId(); 97 return surface_id_allocator_.GenerateId();
98 } 98 }
99 99
100 } // namespace ws 100 } // namespace ws
101 } // namespace mus 101 } // namespace mus
OLDNEW
« no previous file with comments | « components/mus/ws/server_window_surface_manager.h ('k') | components/mus/ws/test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698