Index: third_party/WebKit/Source/platform/bindings/V8Binding.h |
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8Binding.h b/third_party/WebKit/Source/platform/bindings/V8Binding.h |
similarity index 91% |
copy from third_party/WebKit/Source/bindings/core/v8/V8Binding.h |
copy to third_party/WebKit/Source/platform/bindings/V8Binding.h |
index fb39d29a6ed5e8b106ba0150a327069570d595e4..3b350a7ba0dce6f6466f2e6ae0c3739be3982ae2 100644 |
--- a/third_party/WebKit/Source/bindings/core/v8/V8Binding.h |
+++ b/third_party/WebKit/Source/platform/bindings/V8Binding.h |
@@ -32,15 +32,14 @@ |
#ifndef V8Binding_h |
#define V8Binding_h |
-#include "bindings/core/v8/DOMDataStore.h" |
-#include "bindings/core/v8/DOMWrapperWorld.h" |
-#include "bindings/core/v8/ScriptWrappable.h" |
-#include "bindings/core/v8/StringResource.h" |
-#include "bindings/core/v8/V8BindingMacros.h" |
-#include "bindings/core/v8/V8PerIsolateData.h" |
-#include "bindings/core/v8/V8ScriptRunner.h" |
-#include "bindings/core/v8/V8ValueCache.h" |
-#include "core/CoreExport.h" |
+#include "platform/PlatformExport.h" |
+#include "platform/bindings/DOMDataStore.h" |
+#include "platform/bindings/DOMWrapperWorld.h" |
+#include "platform/bindings/ScriptWrappable.h" |
+#include "platform/bindings/StringResource.h" |
+#include "platform/bindings/V8BindingMacros.h" |
+#include "platform/bindings/V8PerIsolateData.h" |
+#include "platform/bindings/V8ValueCache.h" |
#include "platform/heap/Handle.h" |
#include "platform/wtf/text/AtomicString.h" |
#include "platform/wtf/text/StringView.h" |
@@ -255,14 +254,16 @@ inline v8::Local<v8::String> V8String(v8::Isolate* isolate, |
DCHECK(isolate); |
if (string.IsNull()) |
return v8::String::Empty(isolate); |
- if (StringImpl* impl = string.SharedImpl()) |
+ if (StringImpl* impl = string.SharedImpl()) { |
return V8PerIsolateData::From(isolate)->GetStringCache()->V8ExternalString( |
isolate, impl); |
- if (string.Is8Bit()) |
+ } |
+ if (string.Is8Bit()) { |
return v8::String::NewFromOneByte( |
isolate, reinterpret_cast<const uint8_t*>(string.Characters8()), |
v8::NewStringType::kNormal, static_cast<int>(string.length())) |
.ToLocalChecked(); |
+ } |
return v8::String::NewFromTwoByte( |
isolate, reinterpret_cast<const uint16_t*>(string.Characters16()), |
v8::NewStringType::kNormal, static_cast<int>(string.length())) |
@@ -293,12 +294,13 @@ inline v8::Local<v8::Value> V8StringOrNull(v8::Isolate* isolate, |
inline v8::Local<v8::String> V8AtomicString(v8::Isolate* isolate, |
const StringView& string) { |
DCHECK(isolate); |
- if (string.Is8Bit()) |
+ if (string.Is8Bit()) { |
return v8::String::NewFromOneByte( |
isolate, reinterpret_cast<const uint8_t*>(string.Characters8()), |
v8::NewStringType::kInternalized, |
static_cast<int>(string.length())) |
.ToLocalChecked(); |
+ } |
return v8::String::NewFromTwoByte( |
isolate, reinterpret_cast<const uint16_t*>(string.Characters16()), |
v8::NewStringType::kInternalized, |
@@ -341,7 +343,8 @@ inline v8::MaybeLocal<v8::Value> V8DateOrNaN(v8::Isolate* isolate, |
inline bool IsUndefinedOrNull(v8::Local<v8::Value> value) { |
return value.IsEmpty() || value->IsNullOrUndefined(); |
} |
-v8::Local<v8::Function> GetBoundFunction(v8::Local<v8::Function>); |
+PLATFORM_EXPORT v8::Local<v8::Function> GetBoundFunction( |
+ v8::Local<v8::Function>); |
// FIXME: This will be soon embedded in the generated code. |
template <typename Collection> |
@@ -362,20 +365,20 @@ static void IndexedPropertyEnumerator( |
// These methods store hidden values into an array that is stored in the |
// internal field of a DOM wrapper. |
-bool AddHiddenValueToArray(v8::Isolate*, |
- v8::Local<v8::Object>, |
- v8::Local<v8::Value>, |
- int cache_index); |
-void RemoveHiddenValueFromArray(v8::Isolate*, |
- v8::Local<v8::Object>, |
- v8::Local<v8::Value>, |
- int cache_index); |
+PLATFORM_EXPORT bool AddHiddenValueToArray(v8::Isolate*, |
+ v8::Local<v8::Object>, |
+ v8::Local<v8::Value>, |
+ int cache_index); |
+PLATFORM_EXPORT void RemoveHiddenValueFromArray(v8::Isolate*, |
+ v8::Local<v8::Object>, |
+ v8::Local<v8::Value>, |
+ int cache_index); |
// Freeze a V8 object. The type of the first parameter and the return value is |
// intentionally v8::Value so that this function can wrap ToV8(). |
// If the argument isn't an object, this will crash. |
-CORE_EXPORT v8::Local<v8::Value> FreezeV8Object(v8::Local<v8::Value>, |
- v8::Isolate*); |
+PLATFORM_EXPORT v8::Local<v8::Value> FreezeV8Object(v8::Local<v8::Value>, |
+ v8::Isolate*); |
} // namespace blink |