From 06533c0b11ce14b45eb0205fdc28a217eeba763c Mon Sep 17 00:00:00 2001 From: "asargent@chromium.org" Date: Thu, 5 Mar 2009 21:39:11 +0000 Subject: Refactor v8 extensions so that they aren't in the WebCore namespace, and can call functions in the rest of Chromium code without having to go through ChromiumBridge (which now lives upstream in the WebKit repository). R=darin,mbelshe Review URL: http://codereview.chromium.org/40132 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11040 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/renderer/render_thread.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'chrome/renderer/render_thread.cc') diff --git a/chrome/renderer/render_thread.cc b/chrome/renderer/render_thread.cc index f244092..f2eed65 100644 --- a/chrome/renderer/render_thread.cc +++ b/chrome/renderer/render_thread.cc @@ -12,8 +12,10 @@ #include "chrome/renderer/render_thread.h" +#include "base/command_line.h" #include "base/shared_memory.h" #include "chrome/common/chrome_plugin_lib.h" +#include "chrome/common/chrome_switches.h" #include "chrome/common/render_messages.h" #include "chrome/common/notification_service.h" #include "chrome/common/url_constants.h" @@ -33,6 +35,9 @@ #include "chrome/renderer/renderer_webkitclient_impl.h" #include "chrome/renderer/user_script_slave.h" #include "chrome/renderer/visitedlink_slave.h" +#include "webkit/extensions/v8/gears_extension.h" +#include "webkit/extensions/v8/interval_extension.h" +#include "webkit/extensions/v8/playback_extension.h" #include "webkit/glue/cache_manager.h" #include "WebKit.h" @@ -244,4 +249,12 @@ void RenderThread::EnsureWebKitInitialized() { webkit_client_.reset(new RendererWebKitClientImpl); WebKit::initialize(webkit_client_.get()); WebKit::registerURLSchemeAsLocal(ASCIIToUTF16(chrome::kChromeUIScheme)); + WebKit::registerExtension(extensions_v8::GearsExtension::Get()); + WebKit::registerExtension(extensions_v8::IntervalExtension::Get()); + + const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + if (command_line.HasSwitch(switches::kPlaybackMode) || + command_line.HasSwitch(switches::kRecordMode)) { + WebKit::registerExtension(extensions_v8::PlaybackExtension::Get()); + } } -- cgit v1.1