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

Side by Side Diff: ppapi/cpp/completion_callback.h

Issue 8821010: WebSocket Pepper API: C++ bindings implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix nits and rebase Created 9 years 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
« no previous file with comments | « ppapi/c/dev/ppb_websocket_dev.h ('k') | ppapi/cpp/dev/websocket_dev.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 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 PPAPI_CPP_COMPLETION_CALLBACK_H_ 5 #ifndef PPAPI_CPP_COMPLETION_CALLBACK_H_
6 #define PPAPI_CPP_COMPLETION_CALLBACK_H_ 6 #define PPAPI_CPP_COMPLETION_CALLBACK_H_
7 7
8 #include "ppapi/c/pp_completion_callback.h" 8 #include "ppapi/c/pp_completion_callback.h"
9 #include "ppapi/c/pp_errors.h" 9 #include "ppapi/c/pp_errors.h"
10 #include "ppapi/cpp/logging.h" 10 #include "ppapi/cpp/logging.h"
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 /// creates/destroys the factory. With this restriction, it is safe to create 172 /// creates/destroys the factory. With this restriction, it is safe to create
173 /// the <code>CompletionCallbackFactory</code> on the main thread, create 173 /// the <code>CompletionCallbackFactory</code> on the main thread, create
174 /// callbacks from any thread and pass them to CallOnMainThread(). 174 /// callbacks from any thread and pass them to CallOnMainThread().
175 /// 175 ///
176 /// <strong>Example: </strong> 176 /// <strong>Example: </strong>
177 /// 177 ///
178 /// @code 178 /// @code
179 /// 179 ///
180 /// class MyHandler { 180 /// class MyHandler {
181 /// public: 181 /// public:
182 /// // If an compiler warns on following using |this| in the initializer
183 /// // list, use PP_ALLOW_THIS_IN_INITIALIZER_LIST macro.
182 /// MyHandler() : factory_(this), offset_(0) { 184 /// MyHandler() : factory_(this), offset_(0) {
183 /// } 185 /// }
184 /// 186 ///
185 /// void ProcessFile(const FileRef& file) { 187 /// void ProcessFile(const FileRef& file) {
186 /// CompletionCallback cc = factory_.NewRequiredCallback( 188 /// CompletionCallback cc = factory_.NewRequiredCallback(
187 /// &MyHandler::DidOpen); 189 /// &MyHandler::DidOpen);
188 /// int32_t rv = fio_.Open(file, PP_FileOpenFlag_Read, cc); 190 /// int32_t rv = fio_.Open(file, PP_FileOpenFlag_Read, cc);
189 /// CHECK(rv == PP_OK_COMPLETIONPENDING); 191 /// CHECK(rv == PP_OK_COMPLETIONPENDING);
190 /// } 192 /// }
191 /// 193 ///
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 CompletionCallbackFactory(const CompletionCallbackFactory&); 701 CompletionCallbackFactory(const CompletionCallbackFactory&);
700 CompletionCallbackFactory& operator=(const CompletionCallbackFactory&); 702 CompletionCallbackFactory& operator=(const CompletionCallbackFactory&);
701 703
702 T* object_; 704 T* object_;
703 BackPointer* back_pointer_; 705 BackPointer* back_pointer_;
704 }; 706 };
705 707
706 } // namespace pp 708 } // namespace pp
707 709
708 #endif // PPAPI_CPP_COMPLETION_CALLBACK_H_ 710 #endif // PPAPI_CPP_COMPLETION_CALLBACK_H_
OLDNEW
« no previous file with comments | « ppapi/c/dev/ppb_websocket_dev.h ('k') | ppapi/cpp/dev/websocket_dev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698