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

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

Issue 54903014: [EnforceRange] doesn't enforce range of a short (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Extend layout test Created 7 years, 1 month 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
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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 uint8_t toUInt8(v8::Handle<v8::Value>, IntegerConversionConfiguration, bool& ok); 333 uint8_t toUInt8(v8::Handle<v8::Value>, IntegerConversionConfiguration, bool& ok);
334 inline uint8_t toUInt8(v8::Handle<v8::Value> value, bool& ok) { return toUIn t8(value, NormalConversion, ok); } 334 inline uint8_t toUInt8(v8::Handle<v8::Value> value, bool& ok) { return toUIn t8(value, NormalConversion, ok); }
335 335
336 // Convert a value to a 8-bit unsigned integer assuming the conversion canno t fail. 336 // Convert a value to a 8-bit unsigned integer assuming the conversion canno t fail.
337 inline uint8_t toUInt8(v8::Handle<v8::Value> value) 337 inline uint8_t toUInt8(v8::Handle<v8::Value> value)
338 { 338 {
339 bool ok; 339 bool ok;
340 return toUInt8(value, NormalConversion, ok); 340 return toUInt8(value, NormalConversion, ok);
341 } 341 }
342 342
343 // Convert a value to a 16-bit signed integer. The conversion fails if the
344 // value cannot be converted to a number or the range violated per WebIDL:
345 // http://www.w3.org/TR/WebIDL/#es-short
346 int16_t toInt16(v8::Handle<v8::Value>, IntegerConversionConfiguration, bool& ok);
347 inline int16_t toInt16(v8::Handle<v8::Value> value, bool& ok) { return toInt 16(value, NormalConversion, ok); }
348
349 // Convert a value to a 16-bit integer assuming the conversion cannot fail.
350 inline int16_t toInt16(v8::Handle<v8::Value> value)
351 {
352 bool ok;
353 return toInt16(value, NormalConversion, ok);
354 }
355
356 // Convert a value to a 16-bit unsigned integer. The conversion fails if the
357 // value cannot be converted to a number or the range violated per WebIDL:
358 // http://www.w3.org/TR/WebIDL/#es-unsigned-short
359 uint16_t toUInt16(v8::Handle<v8::Value>, IntegerConversionConfiguration, boo l& ok);
360 inline uint16_t toUInt16(v8::Handle<v8::Value> value, bool& ok) { return toU Int16(value, NormalConversion, ok); }
361
362 // Convert a value to a 16-bit unsigned integer assuming the conversion cann ot fail.
363 inline uint16_t toUInt16(v8::Handle<v8::Value> value)
364 {
365 bool ok;
366 return toUInt16(value, NormalConversion, ok);
367 }
368
343 // Convert a value to a 32-bit signed integer. The conversion fails if the 369 // Convert a value to a 32-bit signed integer. The conversion fails if the
344 // value cannot be converted to a number or the range violated per WebIDL: 370 // value cannot be converted to a number or the range violated per WebIDL:
345 // http://www.w3.org/TR/WebIDL/#es-long 371 // http://www.w3.org/TR/WebIDL/#es-long
346 int32_t toInt32(v8::Handle<v8::Value>, IntegerConversionConfiguration, bool& ok); 372 int32_t toInt32(v8::Handle<v8::Value>, IntegerConversionConfiguration, bool& ok);
347 inline int32_t toInt32(v8::Handle<v8::Value> value, bool& ok) { return toInt 32(value, NormalConversion, ok); } 373 inline int32_t toInt32(v8::Handle<v8::Value> value, bool& ok) { return toInt 32(value, NormalConversion, ok); }
348 374
349 // Convert a value to a 32-bit integer assuming the conversion cannot fail. 375 // Convert a value to a 32-bit integer assuming the conversion cannot fail.
350 inline int32_t toInt32(v8::Handle<v8::Value> value) 376 inline int32_t toInt32(v8::Handle<v8::Value> value)
351 { 377 {
352 bool ok; 378 bool ok;
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 713
688 v8::Isolate* mainThreadIsolate(); 714 v8::Isolate* mainThreadIsolate();
689 v8::Isolate* toIsolate(ExecutionContext*); 715 v8::Isolate* toIsolate(ExecutionContext*);
690 v8::Isolate* toIsolate(Frame*); 716 v8::Isolate* toIsolate(Frame*);
691 717
692 // Can only be called by WebKit::initialize 718 // Can only be called by WebKit::initialize
693 void setMainThreadIsolate(v8::Isolate*); 719 void setMainThreadIsolate(v8::Isolate*);
694 } // namespace WebCore 720 } // namespace WebCore
695 721
696 #endif // V8Binding_h 722 #endif // V8Binding_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698