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

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

Issue 98853012: Revert of Remove uses of deprecated toWebCoreStringWithUndefinedOrNullCheck(v8::Handle<v8::Value>) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years 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
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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 197
198 // FIXME: See the above comment. 198 // FIXME: See the above comment.
199 inline String toWebCoreStringWithNullCheck(v8::Handle<v8::Value> value) 199 inline String toWebCoreStringWithNullCheck(v8::Handle<v8::Value> value)
200 { 200 {
201 V8StringResource<WithNullCheck> stringResource(value); 201 V8StringResource<WithNullCheck> stringResource(value);
202 if (!stringResource.prepare()) 202 if (!stringResource.prepare())
203 return String(); 203 return String();
204 return stringResource; 204 return stringResource;
205 } 205 }
206 206
207 // FIXME: See the above comment.
208 inline String toWebCoreStringWithUndefinedOrNullCheck(v8::Handle<v8::Value> value)
209 {
210 V8StringResource<WithUndefinedOrNullCheck> stringResource(value);
211 if (!stringResource.prepare())
212 return String();
213 return stringResource;
214 }
215
207 // Convert a string to a V8 string. 216 // Convert a string to a V8 string.
208 // Return a V8 external string that shares the underlying buffer with the gi ven 217 // Return a V8 external string that shares the underlying buffer with the gi ven
209 // WebCore string. The reference counting mechanism is used to keep the 218 // WebCore string. The reference counting mechanism is used to keep the
210 // underlying buffer alive while the string is still live in the V8 engine. 219 // underlying buffer alive while the string is still live in the V8 engine.
211 inline v8::Handle<v8::String> v8String(v8::Isolate* isolate, const String& s tring) 220 inline v8::Handle<v8::String> v8String(v8::Isolate* isolate, const String& s tring)
212 { 221 {
213 if (string.isNull()) 222 if (string.isNull())
214 return v8::String::Empty(isolate); 223 return v8::String::Empty(isolate);
215 return V8PerIsolateData::from(isolate)->stringCache()->v8ExternalString( string.impl(), isolate); 224 return V8PerIsolateData::from(isolate)->stringCache()->v8ExternalString( string.impl(), isolate);
216 } 225 }
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 714
706 // Converts a DOM object to a v8 value. 715 // Converts a DOM object to a v8 value.
707 // This is a no-inline version of toV8(). If you want to call toV8() 716 // This is a no-inline version of toV8(). If you want to call toV8()
708 // without creating #include cycles, you can use this function instead. 717 // without creating #include cycles, you can use this function instead.
709 // Each specialized implementation will be generated. 718 // Each specialized implementation will be generated.
710 template<typename T> 719 template<typename T>
711 v8::Handle<v8::Value> toV8NoInline(T* impl, v8::Handle<v8::Object> creationC ontext, v8::Isolate*); 720 v8::Handle<v8::Value> toV8NoInline(T* impl, v8::Handle<v8::Object> creationC ontext, v8::Isolate*);
712 } // namespace WebCore 721 } // namespace WebCore
713 722
714 #endif // V8Binding_h 723 #endif // V8Binding_h
OLDNEW
« no previous file with comments | « Source/bindings/v8/ScriptDebugServer.cpp ('k') | Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698