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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/DictionaryHelperForCore.cpp

Issue 2817533003: Replace ASSERT, RELEASE_ASSERT, and ASSERT_NOT_REACHED in bindings (Closed)
Patch Set: fixed dcheck build error Created 3 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 CORE_EXPORT bool DictionaryHelper::Get(const Dictionary& dictionary, 287 CORE_EXPORT bool DictionaryHelper::Get(const Dictionary& dictionary,
288 const StringView& key, 288 const StringView& key,
289 ArrayValue& value) { 289 ArrayValue& value) {
290 v8::Local<v8::Value> v8_value; 290 v8::Local<v8::Value> v8_value;
291 if (!dictionary.Get(key, v8_value)) 291 if (!dictionary.Get(key, v8_value))
292 return false; 292 return false;
293 293
294 if (!v8_value->IsArray()) 294 if (!v8_value->IsArray())
295 return false; 295 return false;
296 296
297 ASSERT(dictionary.GetIsolate()); 297 DCHECK(dictionary.GetIsolate());
298 ASSERT(dictionary.GetIsolate() == v8::Isolate::GetCurrent()); 298 DCHECK_EQ(dictionary.GetIsolate(), v8::Isolate::GetCurrent());
299 value = 299 value =
300 ArrayValue(v8::Local<v8::Array>::Cast(v8_value), dictionary.GetIsolate()); 300 ArrayValue(v8::Local<v8::Array>::Cast(v8_value), dictionary.GetIsolate());
301 return true; 301 return true;
302 } 302 }
303 303
304 template <> 304 template <>
305 CORE_EXPORT bool DictionaryHelper::Get(const Dictionary& dictionary, 305 CORE_EXPORT bool DictionaryHelper::Get(const Dictionary& dictionary,
306 const StringView& key, 306 const StringView& key,
307 DOMUint8Array*& value) { 307 DOMUint8Array*& value) {
308 v8::Local<v8::Value> v8_value; 308 v8::Local<v8::Value> v8_value;
309 if (!dictionary.Get(key, v8_value)) 309 if (!dictionary.Get(key, v8_value))
310 return false; 310 return false;
311 311
312 value = V8Uint8Array::toImplWithTypeCheck(dictionary.GetIsolate(), v8_value); 312 value = V8Uint8Array::toImplWithTypeCheck(dictionary.GetIsolate(), v8_value);
313 return true; 313 return true;
314 } 314 }
315 315
316 } // namespace blink 316 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698