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

Side by Side Diff: mojo/public/cpp/bindings/callback.h.pump

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
« no previous file with comments | « mojo/public/cpp/bindings/callback.h ('k') | mojo/public/cpp/bindings/lib/shared_ptr.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 $$ This is a pump file for generating file templates. Pump is a python 1 $$ This is a pump file for generating file templates. Pump is a python
2 $$ script that is part of the Google Test suite of utilities. Description 2 $$ script that is part of the Google Test suite of utilities. Description
3 $$ can be found here: 3 $$ can be found here:
4 $$ 4 $$
5 $$ http://code.google.com/p/googletest/wiki/PumpManual 5 $$ http://code.google.com/p/googletest/wiki/PumpManual
6 $$ 6 $$
7 7
8 $var MAX_ARITY = 7 8 $var MAX_ARITY = 7
9 9
10 // Copyright 2014 The Chromium Authors. All rights reserved. 10 // Copyright 2014 The Chromium Authors. All rights reserved.
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 sink_->Run($if ARITY > 1 [[ 56 sink_->Run($if ARITY > 1 [[
57 57
58 ]]$for ARG , 58 ]]$for ARG ,
59 [[internal::Forward(a$(ARG))]]); 59 [[internal::Forward(a$(ARG))]]);
60 } 60 }
61 61
62 bool is_null() const { 62 bool is_null() const {
63 return !sink_.get(); 63 return !sink_.get();
64 } 64 }
65 65
66 void reset() {
67 sink_.reset();
68 }
69
66 private: 70 private:
67 template <typename Sink> 71 template <typename Sink>
68 struct Adapter : public Runnable { 72 struct Adapter : public Runnable {
69 explicit Adapter(const Sink& sink) : sink(sink) {} 73 explicit Adapter(const Sink& sink) : sink(sink) {}
70 virtual void Run($if ARITY > 0 [[ 74 virtual void Run($if ARITY > 0 [[
71 75
72 ]]$for ARG , 76 ]]$for ARG ,
73 [[typename internal::Callback_ParamTraits<A$(ARG)>::ForwardType a$(ARG)] ]) const MOJO_OVERRIDE { 77 [[typename internal::Callback_ParamTraits<A$(ARG)>::ForwardType a$(ARG)] ]) const MOJO_OVERRIDE {
74 sink.Run($if ARITY > 1 [[ 78 sink.Run($if ARITY > 1 [[
75 79
76 ]]$for ARG , 80 ]]$for ARG ,
77 [[internal::Forward(a$(ARG))]]); 81 [[internal::Forward(a$(ARG))]]);
78 } 82 }
79 Sink sink; 83 Sink sink;
80 }; 84 };
81 85
82 internal::SharedPtr<Runnable> sink_; 86 internal::SharedPtr<Runnable> sink_;
83 }; 87 };
84 88
85 ]] $$ for ARITY 89 ]] $$ for ARITY
86 90
87 typedef Callback<void()> Closure; 91 typedef Callback<void()> Closure;
88 92
89 } // namespace mojo 93 } // namespace mojo
90 94
91 #endif // MOJO_PUBLIC_CPP_BINDINGS_CALLBACK_H_ 95 #endif // MOJO_PUBLIC_CPP_BINDINGS_CALLBACK_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/callback.h ('k') | mojo/public/cpp/bindings/lib/shared_ptr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698