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

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

Issue 90243003: Use V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID() in V8Window::openMethodCustom() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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 | 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 216
217 // FIXME: See the above comment. 217 // FIXME: See the above comment.
218 inline String toWebCoreStringWithUndefinedOrNullCheck(v8::Handle<v8::Value> value) 218 inline String toWebCoreStringWithUndefinedOrNullCheck(v8::Handle<v8::Value> value)
219 { 219 {
220 V8StringResource<WithUndefinedOrNullCheck> stringResource(value); 220 V8StringResource<WithUndefinedOrNullCheck> stringResource(value);
221 if (!stringResource.prepare()) 221 if (!stringResource.prepare())
222 return String(); 222 return String();
223 return stringResource; 223 return stringResource;
224 } 224 }
225 225
226 // FIXME: See the above comment.
227 inline AtomicString toWebCoreAtomicString(v8::Handle<v8::Value> value)
228 {
229 V8StringResource<> stringResource(value);
230 if (!stringResource.prepare())
231 return AtomicString();
232 return stringResource;
233 }
234
235 // Convert a string to a V8 string. 226 // Convert a string to a V8 string.
236 // Return a V8 external string that shares the underlying buffer with the gi ven 227 // Return a V8 external string that shares the underlying buffer with the gi ven
237 // WebCore string. The reference counting mechanism is used to keep the 228 // WebCore string. The reference counting mechanism is used to keep the
238 // underlying buffer alive while the string is still live in the V8 engine. 229 // underlying buffer alive while the string is still live in the V8 engine.
239 inline v8::Handle<v8::String> v8String(const String& string, v8::Isolate* is olate) 230 inline v8::Handle<v8::String> v8String(const String& string, v8::Isolate* is olate)
240 { 231 {
241 if (string.isNull()) 232 if (string.isNull())
242 return v8::String::Empty(isolate); 233 return v8::String::Empty(isolate);
243 return V8PerIsolateData::from(isolate)->stringCache()->v8ExternalString( string.impl(), isolate); 234 return V8PerIsolateData::from(isolate)->stringCache()->v8ExternalString( string.impl(), isolate);
244 } 235 }
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 719
729 // Converts a DOM object to a v8 value. 720 // Converts a DOM object to a v8 value.
730 // This is a no-inline version of toV8(). If you want to call toV8() 721 // This is a no-inline version of toV8(). If you want to call toV8()
731 // without creating #include cycles, you can use this function instead. 722 // without creating #include cycles, you can use this function instead.
732 // Each specialized implementation will be generated. 723 // Each specialized implementation will be generated.
733 template<typename T> 724 template<typename T>
734 v8::Handle<v8::Value> toV8NoInline(T* impl, v8::Handle<v8::Object> creationC ontext, v8::Isolate*); 725 v8::Handle<v8::Value> toV8NoInline(T* impl, v8::Handle<v8::Object> creationC ontext, v8::Isolate*);
735 } // namespace WebCore 726 } // namespace WebCore
736 727
737 #endif // V8Binding_h 728 #endif // V8Binding_h
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/Window/open-invalid-arguments-expected.txt ('k') | Source/bindings/v8/custom/V8WindowCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698