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

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

Issue 23526039: Replace several uses of toWebCoreString() by V8TRYCATCH_FOR_V8STRINGRESOURCE() macro (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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
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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 WrapperWorldType worldTypeInMainThread(v8::Isolate*); 384 WrapperWorldType worldTypeInMainThread(v8::Isolate*);
385 385
386 DOMWrapperWorld* isolatedWorldForIsolate(v8::Isolate*); 386 DOMWrapperWorld* isolatedWorldForIsolate(v8::Isolate*);
387 387
388 template<class T> struct NativeValueTraits; 388 template<class T> struct NativeValueTraits;
389 389
390 template<> 390 template<>
391 struct NativeValueTraits<String> { 391 struct NativeValueTraits<String> {
392 static inline String nativeValue(const v8::Handle<v8::Value>& value) 392 static inline String nativeValue(const v8::Handle<v8::Value>& value)
393 { 393 {
394 return toWebCoreString(value); 394 V8TRYCATCH_FOR_V8STRINGRESOURCE_RETURN(V8StringResource<>, stringVal ue, value, String());
haraken 2013/09/12 17:33:52 This change wouldn't be helpful until you fix all
do-not-use 2013/09/13 14:55:49 The reason I used V8TRYCATCH_FOR_V8STRINGRESOURCE_
395 return stringValue;
395 } 396 }
396 }; 397 };
397 398
398 template<> 399 template<>
399 struct NativeValueTraits<unsigned> { 400 struct NativeValueTraits<unsigned> {
400 static inline unsigned nativeValue(const v8::Handle<v8::Value>& value) 401 static inline unsigned nativeValue(const v8::Handle<v8::Value>& value)
401 { 402 {
402 return toUInt32(value); 403 return toUInt32(value);
403 } 404 }
404 }; 405 };
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 return v8::FunctionTemplate::New(function, environment)->GetFunction(); 634 return v8::FunctionTemplate::New(function, environment)->GetFunction();
634 } 635 }
635 636
636 v8::Local<v8::Value> getHiddenValueFromMainWorldWrapper(v8::Isolate*, Script Wrappable*, v8::Handle<v8::String> key); 637 v8::Local<v8::Value> getHiddenValueFromMainWorldWrapper(v8::Isolate*, Script Wrappable*, v8::Handle<v8::String> key);
637 638
638 v8::Isolate* getIsolateFromScriptExecutionContext(ScriptExecutionContext*); 639 v8::Isolate* getIsolateFromScriptExecutionContext(ScriptExecutionContext*);
639 640
640 } // namespace WebCore 641 } // namespace WebCore
641 642
642 #endif // V8Binding_h 643 #endif // V8Binding_h
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/v8/custom/V8DocumentCustom.cpp » ('j') | Source/bindings/v8/custom/V8HTMLAllCollectionCustom.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698