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

Side by Side Diff: Source/bindings/core/v8/V8StringResource.h

Issue 576323004: Drop unnecessary v8::TryCatch in V8StringResource::prepare() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: attempt at fixing before-unload-return-bad-value.html Created 6 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
« no previous file with comments | « LayoutTests/storage/websql/sql-error-codes-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 208
209 if (LIKELY(m_v8Object->IsString())) 209 if (LIKELY(m_v8Object->IsString()))
210 return true; 210 return true;
211 211
212 if (LIKELY(m_v8Object->IsInt32())) { 212 if (LIKELY(m_v8Object->IsInt32())) {
213 setString(int32ToWebCoreString(m_v8Object->Int32Value())); 213 setString(int32ToWebCoreString(m_v8Object->Int32Value()));
214 return true; 214 return true;
215 } 215 }
216 216
217 m_mode = DoNotExternalize; 217 m_mode = DoNotExternalize;
218 v8::TryCatch block;
219 m_v8Object = m_v8Object->ToString(); 218 m_v8Object = m_v8Object->ToString();
220 // Handle the case where an exception is thrown as part of invoking toSt ring on the object. 219 // Handle the case where an exception is thrown as part of invoking toSt ring on the object.
221 if (block.HasCaught()) { 220 if (m_v8Object.IsEmpty())
222 block.ReThrow();
223 return false; 221 return false;
224 }
225 return true; 222 return true;
226 } 223 }
227 operator String() const { return toString<String>(); } 224 operator String() const { return toString<String>(); }
228 operator AtomicString() const { return toString<AtomicString>(); } 225 operator AtomicString() const { return toString<AtomicString>(); }
229 226
230 private: 227 private:
231 bool isValid() const; 228 bool isValid() const;
232 String fallbackString() const; 229 String fallbackString() const;
233 230
234 void setString(const String& string) 231 void setString(const String& string)
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 } 285 }
289 286
290 template<> inline String V8StringResource<TreatNullAndUndefinedAsNullString>::fa llbackString() const 287 template<> inline String V8StringResource<TreatNullAndUndefinedAsNullString>::fa llbackString() const
291 { 288 {
292 return String(); 289 return String();
293 } 290 }
294 291
295 } // namespace blink 292 } // namespace blink
296 293
297 #endif // V8StringResource_h 294 #endif // V8StringResource_h
OLDNEW
« no previous file with comments | « LayoutTests/storage/websql/sql-error-codes-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698