[inspector] replaced inspector/Atomics.h with base atomicops.h

BUG=chromium:635948
R=dgozman@chromium.org,alph@chromium.org

Review-Url: https://codereview.chromium.org/2340763003
Cr-Commit-Position: refs/heads/master@{#39453}
This commit is contained in:
kozyatinskiy 2016-09-15 11:29:51 -07:00 committed by Commit bot
parent 94492437d9
commit 3195ab9ba5
5 changed files with 5 additions and 40 deletions

View File

@ -1,35 +0,0 @@
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_INSPECTOR_ATOMICS_H_
#define V8_INSPECTOR_ATOMICS_H_
#include <stdint.h>
#if defined(_MSC_VER)
#include <windows.h>
#endif
namespace v8_inspector {
#if defined(_MSC_VER)
inline int atomicIncrement(int volatile* addend) {
return InterlockedIncrement(reinterpret_cast<long volatile*>(addend));
}
#else
inline int atomicAdd(int volatile* addend, int increment) {
return __sync_add_and_fetch(addend, increment);
}
inline int atomicIncrement(int volatile* addend) {
return atomicAdd(addend, 1);
}
#endif
} // namespace v8_inspector
#endif // V8_INSPECTOR_ATOMICS_H_

View File

@ -135,7 +135,6 @@ v8_source_set("inspector") {
sources += get_target_outputs(":inspector_debugger_script")
sources += [
"Allocator.h",
"Atomics.h",
"InjectedScript.cpp",
"InjectedScript.h",
"InjectedScriptNative.cpp",

View File

@ -1,7 +1,8 @@
include_rules = [
"-src",
"+src/inspector",
"+src/base/atomicops.h",
"+src/base/macros.h",
"+src/base/logging.h",
"+src/base/platform/platform.h"
"+src/base/platform/platform.h",
]

View File

@ -4,7 +4,7 @@
#include "src/inspector/V8ProfilerAgentImpl.h"
#include "src/inspector/Atomics.h"
#include "src/base/atomicops.h"
#include "src/inspector/StringUtil.h"
#include "src/inspector/V8Debugger.h"
#include "src/inspector/V8InspectorImpl.h"
@ -279,7 +279,8 @@ void V8ProfilerAgentImpl::stop(
}
String16 V8ProfilerAgentImpl::nextProfileId() {
return String16::fromInteger(atomicIncrement(&s_lastProfileId));
return String16::fromInteger(
v8::base::NoBarrier_AtomicIncrement(&s_lastProfileId, 1));
}
void V8ProfilerAgentImpl::startProfiling(const String16& title) {

View File

@ -37,7 +37,6 @@
'../../include/v8-inspector.h',
'../../include/v8-inspector-protocol.h',
'inspector/Allocator.h',
'inspector/Atomics.h',
'inspector/InjectedScript.cpp',
'inspector/InjectedScript.h',
'inspector/InjectedScriptNative.cpp',