21 #include "config.h" |
21 #include "config.h" |
22 #include "JSNavigator.h" |
22 #include "JSNavigator.h" |
23 |
23 |
24 #include "DOMMimeTypeArray.h" |
24 #include "DOMMimeTypeArray.h" |
25 #include "DOMPluginArray.h" |
25 #include "DOMPluginArray.h" |
26 #include "Geolocation.h" |
|
27 #include "JSDOMMimeTypeArray.h" |
26 #include "JSDOMMimeTypeArray.h" |
28 #include "JSDOMPluginArray.h" |
27 #include "JSDOMPluginArray.h" |
29 #include "JSGeolocation.h" |
|
30 #include "KURL.h" |
28 #include "KURL.h" |
31 #include "Navigator.h" |
29 #include "Navigator.h" |
32 #include <runtime/Error.h> |
30 #include <runtime/Error.h> |
33 #include <runtime/JSString.h> |
31 #include <runtime/JSString.h> |
34 #include <wtf/GetPtr.h> |
32 #include <wtf/GetPtr.h> |
44 #define THUNK_GENERATOR(generator) , generator |
42 #define THUNK_GENERATOR(generator) , generator |
45 #else |
43 #else |
46 #define THUNK_GENERATOR(generator) |
44 #define THUNK_GENERATOR(generator) |
47 #endif |
45 #endif |
48 |
46 |
49 static const HashTableValue JSNavigatorTableValues[16] = |
47 static const HashTableValue JSNavigatorTableValues[15] = |
50 { |
48 { |
51 { "appCodeName", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsNavigatorAppCodeName), (intptr_t)0 THUNK_GENERATOR(0) }, |
49 { "appCodeName", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsNavigatorAppCodeName), (intptr_t)0 THUNK_GENERATOR(0) }, |
52 { "appName", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsNavigatorAppName), (intptr_t)0 THUNK_GENERATOR(0) }, |
50 { "appName", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsNavigatorAppName), (intptr_t)0 THUNK_GENERATOR(0) }, |
53 { "appVersion", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsNavigatorAppVersion), (intptr_t)0 THUNK_GENERATOR(0) }, |
51 { "appVersion", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsNavigatorAppVersion), (intptr_t)0 THUNK_GENERATOR(0) }, |
54 { "language", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsNavigatorLanguage), (intptr_t)0 THUNK_GENERATOR(0) }, |
52 { "language", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsNavigatorLanguage), (intptr_t)0 THUNK_GENERATOR(0) }, |
60 { "productSub", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsNavigatorProductSub), (intptr_t)0 THUNK_GENERATOR(0) }, |
58 { "productSub", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsNavigatorProductSub), (intptr_t)0 THUNK_GENERATOR(0) }, |
61 { "vendor", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsNavigatorVendor), (intptr_t)0 THUNK_GENERATOR(0) }, |
59 { "vendor", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsNavigatorVendor), (intptr_t)0 THUNK_GENERATOR(0) }, |
62 { "vendorSub", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsNavigatorVendorSub), (intptr_t)0 THUNK_GENERATOR(0) }, |
60 { "vendorSub", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsNavigatorVendorSub), (intptr_t)0 THUNK_GENERATOR(0) }, |
63 { "cookieEnabled", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsNavigatorCookieEnabled), (intptr_t)0 THUNK_GENERATOR(0) }, |
61 { "cookieEnabled", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsNavigatorCookieEnabled), (intptr_t)0 THUNK_GENERATOR(0) }, |
64 { "onLine", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsNavigatorOnLine), (intptr_t)0 THUNK_GENERATOR(0) }, |
62 { "onLine", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsNavigatorOnLine), (intptr_t)0 THUNK_GENERATOR(0) }, |
65 { "geolocation", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsNavigatorGeolocation), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
66 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
63 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
67 }; |
64 }; |
68 |
65 |
69 #undef THUNK_GENERATOR |
66 #undef THUNK_GENERATOR |
70 static JSC_CONST_HASHTABLE HashTable JSNavigatorTable = { 36, 31, JSNavigatorTableValues, 0 }; |
67 static JSC_CONST_HASHTABLE HashTable JSNavigatorTable = { 36, 31, JSNavigatorTableValues, 0 }; |
253 Navigator* imp = static_cast<Navigator*>(castedThis->impl()); |
250 Navigator* imp = static_cast<Navigator*>(castedThis->impl()); |
254 JSValue result = jsBoolean(imp->onLine()); |
251 JSValue result = jsBoolean(imp->onLine()); |
255 return result; |
252 return result; |
256 } |
253 } |
257 |
254 |
258 JSValue jsNavigatorGeolocation(ExecState* exec, JSValue slotBase, const Identifier&) |
|
259 { |
|
260 JSNavigator* castedThis = static_cast<JSNavigator*>(asObject(slotBase)); |
|
261 UNUSED_PARAM(exec); |
|
262 Navigator* imp = static_cast<Navigator*>(castedThis->impl()); |
|
263 // :HACK: JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->geolocation())); |
|
264 JSValue result; // :HACK: |
|
265 return result; |
|
266 } |
|
267 |
|
268 EncodedJSValue JSC_HOST_CALL jsNavigatorPrototypeFunctionJavaEnabled(ExecState* exec) |
255 EncodedJSValue JSC_HOST_CALL jsNavigatorPrototypeFunctionJavaEnabled(ExecState* exec) |
269 { |
256 { |
270 JSValue thisValue = exec->hostThisValue(); |
257 JSValue thisValue = exec->hostThisValue(); |
271 if (!thisValue.inherits(&JSNavigator::s_info)) |
258 if (!thisValue.inherits(&JSNavigator::s_info)) |
272 return throwVMTypeError(exec); |
259 return throwVMTypeError(exec); |