Changeset 54593 in webkit
- Timestamp:
- Feb 10, 2010 2:36:40 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r54591 r54593 1 2010-02-10 Yaar Schnitman <yaar@chromium.org> 2 3 Reviewed by Adam Barth. 4 5 Simplified RuntimeEnabledFeatures and corresponding v8 generated code 6 https://bugs.webkit.org/show_bug.cgi?id=34667 7 8 * WebCore.gypi: 9 * bindings/generic/RuntimeEnabledFeatures.cpp: Added. 10 (WebCore::RuntimeEnabledFeatures::audioEnabled): 11 (WebCore::RuntimeEnabledFeatures::htmlMediaElementEnabled): 12 (WebCore::RuntimeEnabledFeatures::htmlAudioElementEnabled): 13 (WebCore::RuntimeEnabledFeatures::htmlVideoElementEnabled): 14 (WebCore::RuntimeEnabledFeatures::mediaErrorEnabled): 15 (WebCore::RuntimeEnabledFeatures::sharedWorkerEnabled): 16 (WebCore::RuntimeEnabledFeatures::webSocketEnabled): 17 (WebCore::RuntimeEnabledFeatures::openDatabaseEnabled): 18 * bindings/generic/RuntimeEnabledFeatures.h: Added. 19 (WebCore::RuntimeEnabledFeatures::setLocalStorageEnabled): 20 (WebCore::RuntimeEnabledFeatures::localStorageEnabled): 21 (WebCore::RuntimeEnabledFeatures::setSessionStorageEnabled): 22 (WebCore::RuntimeEnabledFeatures::sessionStorageEnabled): 23 (WebCore::RuntimeEnabledFeatures::setWebkitNotificationsEnabled): 24 (WebCore::RuntimeEnabledFeatures::webkitNotificationsEnabled): 25 (WebCore::RuntimeEnabledFeatures::setApplicationCacheEnabled): 26 (WebCore::RuntimeEnabledFeatures::applicationCacheEnabled): 27 (WebCore::RuntimeEnabledFeatures::setGeolocationEnabled): 28 (WebCore::RuntimeEnabledFeatures::geolocationEnabled): 29 (WebCore::RuntimeEnabledFeatures::setIndexedDBEnabled): 30 (WebCore::RuntimeEnabledFeatures::indexedDBEnabled): 31 (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures): 32 * bindings/scripts/CodeGenerator.pm: 33 * bindings/scripts/CodeGeneratorV8.pm: 34 * bindings/v8/RuntimeEnabledFeatures.cpp: Removed. 35 * bindings/v8/RuntimeEnabledFeatures.h: Removed. 36 * bindings/v8/custom/V8DOMWindowCustom.cpp: 37 * bindings/v8/custom/V8NavigatorCustom.cpp: 38 * bindings/v8/custom/V8WorkerContextCustom.cpp: 39 1 40 2010-02-09 Alexander Pavlov <apavlov@chromium.org> 2 41 -
trunk/WebCore/WebCore.gypi
r54591 r54593 456 456 'bindings/generic/BindingSecurityBase.h', 457 457 'bindings/generic/GenericBinding.h', 458 'bindings/generic/RuntimeEnabledFeatures.cpp', 459 'bindings/generic/RuntimeEnabledFeatures.h', 458 460 'bindings/js/CachedScriptSourceProvider.h', 459 461 'bindings/js/DOMObjectWithSVGContext.h', … … 787 789 'bindings/v8/NPV8Object.h', 788 790 'bindings/v8/OwnHandle.h', 789 'bindings/v8/RuntimeEnabledFeatures.cpp',790 'bindings/v8/RuntimeEnabledFeatures.h',791 791 'bindings/v8/ScheduledAction.cpp', 792 792 'bindings/v8/ScheduledAction.h', … … 3824 3824 'inspector/front-end/Images/errorIcon.png', 3825 3825 'inspector/front-end/Images/errorMediumIcon.png', 3826 'inspector/front-end/Images/errorRedDot.png', 3826 'inspector/front-end/Images/errorRedDot.png', 3827 3827 'inspector/front-end/Images/excludeButtonGlyph.png', 3828 3828 'inspector/front-end/Images/focusButtonGlyph.png', -
trunk/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
r54591 r54593 32 32 #include "RuntimeEnabledFeatures.h" 33 33 34 #include "Database.h" 35 #include "MediaPlayer.h" 36 #include "SharedWorkerRepository.h" 37 #include "WebSocket.h" 38 34 39 namespace WebCore { 35 40 36 41 bool RuntimeEnabledFeatures::isLocalStorageEnabled = true; 37 42 bool RuntimeEnabledFeatures::isSessionStorageEnabled = true; 38 bool RuntimeEnabledFeatures::is NotificationsEnabled = false;43 bool RuntimeEnabledFeatures::isWebkitNotificationsEnabled = false; 39 44 bool RuntimeEnabledFeatures::isApplicationCacheEnabled = false; 40 45 bool RuntimeEnabledFeatures::isGeolocationEnabled = false; 41 bool RuntimeEnabledFeatures::isIndexedDatabaseEnabled = false; 46 bool RuntimeEnabledFeatures::isIndexedDBEnabled = false; 47 48 #if ENABLE(VIDEO) 49 50 bool RuntimeEnabledFeatures::audioEnabled() 51 { 52 return MediaPlayer::isAvailable(); 53 } 54 55 bool RuntimeEnabledFeatures::htmlMediaElementEnabled() 56 { 57 return MediaPlayer::isAvailable(); 58 } 59 60 bool RuntimeEnabledFeatures::htmlAudioElementEnabled() 61 { 62 return MediaPlayer::isAvailable(); 63 } 64 65 bool RuntimeEnabledFeatures::htmlVideoElementEnabled() 66 { 67 return MediaPlayer::isAvailable(); 68 } 69 70 bool RuntimeEnabledFeatures::mediaErrorEnabled() 71 { 72 return MediaPlayer::isAvailable(); 73 } 74 75 #endif 76 77 #if ENABLE(SHARED_WORKERS) 78 bool RuntimeEnabledFeatures::sharedWorkerEnabled() 79 { 80 return SharedWorkerRepository::isAvailable(); 81 } 82 #endif 83 84 #if ENABLE(WEB_SOCKETS) 85 bool RuntimeEnabledFeatures::webSocketEnabled() 86 { 87 return WebSocket::isAvailable(); 88 } 89 #endif 90 91 #if ENABLE(DATABASE) 92 bool RuntimeEnabledFeatures::openDatabaseEnabled() 93 { 94 return Database::isAvailable(); 95 } 96 #endif 42 97 43 98 } // namespace WebCore -
trunk/WebCore/bindings/generic/RuntimeEnabledFeatures.h
r54591 r54593 34 34 namespace WebCore { 35 35 36 // A class that stores static enablers for all experimental features 36 // A class that stores static enablers for all experimental features. Note that 37 // the method names must line up with the JavaScript method they enable for code 38 // generation to work properly. 39 37 40 class RuntimeEnabledFeatures { 38 41 public: … … 43 46 static bool sessionStorageEnabled() { return isSessionStorageEnabled; } 44 47 45 static void set NotificationsEnabled(bool isEnabled) { isNotificationsEnabled = isEnabled; }46 static bool notificationsEnabled() { return isNotificationsEnabled; }48 static void setWebkitNotificationsEnabled(bool isEnabled) { isWebkitNotificationsEnabled = isEnabled; } 49 static bool webkitNotificationsEnabled() { return isWebkitNotificationsEnabled; } 47 50 48 51 static void setApplicationCacheEnabled(bool isEnabled) { isApplicationCacheEnabled = isEnabled; } … … 52 55 static bool geolocationEnabled() { return isGeolocationEnabled; } 53 56 54 static void setIndexedDatabaseEnabled(bool isEnabled) { isIndexedDatabaseEnabled = isEnabled; } 55 static bool indexedDatabaseEnabled() { return isIndexedDatabaseEnabled; } 57 static void setIndexedDBEnabled(bool isEnabled) { isIndexedDBEnabled = isEnabled; } 58 static bool indexedDBEnabled() { return isIndexedDBEnabled; } 59 60 #if ENABLE(VIDEO) 61 static bool audioEnabled(); 62 static bool htmlMediaElementEnabled(); 63 static bool htmlAudioElementEnabled(); 64 static bool htmlVideoElementEnabled(); 65 static bool mediaErrorEnabled(); 66 #endif 67 68 #if ENABLE(SHARED_WORKERS) 69 static bool sharedWorkerEnabled(); 70 #endif 71 72 #if ENABLE(WEB_SOCKETS) 73 static bool webSocketEnabled(); 74 #endif 75 76 #if ENABLE(DATABASE) 77 static bool openDatabaseEnabled(); 78 #endif 56 79 57 80 private: … … 61 84 static bool isLocalStorageEnabled; 62 85 static bool isSessionStorageEnabled; 63 static bool is NotificationsEnabled;86 static bool isWebkitNotificationsEnabled; 64 87 static bool isApplicationCacheEnabled; 65 88 static bool isGeolocationEnabled; 66 static bool isIndexedD atabaseEnabled;89 static bool isIndexedDBEnabled; 67 90 }; 68 91 -
trunk/WebCore/bindings/scripts/CodeGenerator.pm
r53890 r54593 1 1 # 2 2 # WebKit IDL parser 3 # 3 # 4 4 # Copyright (C) 2005 Nikolas Zimmermann <wildfox@kde.org> 5 5 # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> 6 6 # Copyright (C) 2007 Apple Inc. All rights reserved. 7 7 # Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> 8 # 8 # 9 9 # This library is free software; you can redistribute it and/or 10 10 # modify it under the terms of the GNU Library General Public 11 11 # License as published by the Free Software Foundation; either 12 12 # version 2 of the License, or (at your option) any later version. 13 # 13 # 14 14 # This library is distributed in the hope that it will be useful, 15 15 # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 17 # Library General Public License for more details. 18 # 18 # 19 19 # You should have received a copy of the GNU Library General Public License 20 20 # aint with this library; see the file COPYING.LIB. If not, write to 21 21 # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22 22 # Boston, MA 02110-1301, USA. 23 # 23 # 24 24 25 25 package CodeGenerator; … … 40 40 my $verbose = 0; 41 41 42 my %primitiveTypeHash = ("int" => 1, "short" => 1, "long" => 1, "long long" => 1, 42 my %primitiveTypeHash = ("int" => 1, "short" => 1, "long" => 1, "long long" => 1, 43 43 "unsigned int" => 1, "unsigned short" => 1, 44 "unsigned long" => 1, "unsigned long long" => 1, 45 "float" => 1, "double" => 1, 44 "unsigned long" => 1, "unsigned long long" => 1, 45 "float" => 1, "double" => 1, 46 46 "boolean" => 1, "void" => 1, 47 47 "Date" => 1); … … 329 329 330 330 return 1 if $svgAnimatedTypeHash{$type}; 331 return 0; 332 } 333 334 # Uppercase the first letter while respecting WebKit style guidelines. 331 return 0; 332 } 333 334 # Uppercase the first letter while respecting WebKit style guidelines. 335 335 # E.g., xmlEncoding becomes XMLEncoding, but xmlllang becomes Xmllang. 336 336 sub WK_ucfirst … … 342 342 } 343 343 344 # Lowercase the first letter while respecting WebKit style guidelines. 344 # Lowercase the first letter while respecting WebKit style guidelines. 345 345 # URL becomes url, but SetURL becomes setURL. 346 346 sub WK_lcfirst … … 348 348 my ($object, $param) = @_; 349 349 my $ret = lcfirst($param); 350 $ret =~ s/hTML/html/ if $ret =~ /^hTML/; 350 351 $ret =~ s/uRL/url/ if $ret =~ /^uRL/; 351 352 $ret =~ s/jS/js/ if $ret =~ /^jS/; -
trunk/WebCore/bindings/scripts/CodeGeneratorV8.pm
r54503 r54593 304 304 END 305 305 } 306 306 307 307 foreach my $attribute (@{$dataNode->attributes}) { 308 308 my $name = $attribute->signature->name; … … 325 325 } 326 326 327 GenerateHeaderRuntimeEnablerDeclarations(@enabledAtRuntime);328 327 GenerateHeaderNamedAndIndexedPropertyAccessors($dataNode); 329 328 GenerateHeaderCustomCall($dataNode); 330 329 GenerateHeaderCustomInternalFieldIndices($dataNode); 331 330 332 331 if ($dataNode->extendedAttributes->{"CheckDomainSecurity"}) { 333 332 push(@headerContent, <<END); … … 358 357 my $dataNode = shift; 359 358 my $name = $dataNode->name; 360 359 361 360 # FIXME: I am hideous and hard-coded. Make me beautiful. 362 361 return ("cacheIndex", "implementationIndex") if ($name eq "Document") || ($name eq "SVGDocument"); … … 414 413 } 415 414 416 sub GenerateHeaderRuntimeEnablerDeclarations417 {418 my @enabledAtRuntime = @_;419 420 foreach my $runtime_attr (@enabledAtRuntime) {421 my $enabledAtRuntimeConditionalString = GenerateConditionalString($runtime_attr->signature);422 my $enabler = $codeGenerator->WK_ucfirst($runtime_attr->signature->name);423 if ($enabledAtRuntimeConditionalString) {424 push(@headerContent, "\n#if ${enabledAtRuntimeConditionalString}\n");425 }426 push(@headerContent, <<END);427 static bool ${enabler}Enabled();428 END429 if ($enabledAtRuntimeConditionalString) {430 push(@headerContent, "#endif\n");431 }432 }433 }434 435 415 my %indexerSpecialCases = ( 436 416 "Storage" => 1, … … 470 450 END 471 451 } 472 452 473 453 if ($isIndexerSpecialCase || $hasCustomIndexedSetter) { 474 454 push(@headerContent, <<END); … … 506 486 { 507 487 my $dataNode = shift; 508 488 509 489 if ($dataNode->extendedAttributes->{"CustomCall"}) { 510 490 push(@headerContent, " static v8::Handle<v8::Value> callAsFunctionCallback(const v8::Arguments&);\n"); … … 995 975 $function = shift; 996 976 $dataNode = shift; 997 977 998 978 my $interfaceName = $dataNode->name; 999 979 my $name = $function->signature->name; … … 1063 1043 " }\n"); 1064 1044 } 1065 1045 1066 1046 my $raisesExceptions = @{$function->raisesExceptions}; 1067 1047 if (!$raisesExceptions) { … … 1148 1128 push(@implContentDecls, " return v8::Handle<v8::Value>();\n"); 1149 1129 } 1150 1130 1151 1131 push(@implContentDecls, " }\n\n"); 1152 1132 } … … 1471 1451 push(@implFixedHeader, 1472 1452 "#include \"config.h\"\n" . 1453 "#include \"RuntimeEnabledFeatures.h\"\n" . 1473 1454 "#include \"V8Proxy.h\"\n" . 1474 1455 "#include \"V8Binding.h\"\n" . … … 1539 1520 GenerateConstructorGetter($implClassName, $classIndex); 1540 1521 } 1541 1522 1542 1523 my $indexer; 1543 1524 my $namedPropertyGetter; … … 1600 1581 push(@implContent, "};\n"); 1601 1582 } 1602 1583 1603 1584 # Setup table of standard callback functions 1604 1585 $num_callbacks = 0; … … 1698 1679 last; 1699 1680 } 1700 1681 1701 1682 # Generate the template configuration method 1702 1683 push(@implContent, <<END); … … 1715 1696 END 1716 1697 } 1717 1698 1718 1699 if ($has_callbacks) { 1719 1700 push(@implContent, <<END); … … 1733 1714 1734 1715 if ($access_check or @enabledAtRuntime or @{$dataNode->functions} or $has_constants) { 1735 push(@implContent, <<END);1716 push(@implContent, <<END); 1736 1717 v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate(); 1737 1718 v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate(); … … 1740 1721 1741 1722 push(@implContent, " $access_check\n"); 1742 1723 1743 1724 # Setup the enable-at-runtime attrs if we have them 1744 1725 foreach my $runtime_attr (@enabledAtRuntime) { 1745 $enable_function = $interfaceName . "::" . $codeGenerator->WK_ucfirst($runtime_attr->signature->name); 1726 # A function named RuntimeEnabledFeatures::{methodName}Enabled() need to be written by hand. 1727 $enable_function = "RuntimeEnabledFeatures::" . $codeGenerator->WK_lcfirst($runtime_attr->signature->name) . "Enabled"; 1746 1728 my $conditionalString = GenerateConditionalString($runtime_attr->signature); 1747 1729 push(@implContent, "\n#if ${conditionalString}\n") if $conditionalString; 1748 push(@implContent, " if ( V8${enable_function}Enabled()) {\n");1730 push(@implContent, " if (${enable_function}()) {\n"); 1749 1731 push(@implContent, " static const BatchedAttribute attrData =\\\n"); 1750 1732 GenerateSingleBatchedAttribute($interfaceName, $runtime_attr, ";", " "); … … 1786 1768 if ($attrExt->{"EnabledAtRuntime"}) { 1787 1769 # Only call Set()/SetAccessor() if this method should be enabled 1788 $enable_function = $interfaceName . "::" . $codeGenerator->WK_ucfirst($function->signature->name);1789 $conditional = "if ( V8${enable_function}Enabled())\n";1770 $enable_function = "RuntimeEnabledFeatures::" . $codeGenerator->WK_lcfirst($function->signature->name) . "Enabled"; 1771 $conditional = "if (${enable_function}())\n"; 1790 1772 } 1791 1773 … … 1834 1816 # Normal function call is a template 1835 1817 my $callback = GetFunctionTemplateCallbackName($function, $dataNode); 1836 1818 1837 1819 if ($property_attributes eq "v8::DontDelete") { 1838 1820 $property_attributes = ""; … … 1840 1822 $property_attributes = ", static_cast<v8::PropertyAttribute>($property_attributes)"; 1841 1823 } 1842 1824 1843 1825 if ($template eq "proto" && $conditional eq "" && $signature eq "default_signature" && $property_attributes eq "") { 1844 1826 # Standard type of callback, already created in the batch, so skip it here. 1845 1827 next; 1846 1828 } 1847 1829 1848 1830 push(@implContent, <<END); 1849 1831 ${conditional}$template->Set(v8::String::New("$name"), v8::FunctionTemplate::New($callback, v8::Handle<v8::Value>(), ${signature})$property_attributes); … … 1851 1833 $num_callbacks++; 1852 1834 } 1853 1835 1854 1836 die "Wrong number of callbacks generated for $interfaceName ($num_callbacks, should be $total_functions)" if $num_callbacks != $total_functions; 1855 1837 … … 1859 1841 END 1860 1842 } 1861 1843 1862 1844 # Special cases 1863 1845 if ($interfaceName eq "DOMWindow") { 1864 1846 push(@implContent, <<END); 1865 1847 1866 1848 proto->SetInternalFieldCount(V8DOMWindow::internalFieldCount); 1867 1849 desc->SetHiddenPrototype(true); … … 1875 1857 if ($interfaceName eq "Location") { 1876 1858 push(@implContent, <<END); 1877 1878 // For security reasons, these functions are on the instance instead 1859 1860 // For security reasons, these functions are on the instance instead 1879 1861 // of on the prototype object to insure that they cannot be overwritten. 1880 1862 instance->SetAccessor(v8::String::New("reload"), V8Location::reloadAccessorGetter, 0, v8::Handle<v8::Value>(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly)); … … 1889 1871 } 1890 1872 push(@implContent, <<END); 1891 1873 1892 1874 // Custom toString template 1893 1875 desc->Set(getToStringName(), getToStringTemplate()); … … 1906 1888 1907 1889 ${nativeType}* ${className}::toNative(v8::Handle<v8::Object> object) { 1908 return reinterpret_cast<${nativeType}*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex)); 1890 return reinterpret_cast<${nativeType}*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex)); 1909 1891 } 1910 1892 … … 1927 1909 END 1928 1910 } 1929 1911 1930 1912 GenerateToV8Converters($dataNode, $interfaceName, $className, $nativeType); 1931 1913 … … 1937 1919 } 1938 1920 1939 sub GenerateToV8Converters 1921 sub GenerateToV8Converters 1940 1922 { 1941 1923 my $dataNode = shift; … … 1943 1925 my $className = shift; 1944 1926 my $nativeType = shift; 1945 1927 1946 1928 my $wrapperType = "V8ClassIndex::" . uc($interfaceName); 1947 1929 my $domMapFunction = GetDomMapFunction($dataNode, $interfaceName); 1948 1930 my $forceNewObjectInput = IsDOMNodeType($interfaceName) ? ", bool forceNewObject" : ""; 1949 1931 my $forceNewObjectCall = IsDOMNodeType($interfaceName) ? ", forceNewObject" : ""; 1950 1951 push(@implContent, <<END); 1932 1933 push(@implContent, <<END); 1952 1934 1953 1935 v8::Handle<v8::Object> ${className}::wrap(${nativeType}* impl${forceNewObjectInput}) { … … 2004 1986 END 2005 1987 } 2006 1988 2007 1989 push(@implContent, <<END); 2008 1990 if (wrapper.IsEmpty()) … … 2030 2012 END 2031 2013 } 2032 2014 2033 2015 if (!HasCustomToV8Implementation($dataNode, $interfaceName)) { 2034 2016 push(@implContent, <<END); … … 2047 2029 $dataNode = shift; 2048 2030 $interfaceName = shift; 2049 2031 2050 2032 # We generate a custom converter (but JSC doesn't) for the following: 2051 2033 return 1 if $interfaceName eq "BarInfo"; … … 2065 2047 return 1 if $interfaceName eq "Screen"; 2066 2048 return 1 if $interfaceName eq "WorkerContext"; 2067 2068 2049 # We don't generate a custom converter (but JSC does) for the following: 2069 2050 return 0 if $interfaceName eq "AbstractWorker"; … … 2294 2275 2295 2276 $type = GetNativeType($type, $parameterIndex >= 0 ? 1 : 0); 2296 2277 2297 2278 if ($parameterIndex >= 0 && $type eq "V8Parameter") { 2298 2279 my $mode = ""; … … 2304 2285 $type .= "<$mode>"; 2305 2286 } 2306 2287 2307 2288 return $type; 2308 2289 } -
trunk/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
r54349 r54593 1 1 /* 2 2 * Copyright (C) 2009 Google Inc. All rights reserved. 3 * 3 * 4 4 * Redistribution and use in source and binary forms, with or without 5 5 * modification, are permitted provided that the following conditions are 6 6 * met: 7 * 7 * 8 8 * * Redistributions of source code must retain the above copyright 9 9 * notice, this list of conditions and the following disclaimer. … … 15 15 * contributors may be used to endorse or promote products derived from 16 16 * this software without specific prior written permission. 17 * 17 * 18 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT … … 46 46 #include "Page.h" 47 47 #include "PlatformScreen.h" 48 #include "RuntimeEnabledFeatures.h"49 48 #include "ScheduledAction.h" 50 49 #include "ScriptSourceCode.h" … … 96 95 v8::Handle<v8::Value> v8String = function->ToString(); 97 96 98 // Bail out if string conversion failed. 99 if (v8String.IsEmpty()) 100 return v8::Undefined(); 97 // Bail out if string conversion failed. 98 if (v8String.IsEmpty()) 99 return v8::Undefined(); 101 100 102 101 functionString = toWebCoreString(v8String); … … 229 228 if (!V8BindingSecurity::canAccessFrame(V8BindingState::Only(), imp->frame(), true)) 230 229 return; 231 230 232 231 // Opener can be shadowed if it is in the same domain. 233 232 // Have a special handling of null value to behave … … 255 254 } 256 255 257 bool V8DOMWindow::AudioEnabled()258 {259 return MediaPlayer::isAvailable();260 }261 262 bool V8DOMWindow::HTMLMediaElementEnabled()263 {264 return MediaPlayer::isAvailable();265 }266 267 bool V8DOMWindow::HTMLAudioElementEnabled()268 {269 return MediaPlayer::isAvailable();270 }271 272 bool V8DOMWindow::HTMLVideoElementEnabled()273 {274 return MediaPlayer::isAvailable();275 }276 277 bool V8DOMWindow::MediaErrorEnabled()278 {279 return MediaPlayer::isAvailable();280 }281 282 #endif283 284 #if ENABLE(SHARED_WORKERS)285 bool V8DOMWindow::SharedWorkerEnabled()286 {287 return SharedWorkerRepository::isAvailable();288 }289 #endif290 291 #if ENABLE(WEB_SOCKETS)292 bool V8DOMWindow::WebSocketEnabled()293 {294 return WebSocket::isAvailable();295 }296 #endif297 298 #if ENABLE(DATABASE)299 bool V8DOMWindow::OpenDatabaseEnabled()300 {301 return Database::isAvailable();302 }303 #endif304 305 #if ENABLE(INDEXED_DATABASE)306 bool V8DOMWindow::IndexedDBEnabled()307 {308 return RuntimeEnabledFeatures::indexedDatabaseEnabled();309 }310 #endif311 312 #if ENABLE(DOM_STORAGE)313 bool V8DOMWindow::LocalStorageEnabled()314 {315 return RuntimeEnabledFeatures::localStorageEnabled();316 }317 318 bool V8DOMWindow::SessionStorageEnabled()319 {320 return RuntimeEnabledFeatures::sessionStorageEnabled();321 }322 #endif323 324 #if ENABLE(NOTIFICATIONS)325 bool V8DOMWindow::WebkitNotificationsEnabled()326 {327 return RuntimeEnabledFeatures::notificationsEnabled();328 }329 #endif330 331 #if ENABLE(OFFLINE_WEB_APPLICATIONS)332 bool V8DOMWindow::ApplicationCacheEnabled()333 {334 return RuntimeEnabledFeatures::applicationCacheEnabled();335 }336 256 #endif 337 257 … … 596 516 windowFeatures.height = WindowFeatures::floatFeature(features, "dialogheight", 100, screenRect.height(), 450); 597 517 windowFeatures.heightSet = true; 598 518 599 519 windowFeatures.x = WindowFeatures::floatFeature(features, "dialogleft", screenRect.x(), screenRect.right() - windowFeatures.width, -1); 600 520 windowFeatures.xSet = windowFeatures.x > 0; … … 695 615 if (!shouldAllowNavigation(frame)) 696 616 return v8::Undefined(); 697 617 698 618 String completedUrl; 699 619 if (!urlString.isEmpty()) 700 620 completedUrl = completeURL(urlString); 701 621 702 622 if (!completedUrl.isEmpty() && 703 623 (!protocolIsJavaScript(completedUrl) || ScriptController::isSafeScript(frame))) { -
trunk/WebCore/bindings/v8/custom/V8NavigatorCustom.cpp
r54150 r54593 1 1 /* 2 2 * Copyright (C) 2010 Google Inc. All rights reserved. 3 * 3 * 4 4 * Redistribution and use in source and binary forms, with or without 5 5 * modification, are permitted provided that the following conditions are 6 6 * met: 7 * 7 * 8 8 * * Redistributions of source code must retain the above copyright 9 9 * notice, this list of conditions and the following disclaimer. … … 15 15 * contributors may be used to endorse or promote products derived from 16 16 * this software without specific prior written permission. 17 * 17 * 18 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT … … 38 38 namespace WebCore { 39 39 40 #if ENABLE(GEOLOCATION)41 bool V8Navigator::GeolocationEnabled()42 {43 return RuntimeEnabledFeatures::geolocationEnabled();44 }45 #endif46 47 40 v8::Handle<v8::Value> toV8(Navigator* impl) 48 41 { -
trunk/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp
r54499 r54593 36 36 #include "DOMTimer.h" 37 37 #include "ExceptionCode.h" 38 #include "RuntimeEnabledFeatures.h"39 38 #include "ScheduledAction.h" 40 39 #include "V8Binding.h" … … 47 46 48 47 namespace WebCore { 49 50 #if ENABLE(NOTIFICATIONS)51 bool V8WorkerContext::WebkitNotificationsEnabled()52 {53 return RuntimeEnabledFeatures::notificationsEnabled();54 }55 #endif56 57 #if ENABLE(WEB_SOCKETS)58 bool V8WorkerContext::WebSocketEnabled()59 {60 return WebSocket::isAvailable();61 }62 #endif63 48 64 49 v8::Handle<v8::Value> SetTimeoutOrInterval(const v8::Arguments& args, bool singleShot) -
trunk/WebKit/chromium/src/WebRuntimeFeatures.cpp
r54085 r54593 124 124 { 125 125 #if ENABLE(NOTIFICATIONS) 126 RuntimeEnabledFeatures::set NotificationsEnabled(enable);126 RuntimeEnabledFeatures::setWebkitNotificationsEnabled(enable); 127 127 #endif 128 128 } … … 131 131 { 132 132 #if ENABLE(NOTIFICATIONS) 133 return RuntimeEnabledFeatures:: notificationsEnabled();133 return RuntimeEnabledFeatures::webkitNotificationsEnabled(); 134 134 #else 135 135 return false; … … 172 172 { 173 173 #if ENABLE(INDEXED_DATABASE) 174 RuntimeEnabledFeatures::setIndexedD atabaseEnabled(enable);174 RuntimeEnabledFeatures::setIndexedDBEnabled(enable); 175 175 #endif 176 176 } … … 179 179 { 180 180 #if ENABLE(INDEXED_DATABASE) 181 return RuntimeEnabledFeatures::indexedD atabaseEnabled();181 return RuntimeEnabledFeatures::indexedDBEnabled(); 182 182 #else 183 183 return false;
Note: See TracChangeset
for help on using the changeset viewer.