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

Unified Diff: native_client_sdk/src/examples/demo/pi_generator/pi_generator.cc

Issue 14607005: [NaCl SDK] Cleanup examples. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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
Index: native_client_sdk/src/examples/demo/pi_generator/pi_generator.cc
diff --git a/native_client_sdk/src/examples/demo/pi_generator/pi_generator.cc b/native_client_sdk/src/examples/demo/pi_generator/pi_generator.cc
index bada6105c5cab2a52d5de67ddb3bcbb02fe39410..2c79f4d400f55463af86986dc51a9d86eb960dd9 100644
--- a/native_client_sdk/src/examples/demo/pi_generator/pi_generator.cc
+++ b/native_client_sdk/src/examples/demo/pi_generator/pi_generator.cc
@@ -27,13 +27,11 @@ const uint32_t kBlueShift = 0;
// This is called by the browser when the 2D context has been flushed to the
// browser window.
void FlushCallback(void* data, int32_t result) {
- static_cast<pi_generator::PiGenerator*>(data)->set_flush_pending(false);
+ static_cast<PiGenerator*>(data)->set_flush_pending(false);
}
} // namespace
-namespace pi_generator {
-
// A small helper RAII class that implements a scoped pthread_mutex lock.
class ScopedMutexLock {
public:
@@ -248,4 +246,16 @@ void* PiGenerator::ComputePi(void* param) {
return 0;
}
-} // namespace pi_generator
+class PiGeneratorModule : public pp::Module {
+ public:
+ PiGeneratorModule() : pp::Module() {}
+ virtual ~PiGeneratorModule() {}
+
+ virtual pp::Instance* CreateInstance(PP_Instance instance) {
+ return new PiGenerator(instance);
+ }
+};
+
+namespace pp {
+Module* CreateModule() { return new PiGeneratorModule(); }
+} // namespace pp

Powered by Google App Engine
This is Rietveld 408576698