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

Side by Side Diff: components/mus/public/cpp/lib/in_flight_change.h

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
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 #ifndef COMPONENTS_MUS_PUBLIC_CPP_LIB_IN_FLIGHT_CHANGE_H_ 5 #ifndef COMPONENTS_MUS_PUBLIC_CPP_LIB_IN_FLIGHT_CHANGE_H_
6 #define COMPONENTS_MUS_PUBLIC_CPP_LIB_IN_FLIGHT_CHANGE_H_ 6 #define COMPONENTS_MUS_PUBLIC_CPP_LIB_IN_FLIGHT_CHANGE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory>
10 #include <string> 11 #include <string>
11 #include <vector> 12 #include <vector>
12 13
13 #include "base/macros.h" 14 #include "base/macros.h"
14 #include "base/memory/scoped_ptr.h" 15 #include "base/memory/ptr_util.h"
15 #include "components/mus/public/cpp/window_observer.h" 16 #include "components/mus/public/cpp/window_observer.h"
16 #include "mojo/public/cpp/bindings/array.h" 17 #include "mojo/public/cpp/bindings/array.h"
17 #include "ui/gfx/geometry/rect.h" 18 #include "ui/gfx/geometry/rect.h"
18 19
19 namespace mus { 20 namespace mus {
20 21
21 namespace mojom { 22 namespace mojom {
22 enum class Cursor : int32_t; 23 enum class Cursor : int32_t;
23 } 24 }
24 25
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 // 70 //
70 // In general there are two classes of changes: 71 // In general there are two classes of changes:
71 // 1. We are the only side allowed to make the change. 72 // 1. We are the only side allowed to make the change.
72 // 2. The change can also be applied by another client. For example, the 73 // 2. The change can also be applied by another client. For example, the
73 // window manager may change the bounds as well as the local client. 74 // window manager may change the bounds as well as the local client.
74 // 75 //
75 // For (1) use CrashInFlightChange. As the name implies this change CHECKs that 76 // For (1) use CrashInFlightChange. As the name implies this change CHECKs that
76 // the change succeeded. Use the following pattern for this. This code goes 77 // the change succeeded. Use the following pattern for this. This code goes
77 // where the change is sent to the server (in WindowTreeClientImpl): 78 // where the change is sent to the server (in WindowTreeClientImpl):
78 // const uint32_t change_id = 79 // const uint32_t change_id =
79 // ScheduleInFlightChange(make_scoped_ptr(new CrashInFlightChange( 80 // ScheduleInFlightChange(base::WrapUnique(new CrashInFlightChange(
80 // window, ChangeType::REORDER))); 81 // window, ChangeType::REORDER)));
81 // 82 //
82 // For (2) use the same pattern as (1), but in the on change callback from the 83 // For (2) use the same pattern as (1), but in the on change callback from the
83 // server (e.g. OnWindowBoundsChanged()) add the following: 84 // server (e.g. OnWindowBoundsChanged()) add the following:
84 // // value_from_server is the value supplied from the server. It corresponds 85 // // value_from_server is the value supplied from the server. It corresponds
85 // // to the value of the property at the time the server processed the 86 // // to the value of the property at the time the server processed the
86 // // change. If the local change fails, this is the value reverted to. 87 // // change. If the local change fails, this is the value reverted to.
87 // InFlightBoundsChange new_change(window, value_from_server); 88 // InFlightBoundsChange new_change(window, value_from_server);
88 // if (ApplyServerChangeToExistingInFlightChange(new_change)) { 89 // if (ApplyServerChangeToExistingInFlightChange(new_change)) {
89 // // There was an in flight change for the same property. The in flight 90 // // There was an in flight change for the same property. The in flight
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 void SetRevertValueFrom(const InFlightChange& change) override; 291 void SetRevertValueFrom(const InFlightChange& change) override;
291 void Revert() override; 292 void Revert() override;
292 293
293 private: 294 private:
294 DISALLOW_COPY_AND_ASSIGN(InFlightSetModalChange); 295 DISALLOW_COPY_AND_ASSIGN(InFlightSetModalChange);
295 }; 296 };
296 297
297 } // namespace mus 298 } // namespace mus
298 299
299 #endif // COMPONENTS_MUS_PUBLIC_CPP_LIB_IN_FLIGHT_CHANGE_H_ 300 #endif // COMPONENTS_MUS_PUBLIC_CPP_LIB_IN_FLIGHT_CHANGE_H_
OLDNEW
« no previous file with comments | « components/mus/public/cpp/input_event_handler.h ('k') | components/mus/public/cpp/lib/output_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698