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

Side by Side Diff: Source/bindings/v8/custom/V8HTMLDocumentCustom.cpp

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) 2007, 2008, 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 // HTMLDocument ---------------------------------------------------------------- 54 // HTMLDocument ----------------------------------------------------------------
55 55
56 // Concatenates "args" to a string. If args is empty, returns empty string. 56 // Concatenates "args" to a string. If args is empty, returns empty string.
57 // Firefox/Safari/IE support non-standard arguments to document.write, ex: 57 // Firefox/Safari/IE support non-standard arguments to document.write, ex:
58 // document.write("a", "b", "c") --> document.write("abc") 58 // document.write("a", "b", "c") --> document.write("abc")
59 // document.write() --> document.write("") 59 // document.write() --> document.write("")
60 static String writeHelperGetString(const v8::FunctionCallbackInfo<v8::Value>& ar gs) 60 static String writeHelperGetString(const v8::FunctionCallbackInfo<v8::Value>& ar gs)
61 { 61 {
62 StringBuilder builder; 62 StringBuilder builder;
63 for (int i = 0; i < args.Length(); ++i) 63 for (int i = 0; i < args.Length(); ++i) {
64 builder.append(toWebCoreString(args[i])); 64 V8TRYCATCH_FOR_V8STRINGRESOURCE_RETURN(V8StringResource<>, stringArgumen t, args[i], String());
haraken 2013/09/12 17:33:52 Ditto.
65 builder.append(stringArgument);
66 }
65 return builder.toString(); 67 return builder.toString();
66 } 68 }
67 69
68 void V8HTMLDocument::writeMethodCustom(const v8::FunctionCallbackInfo<v8::Value> & args) 70 void V8HTMLDocument::writeMethodCustom(const v8::FunctionCallbackInfo<v8::Value> & args)
69 { 71 {
70 HTMLDocument* htmlDocument = V8HTMLDocument::toNative(args.Holder()); 72 HTMLDocument* htmlDocument = V8HTMLDocument::toNative(args.Holder());
71 htmlDocument->write(writeHelperGetString(args), activeDOMWindow()->document( )); 73 htmlDocument->write(writeHelperGetString(args), activeDOMWindow()->document( ));
72 } 74 }
73 75
74 void V8HTMLDocument::writelnMethodCustom(const v8::FunctionCallbackInfo<v8::Valu e>& args) 76 void V8HTMLDocument::writelnMethodCustom(const v8::FunctionCallbackInfo<v8::Valu e>& args)
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 if (wrapper.IsEmpty()) 119 if (wrapper.IsEmpty())
118 return wrapper; 120 return wrapper;
119 if (!isolatedWorldForEnteredContext()) { 121 if (!isolatedWorldForEnteredContext()) {
120 if (Frame* frame = impl->frame()) 122 if (Frame* frame = impl->frame())
121 frame->script()->windowShell(mainThreadNormalWorld())->updateDocumen tWrapper(wrapper); 123 frame->script()->windowShell(mainThreadNormalWorld())->updateDocumen tWrapper(wrapper);
122 } 124 }
123 return wrapper; 125 return wrapper;
124 } 126 }
125 127
126 } // namespace WebCore 128 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698