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

Side by Side Diff: mojo/public/cpp/bindings/lib/shared_ptr.h

Issue 617513003: Makes NativeViewport send OnBoundsChanged() after widget available (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 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 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_SHARED_PTR_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_SHARED_PTR_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_SHARED_PTR_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_SHARED_PTR_H_
7 7
8 #include "mojo/public/cpp/bindings/lib/shared_data.h" 8 #include "mojo/public/cpp/bindings/lib/shared_data.h"
9 9
10 namespace mojo { 10 namespace mojo {
(...skipping 13 matching lines...) Expand all
24 24
25 // Default copy-constructor and assignment operator are OK. 25 // Default copy-constructor and assignment operator are OK.
26 26
27 P* get() { 27 P* get() {
28 return impl_.value().ptr; 28 return impl_.value().ptr;
29 } 29 }
30 const P* get() const { 30 const P* get() const {
31 return impl_.value().ptr; 31 return impl_.value().ptr;
32 } 32 }
33 33
34 void reset() {
35 impl_.reset();
36 }
37
34 P* operator->() { return get(); } 38 P* operator->() { return get(); }
35 const P* operator->() const { return get(); } 39 const P* operator->() const { return get(); }
36 40
37 private: 41 private:
38 class Impl { 42 class Impl {
39 public: 43 public:
40 ~Impl() { 44 ~Impl() {
41 if (ptr) 45 if (ptr)
42 delete ptr; 46 delete ptr;
43 } 47 }
(...skipping 10 matching lines...) Expand all
54 MOJO_DISALLOW_COPY_AND_ASSIGN(Impl); 58 MOJO_DISALLOW_COPY_AND_ASSIGN(Impl);
55 }; 59 };
56 60
57 SharedData<Impl> impl_; 61 SharedData<Impl> impl_;
58 }; 62 };
59 63
60 } // namespace mojo 64 } // namespace mojo
61 } // namespace internal 65 } // namespace internal
62 66
63 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_SHARED_PTR_H_ 67 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_SHARED_PTR_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/callback.h.pump ('k') | mojo/services/native_viewport/native_viewport_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698