summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-16 00:32:58 +0000
committertony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-16 00:32:58 +0000
commitab2f385b72bccefe92550bb8625bb7583c693653 (patch)
treece59c3e6cc3e8115c2c9862be87f27a3926dabc4
parent9566343c2165c5823b33932ec836c58953ea4ecb (diff)
downloadchromium_src-ab2f385b72bccefe92550bb8625bb7583c693653.zip
chromium_src-ab2f385b72bccefe92550bb8625bb7583c693653.tar.gz
chromium_src-ab2f385b72bccefe92550bb8625bb7583c693653.tar.bz2
Revert "Move scripting / v8 related methods out of WebKit.h"
This reverts commit r29218. TBR=mhm Review URL: http://codereview.chromium.org/283004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29225 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/renderer/render_thread.cc1
-rw-r--r--chrome/test/render_view_test.cc1
-rw-r--r--webkit/api/public/WebKit.h26
-rw-r--r--webkit/api/public/WebScriptController.h67
-rw-r--r--webkit/api/src/WebKit.cpp28
-rw-r--r--webkit/api/src/WebScriptController.cpp67
-rw-r--r--webkit/tools/test_shell/test_shell.cc1
-rw-r--r--webkit/tools/test_shell/test_shell_main.cc1
-rw-r--r--webkit/tools/test_shell/test_shell_webkit_init.h1
9 files changed, 54 insertions, 139 deletions
diff --git a/chrome/renderer/render_thread.cc b/chrome/renderer/render_thread.cc
index bf6e3ac..268d0b4 100644
--- a/chrome/renderer/render_thread.cc
+++ b/chrome/renderer/render_thread.cc
@@ -51,7 +51,6 @@
#include "webkit/api/public/WebFontCache.h"
#include "webkit/api/public/WebColor.h"
#include "webkit/api/public/WebKit.h"
-#include "webkit/api/public/WebScriptController.h"
#include "webkit/api/public/WebStorageEventDispatcher.h"
#include "webkit/api/public/WebString.h"
#include "webkit/extensions/v8/benchmarking_extension.h"
diff --git a/chrome/test/render_view_test.cc b/chrome/test/render_view_test.cc
index 8dac8c0..54fde06 100644
--- a/chrome/test/render_view_test.cc
+++ b/chrome/test/render_view_test.cc
@@ -17,7 +17,6 @@
#include "webkit/api/public/WebFrame.h"
#include "webkit/api/public/WebInputEvent.h"
#include "webkit/api/public/WebKit.h"
-#include "webkit/api/public/WebScriptController.h"
#include "webkit/api/public/WebScriptSource.h"
#include "webkit/api/public/WebURLRequest.h"
#include "webkit/glue/webview.h"
diff --git a/webkit/api/public/WebKit.h b/webkit/api/public/WebKit.h
index d6d3e11..93c8625 100644
--- a/webkit/api/public/WebKit.h
+++ b/webkit/api/public/WebKit.h
@@ -34,6 +34,10 @@
#include "WebCommon.h"
#include "WebURL.h"
+namespace v8 {
+ class Extension;
+}
+
namespace WebKit {
class WebKitClient;
class WebString;
@@ -66,6 +70,28 @@ namespace WebKit {
// any other URL scheme.
WEBKIT_API void registerURLSchemeAsNoAccess(const WebString&);
+ // Registers a v8 extension to be available on webpages. The three forms
+ // offer various restrictions on what types of contexts the extension is
+ // loaded into. If a scheme is provided, only pages whose URL has the given
+ // scheme will match. If extensionGroup is provided, the extension will only
+ // be loaded into scripts run via WebFrame::ExecuteInNewWorld with the
+ // matching group.
+ // Will only affect v8 contexts initialized after this call. Takes ownership
+ // of the v8::Extension object passed.
+ WEBKIT_API void registerExtension(v8::Extension*);
+ WEBKIT_API void registerExtension(v8::Extension*,
+ 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();
+
// Enables HTML5 media support.
WEBKIT_API void enableMediaPlayer();
diff --git a/webkit/api/public/WebScriptController.h b/webkit/api/public/WebScriptController.h
deleted file mode 100644
index afed9be..0000000
--- a/webkit/api/public/WebScriptController.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (C) 2009 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef WebScriptController_h
-#define WebScriptController_h
-
-#include "WebCommon.h"
-
-namespace v8 {
- class Extension;
-}
-
-namespace WebKit {
- class WebString;
-
- // Registers a v8 extension to be available on webpages. The three forms
- // offer various restrictions on what types of contexts the extension is
- // loaded into. If a scheme is provided, only pages whose URL has the given
- // scheme will match. If extensionGroup is provided, the extension will only
- // be loaded into scripts run via WebFrame::ExecuteInNewWorld with the
- // matching group.
- // Will only affect v8 contexts initialized after this call. Takes ownership
- // of the v8::Extension object passed.
- WEBKIT_API void registerExtension(v8::Extension*);
- WEBKIT_API void registerExtension(v8::Extension*,
- 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();
-
-} // namespace WebKit
-
-#endif
diff --git a/webkit/api/src/WebKit.cpp b/webkit/api/src/WebKit.cpp
index 43937e5..877e5c9 100644
--- a/webkit/api/src/WebKit.cpp
+++ b/webkit/api/src/WebKit.cpp
@@ -39,6 +39,8 @@
#include "FrameLoader.h"
#include "Page.h"
#include "TextEncoding.h"
+#include "V8Binding.h"
+#include "V8Proxy.h"
#include "WorkerContextExecutionProxy.h"
#include <wtf/Assertions.h>
#include <wtf/Threading.h>
@@ -105,6 +107,27 @@ void registerURLSchemeAsNoAccess(const WebString& scheme)
WebCore::SecurityOrigin::registerURLSchemeAsNoAccess(scheme);
}
+void registerExtension(v8::Extension* extension)
+{
+ WebCore::V8Proxy::registerExtension(extension, WebString());
+}
+
+void registerExtension(v8::Extension* extension,
+ const WebString& schemeRestriction)
+{
+ WebCore::V8Proxy::registerExtension(extension, schemeRestriction);
+}
+
+void registerExtension(v8::Extension* extension, int extensionGroup)
+{
+ WebCore::V8Proxy::registerExtension(extension, extensionGroup);
+}
+
+void flushConsoleMessages()
+{
+ WebCore::V8Proxy::processConsoleMessages();
+}
+
void enableMediaPlayer()
{
#if ENABLE(VIDEO)
@@ -129,6 +152,11 @@ bool databasesEnabled()
return s_databasesEnabled;
}
+void enableV8SingleThreadMode()
+{
+ WebCore::enableStringImplCache();
+}
+
void whiteListAccessFromOrigin(const WebURL& sourceOrigin,
const WebString& destinationProtocol,
const WebString& destinationHost,
diff --git a/webkit/api/src/WebScriptController.cpp b/webkit/api/src/WebScriptController.cpp
deleted file mode 100644
index 4282030..0000000
--- a/webkit/api/src/WebScriptController.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (C) 2009 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "WebScriptController.h"
-
-#include "WebString.h"
-
-#include "V8Binding.h"
-#include "V8Proxy.h"
-
-namespace WebKit {
-
-void registerExtension(v8::Extension* extension)
-{
- WebCore::V8Proxy::registerExtension(extension, WebString());
-}
-
-void registerExtension(v8::Extension* extension,
- const WebString& schemeRestriction)
-{
- WebCore::V8Proxy::registerExtension(extension, schemeRestriction);
-}
-
-void registerExtension(v8::Extension* extension, int extensionGroup)
-{
- WebCore::V8Proxy::registerExtension(extension, extensionGroup);
-}
-
-void enableV8SingleThreadMode()
-{
- WebCore::enableStringImplCache();
-}
-
-void flushConsoleMessages()
-{
- WebCore::V8Proxy::processConsoleMessages();
-}
-
-} // namespace WebKit
diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc
index e6dad8a..d18d2e2 100644
--- a/webkit/tools/test_shell/test_shell.cc
+++ b/webkit/tools/test_shell/test_shell.cc
@@ -34,7 +34,6 @@
#include "webkit/api/public/WebAccessibilityObject.h"
#include "webkit/api/public/WebFrame.h"
#include "webkit/api/public/WebKit.h"
-#include "webkit/api/public/WebScriptController.h"
#include "webkit/api/public/WebRect.h"
#include "webkit/api/public/WebSize.h"
#include "webkit/api/public/WebString.h"
diff --git a/webkit/tools/test_shell/test_shell_main.cc b/webkit/tools/test_shell/test_shell_main.cc
index 8b716b1..b00a348 100644
--- a/webkit/tools/test_shell/test_shell_main.cc
+++ b/webkit/tools/test_shell/test_shell_main.cc
@@ -25,7 +25,6 @@
#include "net/socket/ssl_test_util.h"
#include "net/url_request/url_request_context.h"
#include "webkit/api/public/WebKit.h"
-#include "webkit/api/public/WebScriptController.h"
#include "webkit/glue/webkit_glue.h"
#include "webkit/glue/window_open_disposition.h"
#include "webkit/extensions/v8/gc_extension.h"
diff --git a/webkit/tools/test_shell/test_shell_webkit_init.h b/webkit/tools/test_shell/test_shell_webkit_init.h
index 4bcc74b..a2b20a6 100644
--- a/webkit/tools/test_shell/test_shell_webkit_init.h
+++ b/webkit/tools/test_shell/test_shell_webkit_init.h
@@ -13,7 +13,6 @@
#include "media/base/media.h"
#include "webkit/api/public/WebData.h"
#include "webkit/api/public/WebKit.h"
-#include "webkit/api/public/WebScriptController.h"
#include "webkit/api/public/WebStorageArea.h"
#include "webkit/api/public/WebStorageEventDispatcher.h"
#include "webkit/api/public/WebStorageNamespace.h"