Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: webkit/api/src/WebKit.cpp

Issue 343001: Move various runtime enabled experiments into a WebExperiments class.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 29 matching lines...) Expand all
40 #include "TextEncoding.h" 40 #include "TextEncoding.h"
41 #include "WebSocket.h" 41 #include "WebSocket.h"
42 #include "WorkerContextExecutionProxy.h" 42 #include "WorkerContextExecutionProxy.h"
43 #include <wtf/Assertions.h> 43 #include <wtf/Assertions.h>
44 #include <wtf/Threading.h> 44 #include <wtf/Threading.h>
45 45
46 namespace WebKit { 46 namespace WebKit {
47 47
48 static WebKitClient* s_webKitClient = 0; 48 static WebKitClient* s_webKitClient = 0;
49 static bool s_layoutTestMode = false; 49 static bool s_layoutTestMode = false;
50 static bool s_databasesEnabled = false;
51 50
52 void initialize(WebKitClient* webKitClient) 51 void initialize(WebKitClient* webKitClient)
53 { 52 {
54 ASSERT(webKitClient); 53 ASSERT(webKitClient);
55 ASSERT(!s_webKitClient); 54 ASSERT(!s_webKitClient);
56 s_webKitClient = webKitClient; 55 s_webKitClient = webKitClient;
57 56
58 WTF::initializeThreading(); 57 WTF::initializeThreading();
59 WebCore::AtomicString::init(); 58 WebCore::AtomicString::init();
60 59
(...skipping 27 matching lines...) Expand all
88 void setLayoutTestMode(bool value) 87 void setLayoutTestMode(bool value)
89 { 88 {
90 s_layoutTestMode = value; 89 s_layoutTestMode = value;
91 } 90 }
92 91
93 bool layoutTestMode() 92 bool layoutTestMode()
94 { 93 {
95 return s_layoutTestMode; 94 return s_layoutTestMode;
96 } 95 }
97 96
98 void enableMediaPlayer()
99 {
100 #if ENABLE(VIDEO)
101 WebMediaPlayerClientImpl::setIsEnabled(true);
102 #endif
103 }
104
105 void resetPluginCache(bool reloadPages) 97 void resetPluginCache(bool reloadPages)
106 { 98 {
107 WebCore::Page::refreshPlugins(reloadPages); 99 WebCore::Page::refreshPlugins(reloadPages);
108 } 100 }
109 101
110 void enableDatabases()
111 {
112 #if ENABLE(DATABASE)
113 s_databasesEnabled = true;
114 WebCore::RuntimeEnabledFeatures::setDatabaseEnabled(true);
115 #endif
116 }
117
118 bool databasesEnabled()
119 {
120 return s_databasesEnabled;
121 }
122
123 void enableWebSockets()
124 {
125 #if ENABLE(WEB_SOCKETS)
126 WebCore::WebSocket::setIsAvailable(true);
127 #endif
128 }
129
130 bool webSocketsEnabled()
131 {
132 #if ENABLE(WEB_SOCKETS)
133 return WebCore::WebSocket::isAvailable();
134 #else
135 return false;
136 #endif
137 }
138
139 } // namespace WebKit 102 } // namespace WebKit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698