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

Side by Side Diff: webkit/plugins/ppapi/ppb_graphics_2d_impl.h

Issue 10909244: PPAPI: Get TrackedCallback ready for running on non-main threads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged. Created 8 years, 1 month 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 | Annotate | Revision Log
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « webkit/plugins/ppapi/ppb_flash_menu_impl.cc ('k') | webkit/plugins/ppapi/ppb_tcp_server_socket_private_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698