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

Side by Side Diff: Source/bindings/core/v8/V8Binding.h

Issue 1032053003: bindings: Add assersion in v8AtomicString (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 return v8::String::Empty(isolate); 347 return v8::String::Empty(isolate);
348 return V8PerIsolateData::from(isolate)->stringCache()->v8ExternalString(stri ng.impl(), isolate); 348 return V8PerIsolateData::from(isolate)->stringCache()->v8ExternalString(stri ng.impl(), isolate);
349 } 349 }
350 350
351 inline v8::Handle<v8::String> v8AtomicString(v8::Isolate* isolate, const char* s tr, int length = -1) 351 inline v8::Handle<v8::String> v8AtomicString(v8::Isolate* isolate, const char* s tr, int length = -1)
352 { 352 {
353 ASSERT(isolate); 353 ASSERT(isolate);
354 v8::Local<v8::String> value; 354 v8::Local<v8::String> value;
355 if (LIKELY(v8::String::NewFromUtf8(isolate, str, v8::NewStringType::kInterna lized, length).ToLocal(&value))) 355 if (LIKELY(v8::String::NewFromUtf8(isolate, str, v8::NewStringType::kInterna lized, length).ToLocal(&value)))
356 return value; 356 return value;
357 // Immediately crashes when NewFromUtf8() fails because it only fails the
358 // given str is too long.
359 RELEASE_ASSERT_NOT_REACHED();
357 return v8::String::Empty(isolate); 360 return v8::String::Empty(isolate);
358 } 361 }
359 362
360 inline v8::Handle<v8::Value> v8Undefined() 363 inline v8::Handle<v8::Value> v8Undefined()
361 { 364 {
362 return v8::Handle<v8::Value>(); 365 return v8::Handle<v8::Value>();
363 } 366 }
364 367
365 // Conversion flags, used in toIntXX/toUIntXX. 368 // Conversion flags, used in toIntXX/toUIntXX.
366 enum IntegerConversionConfiguration { 369 enum IntegerConversionConfiguration {
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(v8::Isol ate*, ExecutionContext*, v8::Handle<v8::Function>); 972 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(v8::Isol ate*, ExecutionContext*, v8::Handle<v8::Function>);
970 973
971 // Callback functions used by generated code. 974 // Callback functions used by generated code.
972 CORE_EXPORT void v8ConstructorAttributeGetter(v8::Local<v8::Name> propertyName, const v8::PropertyCallbackInfo<v8::Value>&); 975 CORE_EXPORT void v8ConstructorAttributeGetter(v8::Local<v8::Name> propertyName, const v8::PropertyCallbackInfo<v8::Value>&);
973 976
974 typedef void (*InstallTemplateFunction)(v8::Local<v8::FunctionTemplate>, v8::Iso late*); 977 typedef void (*InstallTemplateFunction)(v8::Local<v8::FunctionTemplate>, v8::Iso late*);
975 978
976 } // namespace blink 979 } // namespace blink
977 980
978 #endif // V8Binding_h 981 #endif // V8Binding_h
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698