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

Unified Diff: ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h

Issue 10696157: Add support for threadsafe completion callback factory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/cpp/websocket.h ('k') | ppapi/ppapi_proxy.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h
diff --git a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h
index 9b48e1f3637fd8fdd3155b607446373eed6cfc0c..448aace25a20931a75ad42ac5094b31da1a1bd65 100644
--- a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h
+++ b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h
@@ -39,26 +39,6 @@ class Plugin;
class PnaclCoordinator;
class PnaclTranslateThread;
-// A thread safe reference counting class Needed for CompletionCallbackFactory
-// in PnaclCoordinator.
-class PnaclRefCount {
- public:
- PnaclRefCount() : ref_(0) { NaClXMutexCtor(&mu_); }
- ~PnaclRefCount() { NaClMutexDtor(&mu_); }
- int32_t AddRef() {
- nacl::MutexLocker ml(&mu_);
- return ++ref_;
- }
- int32_t Release() {
- nacl::MutexLocker ml(&mu_);
- return --ref_;
- }
-
- private:
- int32_t ref_;
- struct NaClMutex mu_;
-};
-
// A class invoked by Plugin to handle PNaCl client-side translation.
// Usage:
// (1) Invoke the factory method, e.g.,
@@ -205,10 +185,9 @@ class PnaclCoordinator: public CallbackSource<FileStreamData> {
Plugin* plugin_;
pp::CompletionCallback translate_notify_callback_;
- // PnaclRefCount is only needed to support file lookups.
// TODO(sehr): remove this when file lookup is through ReverseService.
Derek Schuff 2012/07/10 20:31:54 this comment goes with the previous comment that w
brettw 2012/07/10 21:06:09 Done.
pp::CompletionCallbackFactory<PnaclCoordinator,
- PnaclRefCount> callback_factory_;
+ pp::ThreadSafeThreadTraits> callback_factory_;
// Nexe from the final native Link.
nacl::scoped_ptr<nacl::DescWrapper> translated_fd_;
« no previous file with comments | « ppapi/cpp/websocket.h ('k') | ppapi/ppapi_proxy.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698