| OLD | NEW |
| 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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 return false; | 314 return false; |
| 315 | 315 |
| 316 // FIXME: It is possible for this to throw in which case we'd be getting bac
k | 316 // FIXME: It is possible for this to throw in which case we'd be getting bac
k |
| 317 // an empty string and returning true when we should be returning fal
se. | 317 // an empty string and returning true when we should be returning fal
se. |
| 318 // See fast/dom/Geolocation/script-tests/argument-types.js for a simi
lar | 318 // See fast/dom/Geolocation/script-tests/argument-types.js for a simi
lar |
| 319 // example. | 319 // example. |
| 320 value = WebCore::isUndefinedOrNull(v8Value) ? String() : toWebCoreString(v8V
alue); | 320 value = WebCore::isUndefinedOrNull(v8Value) ? String() : toWebCoreString(v8V
alue); |
| 321 return true; | 321 return true; |
| 322 } | 322 } |
| 323 | 323 |
| 324 bool Dictionary::hasValue(const String& key) const |
| 325 { |
| 326 v8::Local<v8::Value> v8Value; |
| 327 return getKey(key, v8Value); |
| 328 } |
| 329 |
| 324 bool Dictionary::get(const String& key, RefPtr<Uint8Array>& value) const | 330 bool Dictionary::get(const String& key, RefPtr<Uint8Array>& value) const |
| 325 { | 331 { |
| 326 v8::Local<v8::Value> v8Value; | 332 v8::Local<v8::Value> v8Value; |
| 327 if (!getKey(key, v8Value)) | 333 if (!getKey(key, v8Value)) |
| 328 return false; | 334 return false; |
| 329 | 335 |
| 330 value = 0; | 336 value = 0; |
| 331 if (V8Uint8Array::HasInstance(v8Value, m_isolate, worldType(m_isolate))) | 337 if (V8Uint8Array::HasInstance(v8Value, m_isolate, worldType(m_isolate))) |
| 332 value = V8Uint8Array::toNative(v8::Handle<v8::Object>::Cast(v8Value)); | 338 value = V8Uint8Array::toNative(v8::Handle<v8::Object>::Cast(v8Value)); |
| 333 return true; | 339 return true; |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 v8::Local<v8::String> key = properties->Get(i)->ToString(); | 606 v8::Local<v8::String> key = properties->Get(i)->ToString(); |
| 601 if (!options->Has(key)) | 607 if (!options->Has(key)) |
| 602 continue; | 608 continue; |
| 603 names.append(toWebCoreString(key)); | 609 names.append(toWebCoreString(key)); |
| 604 } | 610 } |
| 605 | 611 |
| 606 return true; | 612 return true; |
| 607 } | 613 } |
| 608 | 614 |
| 609 } // namespace WebCore | 615 } // namespace WebCore |
| OLD | NEW |