diff options
author | dglazkov@google.com <dglazkov@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-17 16:12:46 +0000 |
---|---|---|
committer | dglazkov@google.com <dglazkov@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-17 16:12:46 +0000 |
commit | fbee6488266b8740593f87632abc20698e9d1af0 (patch) | |
tree | ca88439681b7524066ea505093eb6964f3c8545b /webkit/port | |
parent | 99773b20f52849656195cac3d563a4fb9c1035ab (diff) | |
download | chromium_src-fbee6488266b8740593f87632abc20698e9d1af0.zip chromium_src-fbee6488266b8740593f87632abc20698e9d1af0.tar.gz chromium_src-fbee6488266b8740593f87632abc20698e9d1af0.tar.bz2 |
Backing out ScriptCallContext
This one: http://codereview.chromium.org/7453
TBR=darin
Review URL: http://codereview.chromium.org/7625
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3532 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/port')
-rw-r--r-- | webkit/port/bindings/v8/ScriptCallContextV8.cpp | 69 | ||||
-rw-r--r-- | webkit/port/bindings/v8/v8_custom.cpp | 22 | ||||
-rw-r--r-- | webkit/port/page/inspector/Console.js | 2 | ||||
-rw-r--r-- | webkit/port/page/inspector/InspectorController.cpp | 56 |
4 files changed, 10 insertions, 139 deletions
diff --git a/webkit/port/bindings/v8/ScriptCallContextV8.cpp b/webkit/port/bindings/v8/ScriptCallContextV8.cpp deleted file mode 100644 index d959fc5..0000000 --- a/webkit/port/bindings/v8/ScriptCallContextV8.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) 2008, 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 "ScriptCallContext.h" - -#include "PlatformString.h" -#include "KURL.h" -#include "v8.h" -#include "v8_binding.h" - -namespace WebCore { - -ScriptCallContext::ScriptCallContext(const v8::Arguments& args) - : m_args(args) -{ -} - -String ScriptCallContext::argumentStringAt(unsigned index, - bool checkForNullOrUndefined) -{ - if (index >= argumentCount()) - return String(); - - return ToWebCoreString(m_args[index]); -} - -unsigned ScriptCallContext::argumentCount() const -{ - return m_args.Length(); -} - -unsigned ScriptCallContext::lineNumber() const -{ - return 0; -} - -KURL ScriptCallContext::sourceURL() const -{ - return KURL(); -} - -} // namespace WebCore diff --git a/webkit/port/bindings/v8/v8_custom.cpp b/webkit/port/bindings/v8/v8_custom.cpp index 1d36ccc..b6ff5f3 100644 --- a/webkit/port/bindings/v8/v8_custom.cpp +++ b/webkit/port/bindings/v8/v8_custom.cpp @@ -97,7 +97,6 @@ #include "RenderPartObject.h" #include "RenderWidget.h" #include "ScheduledAction.h" -#include "ScriptCallContext.h" #include "SecurityOrigin.h" #include "Settings.h" #include "StyleSheetList.h" @@ -2274,17 +2273,14 @@ CALLBACK_FUNC_DECL(ConsoleError) { INC_STATS(L"DOM.Console.error()"); v8::Handle<v8::Value> holder = args.Holder(); Console* imp = V8Proxy::ToNativeObject<Console>(V8ClassIndex::CONSOLE, holder); - ScriptCallContext context(args); - imp->error(&context); + String message = ToWebCoreString(args[0]); + imp->error(message); return v8::Undefined(); } CALLBACK_FUNC_DECL(ConsoleGroup) { INC_STATS(L"DOM.Console.group()"); - v8::Handle<v8::Value> holder = args.Holder(); - Console* imp = V8Proxy::ToNativeObject<Console>(V8ClassIndex::CONSOLE, holder); - ScriptCallContext context(args); - imp->group(&context); + V8Proxy::SetDOMException(NOT_SUPPORTED_ERR); return v8::Undefined(); } @@ -2292,8 +2288,8 @@ CALLBACK_FUNC_DECL(ConsoleInfo) { INC_STATS(L"DOM.Console.info()"); v8::Handle<v8::Value> holder = args.Holder(); Console* imp = V8Proxy::ToNativeObject<Console>(V8ClassIndex::CONSOLE, holder); - ScriptCallContext context(args); - imp->info(&context); + String message = ToWebCoreString(args[0]); + imp->info(message); return v8::Undefined(); } @@ -2301,8 +2297,8 @@ CALLBACK_FUNC_DECL(ConsoleLog) { INC_STATS(L"DOM.Console.log()"); v8::Handle<v8::Value> holder = args.Holder(); Console* imp = V8Proxy::ToNativeObject<Console>(V8ClassIndex::CONSOLE, holder); - ScriptCallContext context(args); - imp->log(&context); + String message = ToWebCoreString(args[0]); + imp->log(message); return v8::Undefined(); } @@ -2328,8 +2324,8 @@ CALLBACK_FUNC_DECL(ConsoleWarn) { INC_STATS(L"DOM.Console.warn()"); v8::Handle<v8::Value> holder = args.Holder(); Console* imp = V8Proxy::ToNativeObject<Console>(V8ClassIndex::CONSOLE, holder); - ScriptCallContext context(args); - imp->warn(&context); + String message = ToWebCoreString(args[0]); + imp->warn(message); return v8::Undefined(); } diff --git a/webkit/port/page/inspector/Console.js b/webkit/port/page/inspector/Console.js index 18e3537..1292531 100644 --- a/webkit/port/page/inspector/Console.js +++ b/webkit/port/page/inspector/Console.js @@ -494,7 +494,7 @@ WebInspector.ConsoleMessage.prototype = { function formatForConsole(obj) { - return WebInspector.console._format(obj, plaintext); + return WebInspector.console._format(obj, plainText); } if (Object.type(parameters[0], InspectorController.inspectedWindow()) === "string") { diff --git a/webkit/port/page/inspector/InspectorController.cpp b/webkit/port/page/inspector/InspectorController.cpp index ede3b0b..7aa0a44 100644 --- a/webkit/port/page/inspector/InspectorController.cpp +++ b/webkit/port/page/inspector/InspectorController.cpp @@ -66,7 +66,6 @@ #include "Range.h" #include "ResourceRequest.h" #include "ResourceResponse.h" -#include "ScriptCallContext.h" #include "ScriptController.h" #include "Settings.h" #include "SharedBuffer.h" @@ -130,39 +129,9 @@ struct ConsoleMessage { , groupLevel(g) { } - - ConsoleMessage(MessageSource s, MessageLevel l, ScriptCallContext* context, unsigned g) - : source(s) - , level(l) -#if USE(JSC) - , wrappedArguments(args.size()) -#endif - , line(context->lineNumber()) - , url(context->sourceURL()) - , groupLevel(g) - { -#if USE(JSC) - JSLock lock(false); - for (unsigned i = 0; i < context->argumentCount(); ++i) - wrappedArguments[i] = JSInspectedObjectWrapper::wrap(context->argumentAt(i)); -#elif USE(V8) - // FIXME: This is not correct. The objects are being converted to - // string and appended to one big message. But it's better than only - // supporting one string argument that we had previously. - for (unsigned i = 0; i < context->argumentCount(); ++i) { - if (i) - message.append(", "); - message.append(context->argumentStringAt(i)); - } -#endif - } - MessageSource source; MessageLevel level; String message; -#if USE(JSC) - Vector<ProtectedPtr<JSValue> > wrappedArguments; -#endif unsigned line; String url; unsigned groupLevel; @@ -783,14 +752,6 @@ void InspectorController::enableTrackResources(bool trackResources) m_resources.clear(); } -void InspectorController::addMessageToConsole(MessageSource source, MessageLevel level, ScriptCallContext* context) -{ - if (!enabled()) - return; - - addConsoleMessage(new ConsoleMessage(source, level, context, m_groupLevel)); -} - void InspectorController::addMessageToConsole(MessageSource source, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceID) { if (!enabled()) @@ -828,23 +789,6 @@ void InspectorController::clearConsoleMessages() m_consoleMessages.clear(); } -void InspectorController::startGroup(MessageSource source, ScriptCallContext* context) -{ - ++m_groupLevel; - - addConsoleMessage(new ConsoleMessage(source, StartGroupMessageLevel, context, m_groupLevel)); -} - -void InspectorController::endGroup(MessageSource source, unsigned lineNumber, const String& sourceURL) -{ - if (m_groupLevel == 0) - return; - - --m_groupLevel; - - addConsoleMessage(new ConsoleMessage(source, EndGroupMessageLevel, String(), lineNumber, sourceURL, m_groupLevel)); -} - void InspectorController::attachWindow() { if (!enabled()) |