PageRenderTime 28ms CodeModel.GetById 11ms app.highlight 13ms RepoModel.GetById 1ms app.codeStats 0ms

/platform/external/webkit/WebCore/bindings/generic/RuntimeEnabledFeatures.h

https://github.com/aharish/totoro-gb-opensource-update2
C Header | 94 lines | 44 code | 17 blank | 33 comment | 0 complexity | 7406e4eb278410bf36a3b9cd7d424527 MD5 | raw file
 1/*
 2 * Copyright (C) 2009 Google Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions are
 6 * met:
 7 *
 8 *     * Redistributions of source code must retain the above copyright
 9 * notice, this list of conditions and the following disclaimer.
10 *     * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following disclaimer
12 * in the documentation and/or other materials provided with the
13 * distribution.
14 *     * Neither the name of Google Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31#ifndef RuntimeEnabledFeatures_h
32#define RuntimeEnabledFeatures_h
33
34namespace WebCore {
35
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
40class RuntimeEnabledFeatures {
41public:
42    static void setLocalStorageEnabled(bool isEnabled) { isLocalStorageEnabled = isEnabled; }
43    static bool localStorageEnabled() { return isLocalStorageEnabled; }
44
45    static void setSessionStorageEnabled(bool isEnabled) { isSessionStorageEnabled = isEnabled; }
46    static bool sessionStorageEnabled() { return isSessionStorageEnabled; }
47
48    static void setWebkitNotificationsEnabled(bool isEnabled) { isWebkitNotificationsEnabled = isEnabled; }
49    static bool webkitNotificationsEnabled() { return isWebkitNotificationsEnabled; }
50
51    static void setApplicationCacheEnabled(bool isEnabled) { isApplicationCacheEnabled = isEnabled; }
52    static bool applicationCacheEnabled() { return isApplicationCacheEnabled; }
53
54    static void setGeolocationEnabled(bool isEnabled) { isGeolocationEnabled = isEnabled; }
55    static bool geolocationEnabled() { return isGeolocationEnabled; }
56
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
79
80private:
81    // Never instantiate.
82    RuntimeEnabledFeatures() { }
83
84    static bool isLocalStorageEnabled;
85    static bool isSessionStorageEnabled;
86    static bool isWebkitNotificationsEnabled;
87    static bool isApplicationCacheEnabled;
88    static bool isGeolocationEnabled;
89    static bool isIndexedDBEnabled;
90};
91
92} // namespace WebCore
93
94#endif // RuntimeEnabledFeatures_h