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

Unified Diff: src/libplatform/default-platform.cc

Issue 358363002: Move platform abstraction to base library (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 6 years, 6 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: src/libplatform/default-platform.cc
diff --git a/src/libplatform/default-platform.cc b/src/libplatform/default-platform.cc
index 994a5173e339a787d82853def83c5af6c3731d5e..3cba2f6ca09d5b895cf470b870f7e4fadd05e3c1 100644
--- a/src/libplatform/default-platform.cc
+++ b/src/libplatform/default-platform.cc
@@ -7,10 +7,9 @@
#include <algorithm>
#include <queue>
-// TODO(jochen): We should have our own version of checks.h.
-#include "src/checks.h"
+#include "src/base/logging.h"
+#include "src/base/platform/platform.h"
#include "src/libplatform/worker-thread.h"
-#include "src/platform.h"
namespace v8 {
namespace internal {
@@ -24,7 +23,7 @@ DefaultPlatform::DefaultPlatform()
DefaultPlatform::~DefaultPlatform() {
- LockGuard<Mutex> guard(&lock_);
+ base::LockGuard<base::Mutex> guard(&lock_);
queue_.Terminate();
if (initialized_) {
for (std::vector<WorkerThread*>::iterator i = thread_pool_.begin();
@@ -36,17 +35,17 @@ DefaultPlatform::~DefaultPlatform() {
void DefaultPlatform::SetThreadPoolSize(int thread_pool_size) {
- LockGuard<Mutex> guard(&lock_);
+ base::LockGuard<base::Mutex> guard(&lock_);
ASSERT(thread_pool_size >= 0);
if (thread_pool_size < 1)
- thread_pool_size = OS::NumberOfProcessorsOnline();
+ thread_pool_size = base::OS::NumberOfProcessorsOnline();
thread_pool_size_ =
std::max(std::min(thread_pool_size, kMaxThreadPoolSize), 1);
}
void DefaultPlatform::EnsureInitialized() {
- LockGuard<Mutex> guard(&lock_);
+ base::LockGuard<base::Mutex> guard(&lock_);
if (initialized_) return;
initialized_ = true;

Powered by Google App Engine
This is Rietveld 408576698