OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_2D_IMPL_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_2D_IMPL_H_ |
6 #define WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_2D_IMPL_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_2D_IMPL_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 | 110 |
111 void Set(scoped_refptr< ::ppapi::TrackedCallback> callback) { | 111 void Set(scoped_refptr< ::ppapi::TrackedCallback> callback) { |
112 callback_ = callback; | 112 callback_ = callback; |
113 } | 113 } |
114 | 114 |
115 void Clear() { | 115 void Clear() { |
116 callback_ = NULL; | 116 callback_ = NULL; |
117 } | 117 } |
118 | 118 |
119 void Execute(int32_t result) { | 119 void Execute(int32_t result) { |
120 ::ppapi::TrackedCallback::ClearAndRun(&callback_, result); | 120 callback_->Run(result); |
121 } | 121 } |
122 | 122 |
123 void PostAbort() { | 123 void PostAbort() { |
124 if (!is_null()) { | 124 if (!is_null()) { |
125 callback_->PostAbort(); | 125 callback_->PostAbort(); |
126 Clear(); | 126 Clear(); |
127 } | 127 } |
128 } | 128 } |
129 | 129 |
130 private: | 130 private: |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 | 206 |
207 base::WeakPtrFactory<PPB_Graphics2D_Impl> weak_ptr_factory_; | 207 base::WeakPtrFactory<PPB_Graphics2D_Impl> weak_ptr_factory_; |
208 | 208 |
209 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics2D_Impl); | 209 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics2D_Impl); |
210 }; | 210 }; |
211 | 211 |
212 } // namespace ppapi | 212 } // namespace ppapi |
213 } // namespace webkit | 213 } // namespace webkit |
214 | 214 |
215 #endif // WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_2D_IMPL_H_ | 215 #endif // WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_2D_IMPL_H_ |
OLD | NEW |