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

Unified Diff: test/cctest/print-extension.cc

Issue 130213009: Various extension-related cleanup and simplifications. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Whitespace Created 6 years, 11 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 | « test/cctest/print-extension.h ('k') | test/cctest/profiler-extension.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/print-extension.cc
diff --git a/src/libplatform/worker-thread.cc b/test/cctest/print-extension.cc
similarity index 72%
copy from src/libplatform/worker-thread.cc
copy to test/cctest/print-extension.cc
index cca8a9719a88d953a9d05d770e5aa6478a563e6a..9f629195bd7909c1a97760484cea37b600461b98 100644
--- a/src/libplatform/worker-thread.cc
+++ b/test/cctest/print-extension.cc
@@ -1,4 +1,4 @@
-// Copyright 2013 the V8 project authors. All rights reserved.
+// Copyright 2014 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
@@ -25,32 +25,27 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include "worker-thread.h"
-
-// TODO(jochen): We should have our own version of checks.h.
-#include "../checks.h"
-#include "../../include/v8-platform.h"
-#include "task-queue.h"
+#include "print-extension.h"
namespace v8 {
namespace internal {
-WorkerThread::WorkerThread(TaskQueue* queue)
- : Thread("V8 WorkerThread"), queue_(queue) {
- Start();
-}
-
-
-WorkerThread::~WorkerThread() {
- Join();
+v8::Handle<v8::FunctionTemplate> PrintExtension::GetNativeFunctionTemplate(
+ v8::Isolate* isolate,
+ v8::Handle<v8::String> str) {
+ return v8::FunctionTemplate::New(isolate, PrintExtension::Print);
}
-void WorkerThread::Run() {
- while (Task* task = queue_->GetNext()) {
- task->Run();
- delete task;
+void PrintExtension::Print(const v8::FunctionCallbackInfo<v8::Value>& args) {
+ for (int i = 0; i < args.Length(); i++) {
+ if (i != 0) printf(" ");
+ v8::HandleScope scope(args.GetIsolate());
+ v8::String::Utf8Value str(args[i]);
+ if (*str == NULL) return;
+ printf("%s", *str);
}
+ printf("\n");
}
} } // namespace v8::internal
« no previous file with comments | « test/cctest/print-extension.h ('k') | test/cctest/profiler-extension.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698