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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 ASSERT(m_isolate == v8::Isolate::GetCurrent()); | 103 ASSERT(m_isolate == v8::Isolate::GetCurrent()); |
104 v8::Handle<v8::String> v8Key = v8String(key, m_isolate); | 104 v8::Handle<v8::String> v8Key = v8String(key, m_isolate); |
105 if (!options->Has(v8Key)) | 105 if (!options->Has(v8Key)) |
106 return false; | 106 return false; |
107 value = options->Get(v8Key); | 107 value = options->Get(v8Key); |
108 if (value.IsEmpty()) | 108 if (value.IsEmpty()) |
109 return false; | 109 return false; |
110 return true; | 110 return true; |
111 } | 111 } |
112 | 112 |
| 113 bool Dictionary::get(const String& key, v8::Local<v8::Value>& value) const |
| 114 { |
| 115 return getKey(key, value); |
| 116 } |
| 117 |
113 bool Dictionary::get(const String& key, bool& value) const | 118 bool Dictionary::get(const String& key, bool& value) const |
114 { | 119 { |
115 v8::Local<v8::Value> v8Value; | 120 v8::Local<v8::Value> v8Value; |
116 if (!getKey(key, v8Value)) | 121 if (!getKey(key, v8Value)) |
117 return false; | 122 return false; |
118 | 123 |
119 v8::Local<v8::Boolean> v8Bool = v8Value->ToBoolean(); | 124 v8::Local<v8::Boolean> v8Bool = v8Value->ToBoolean(); |
120 if (v8Bool.IsEmpty()) | 125 if (v8Bool.IsEmpty()) |
121 return false; | 126 return false; |
122 value = v8Bool->Value(); | 127 value = v8Bool->Value(); |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 v8::Local<v8::String> key = properties->Get(i)->ToString(); | 587 v8::Local<v8::String> key = properties->Get(i)->ToString(); |
583 if (!options->Has(key)) | 588 if (!options->Has(key)) |
584 continue; | 589 continue; |
585 names.append(toWebCoreString(key)); | 590 names.append(toWebCoreString(key)); |
586 } | 591 } |
587 | 592 |
588 return true; | 593 return true; |
589 } | 594 } |
590 | 595 |
591 } // namespace WebCore | 596 } // namespace WebCore |
OLD | NEW |