diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-30 22:59:34 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-30 22:59:34 +0000 |
commit | 4ea00e8c3830cd4b648d07adbe3328c70f327bf7 (patch) | |
tree | 39f2fe61075b5ed4b6953dc4b89cdc58c6a97bdc | |
parent | 8bacacdf800eb344096c9754ec46e4c1acbd4b4a (diff) | |
download | chromium_src-4ea00e8c3830cd4b648d07adbe3328c70f327bf7.zip chromium_src-4ea00e8c3830cd4b648d07adbe3328c70f327bf7.tar.gz chromium_src-4ea00e8c3830cd4b648d07adbe3328c70f327bf7.tar.bz2 |
Enable the V8 binding's StringImpl cache for renderer processes.
Originally reviewed at: http://codereview.chromium.org/159642
Patch by Anton Muhin
R=darin
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/159666
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22115 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/renderer/render_thread.cc | 2 | ||||
-rw-r--r-- | webkit/api/public/WebKit.h | 7 | ||||
-rw-r--r-- | webkit/api/src/WebKit.cpp | 5 |
3 files changed, 13 insertions, 1 deletions
diff --git a/chrome/renderer/render_thread.cc b/chrome/renderer/render_thread.cc index e9720d6..f56a030 100644 --- a/chrome/renderer/render_thread.cc +++ b/chrome/renderer/render_thread.cc @@ -330,6 +330,8 @@ void RenderThread::EnsureWebKitInitialized() { webkit_client_.reset(new RendererWebKitClientImpl); WebKit::initialize(webkit_client_.get()); + WebKit::enableV8SingleThreadMode(); + // chrome: pages should not be accessible by normal content, and should // also be unable to script anything but themselves (to help limit the damage // that a corrupt chrome: page could cause). diff --git a/webkit/api/public/WebKit.h b/webkit/api/public/WebKit.h index b3302fe..4b5c1a6 100644 --- a/webkit/api/public/WebKit.h +++ b/webkit/api/public/WebKit.h @@ -82,6 +82,12 @@ namespace WebKit { const WebString& schemeRestriction); WEBKIT_API void registerExtension(v8::Extension*, int extensionGroup); + // Enables special settings which are only applicable if V8 is executed + // in the single thread which must be the main thread. + // FIXME: make a try to dynamically detect when this condition is broken + // and automatically switch off single thread mode. + WEBKIT_API void enableV8SingleThreadMode(); + // Process any pending JavaScript console messages. WEBKIT_API void flushConsoleMessages(); @@ -94,7 +100,6 @@ namespace WebKit { // Enables HTML5 database support. WEBKIT_API void enableDatabases(); WEBKIT_API bool databasesEnabled(); - } // namespace WebKit #endif diff --git a/webkit/api/src/WebKit.cpp b/webkit/api/src/WebKit.cpp index f4c327c..8fa42bb 100644 --- a/webkit/api/src/WebKit.cpp +++ b/webkit/api/src/WebKit.cpp @@ -38,6 +38,7 @@ #include "DOMTimer.h" #include "FrameLoader.h" #include "Page.h" +#include "V8Binding.h" #include "V8Proxy.h" #include "WorkerContextExecutionProxy.h" #include <wtf/Assertions.h> @@ -141,5 +142,9 @@ bool databasesEnabled() return s_databasesEnabled; } +void enableV8SingleThreadMode() +{ + WebCore::enableStringImplCache(); +} } // namespace WebKit |