OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * Copyright (C) 2012 Ericsson AB. All rights reserved. | 3 * Copyright (C) 2012 Ericsson AB. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 } | 353 } |
354 | 354 |
355 // Convert a string to a V8 string. | 355 // Convert a string to a V8 string. |
356 // Return a V8 external string that shares the underlying buffer with the given | 356 // Return a V8 external string that shares the underlying buffer with the given |
357 // WebCore string. The reference counting mechanism is used to keep the | 357 // WebCore string. The reference counting mechanism is used to keep the |
358 // underlying buffer alive while the string is still live in the V8 engine. | 358 // underlying buffer alive while the string is still live in the V8 engine. |
359 inline v8::Handle<v8::String> v8String(v8::Isolate* isolate, const String& strin
g) | 359 inline v8::Handle<v8::String> v8String(v8::Isolate* isolate, const String& strin
g) |
360 { | 360 { |
361 if (string.isNull()) | 361 if (string.isNull()) |
362 return v8::String::Empty(isolate); | 362 return v8::String::Empty(isolate); |
363 return V8PerIsolateData::from(isolate)->stringCache()->v8ExternalString(stri
ng.impl(), isolate); | 363 return V8PerIsolateData::from(isolate)->stringCache()->v8ExternalString(isol
ate, string.impl()); |
364 } | 364 } |
365 | 365 |
366 inline v8::Handle<v8::String> v8AtomicString(v8::Isolate* isolate, const char* s
tr, int length = -1) | 366 inline v8::Handle<v8::String> v8AtomicString(v8::Isolate* isolate, const char* s
tr, int length = -1) |
367 { | 367 { |
368 ASSERT(isolate); | 368 ASSERT(isolate); |
369 v8::Local<v8::String> value; | 369 v8::Local<v8::String> value; |
370 if (LIKELY(v8::String::NewFromUtf8(isolate, str, v8::NewStringType::kInterna
lized, length).ToLocal(&value))) | 370 if (LIKELY(v8::String::NewFromUtf8(isolate, str, v8::NewStringType::kInterna
lized, length).ToLocal(&value))) |
371 return value; | 371 return value; |
372 // Immediately crashes when NewFromUtf8() fails because it only fails the | 372 // Immediately crashes when NewFromUtf8() fails because it only fails the |
373 // given str is too long. | 373 // given str is too long. |
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
999 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(v8::Isol
ate*, ExecutionContext*, v8::Handle<v8::Function>); | 999 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(v8::Isol
ate*, ExecutionContext*, v8::Handle<v8::Function>); |
1000 | 1000 |
1001 // Callback functions used by generated code. | 1001 // Callback functions used by generated code. |
1002 CORE_EXPORT void v8ConstructorAttributeGetter(v8::Local<v8::Name> propertyName,
const v8::PropertyCallbackInfo<v8::Value>&); | 1002 CORE_EXPORT void v8ConstructorAttributeGetter(v8::Local<v8::Name> propertyName,
const v8::PropertyCallbackInfo<v8::Value>&); |
1003 | 1003 |
1004 typedef void (*InstallTemplateFunction)(v8::Local<v8::FunctionTemplate>, v8::Iso
late*); | 1004 typedef void (*InstallTemplateFunction)(v8::Local<v8::FunctionTemplate>, v8::Iso
late*); |
1005 | 1005 |
1006 } // namespace blink | 1006 } // namespace blink |
1007 | 1007 |
1008 #endif // V8Binding_h | 1008 #endif // V8Binding_h |
OLD | NEW |