diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-31 03:44:35 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-31 03:44:35 +0000 |
commit | a5e2f667cecad6a1eea2b0ac51498d322b57db3d (patch) | |
tree | 139f216ae764437895368bd4e0b9d8bf3ae784f2 | |
parent | b3e2fad0a13695466c07ce4c982fa98448e407a0 (diff) | |
download | chromium_src-a5e2f667cecad6a1eea2b0ac51498d322b57db3d.zip chromium_src-a5e2f667cecad6a1eea2b0ac51498d322b57db3d.tar.gz chromium_src-a5e2f667cecad6a1eea2b0ac51498d322b57db3d.tar.bz2 |
Fix the JSC build.
This involved fixing up vcproj files and making some KJS -> JSC changes. I also had to fix some issues related to ScriptCallContext.
I had to create a ScriptControllerChromium.cpp for the JSC build to provide an implementation of createScriptInstanceForWidget that knows how to talk to our plugin implementation. This file belongs in bindings/js alongside files like ScriptControllerWin.cpp, so I created webkit/port/bindings/js to house it.
R=dglazkov,ojan
Review URL: http://codereview.chromium.org/8947
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4269 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | DEPS | 2 | ||||
-rw-r--r-- | webkit/build/JavaScriptCore/JavaScriptCore.vcproj | 36 | ||||
-rw-r--r-- | webkit/build/JavaScriptCore/JavaScriptCore_pcre.vcproj | 4 | ||||
-rw-r--r-- | webkit/build/KJSBindings/KJSBindings.vcproj | 128 | ||||
-rw-r--r-- | webkit/glue/cpp_bound_class.cc | 2 | ||||
-rw-r--r-- | webkit/glue/npruntime_util.cc | 2 | ||||
-rw-r--r-- | webkit/glue/webframe_impl.cc | 14 | ||||
-rw-r--r-- | webkit/pending/ExceptionContext.h | 8 | ||||
-rw-r--r-- | webkit/port/bindings/js/ScriptControllerChromium.cpp | 70 | ||||
-rw-r--r-- | webkit/port/page/inspector/InspectorController.cpp | 10 |
10 files changed, 213 insertions, 63 deletions
@@ -12,7 +12,7 @@ deps = { "http://googletest.googlecode.com/svn/trunk@63", "src/third_party/WebKit": - "/trunk/deps/third_party/WebKit@4245", + "/trunk/deps/third_party/WebKit@4268", "src/third_party/icu38": "/trunk/deps/third_party/icu38@4040", diff --git a/webkit/build/JavaScriptCore/JavaScriptCore.vcproj b/webkit/build/JavaScriptCore/JavaScriptCore.vcproj index 9b31faa..2c7e76d 100644 --- a/webkit/build/JavaScriptCore/JavaScriptCore.vcproj +++ b/webkit/build/JavaScriptCore/JavaScriptCore.vcproj @@ -361,14 +361,6 @@ > </File> <File - RelativePath="..\..\..\third_party\WebKit\JavaScriptCore\kjs\IndexToNameMap.cpp" - > - </File> - <File - RelativePath="..\..\..\third_party\WebKit\JavaScriptCore\kjs\IndexToNameMap.h" - > - </File> - <File RelativePath="..\..\..\third_party\WebKit\JavaScriptCore\kjs\InitializeThreading.cpp" > </File> @@ -1025,6 +1017,14 @@ > </File> <File + RelativePath="..\..\..\third_party\WebKit\JavaScriptCore\VM\CTI.cpp" + > + </File> + <File + RelativePath="..\..\..\third_party\WebKit\JavaScriptCore\VM\CTI.h" + > + </File> + <File RelativePath="..\..\..\third_party\WebKit\JavaScriptCore\VM\ExceptionHelpers.cpp" > </File> @@ -1093,6 +1093,26 @@ > </File> </Filter> + <Filter + Name="wrec" + > + <File + RelativePath="..\..\..\third_party\WebKit\JavaScriptCore\wrec\CharacterClassConstructor.cpp" + > + </File> + <File + RelativePath="..\..\..\third_party\WebKit\JavaScriptCore\wrec\CharacterClassConstructor.h" + > + </File> + <File + RelativePath="..\..\..\third_party\WebKit\JavaScriptCore\wrec\WREC.cpp" + > + </File> + <File + RelativePath="..\..\..\third_party\WebKit\JavaScriptCore\wrec\WREC.h" + > + </File> + </Filter> <File RelativePath="..\precompiled_webkit.cc" > diff --git a/webkit/build/JavaScriptCore/JavaScriptCore_pcre.vcproj b/webkit/build/JavaScriptCore/JavaScriptCore_pcre.vcproj index 78721ce..a46a3f3 100644 --- a/webkit/build/JavaScriptCore/JavaScriptCore_pcre.vcproj +++ b/webkit/build/JavaScriptCore/JavaScriptCore_pcre.vcproj @@ -142,10 +142,6 @@ > </File> <File - RelativePath="..\..\..\third_party\WebKit\JavaScriptCore\pcre\pcre_tables.cpp" - > - </File> - <File RelativePath="..\..\..\third_party\WebKit\JavaScriptCore\pcre\pcre_ucp_searchfuncs.cpp" > </File> diff --git a/webkit/build/KJSBindings/KJSBindings.vcproj b/webkit/build/KJSBindings/KJSBindings.vcproj index 9483d81..86fa623 100644 --- a/webkit/build/KJSBindings/KJSBindings.vcproj +++ b/webkit/build/KJSBindings/KJSBindings.vcproj @@ -477,6 +477,14 @@ > </File> <File + RelativePath="$(IntDir)\DerivedSources\JSEventTargetNode.cpp" + > + </File> + <File + RelativePath="$(IntDir)\DerivedSources\JSEventTargetNode.h" + > + </File> + <File RelativePath="$(IntDir)\DerivedSources\JSFile.cpp" > </File> @@ -1029,6 +1037,10 @@ > </File> <File + RelativePath="$(IntDir)\DerivedSources\JSKeyboardEvent.cpp" + > + </File> + <File RelativePath="$(IntDir)\DerivedSources\JSKeyboardEvent.h" > </File> @@ -1057,6 +1069,14 @@ > </File> <File + RelativePath="$(IntDir)\DerivedSources\JSMessageChannel.cpp" + > + </File> + <File + RelativePath="$(IntDir)\DerivedSources\JSMessageChannel.h" + > + </File> + <File RelativePath="$(IntDir)\DerivedSources\JSMessageEvent.cpp" > </File> @@ -1065,6 +1085,14 @@ > </File> <File + RelativePath="$(IntDir)\DerivedSources\JSMessagePort.cpp" + > + </File> + <File + RelativePath="$(IntDir)\DerivedSources\JSMessagePort.h" + > + </File> + <File RelativePath="$(IntDir)\DerivedSources\JSMimeType.cpp" > </File> @@ -2521,11 +2549,11 @@ > </File> <File - RelativePath="$(IntDir)\DerivedSources\UserAgentStyleSheetsData.cpp" + RelativePath="$(IntDir)\DerivedSources\UserAgentStyleSheets.h" > </File> <File - RelativePath="$(IntDir)\DerivedSources\UserAgentStyleSheets.h" + RelativePath="$(IntDir)\DerivedSources\UserAgentStyleSheetsData.cpp" > </File> <File @@ -2562,22 +2590,54 @@ </File> </Filter> <Filter - Name="page" + Name="inspector" > <File - RelativePath="..\..\..\third_party\WebKit\WebCore\page\JavaScriptProfile.cpp" + RelativePath="..\..\..\third_party\WebKit\WebCore\inspector\InspectorClient.h" + > + </File> + <File + RelativePath="..\..\..\third_party\WebKit\WebCore\inspector\InspectorController.cpp" + > + </File> + <File + RelativePath="..\..\..\third_party\WebKit\WebCore\inspector\InspectorController.h" + > + </File> + <File + RelativePath="..\..\..\third_party\WebKit\WebCore\inspector\JavaScriptCallFrame.cpp" + > + </File> + <File + RelativePath="..\..\..\third_party\WebKit\WebCore\inspector\JavaScriptCallFrame.h" + > + </File> + <File + RelativePath="..\..\..\third_party\WebKit\WebCore\inspector\JavaScriptDebugListener.h" + > + </File> + <File + RelativePath="..\..\..\third_party\WebKit\WebCore\inspector\JavaScriptDebugServer.cpp" + > + </File> + <File + RelativePath="..\..\..\third_party\WebKit\WebCore\inspector\JavaScriptDebugServer.h" + > + </File> + <File + RelativePath="..\..\..\third_party\WebKit\WebCore\inspector\JavaScriptProfile.cpp" > </File> <File - RelativePath="..\..\..\third_party\WebKit\WebCore\page\JavaScriptProfile.h" + RelativePath="..\..\..\third_party\WebKit\WebCore\inspector\JavaScriptProfile.h" > </File> <File - RelativePath="..\..\..\third_party\WebKit\WebCore\page\JavaScriptProfileNode.cpp" + RelativePath="..\..\..\third_party\WebKit\WebCore\inspector\JavaScriptProfileNode.cpp" > </File> <File - RelativePath="..\..\..\third_party\WebKit\WebCore\page\JavaScriptProfileNode.h" + RelativePath="..\..\..\third_party\WebKit\WebCore\inspector\JavaScriptProfileNode.h" > </File> </Filter> @@ -2722,10 +2782,6 @@ > </File> <File - RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\js\JSCanvasPixelArrayCustom.cpp" - > - </File> - <File RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\js\JSCanvasRenderingContext2DCustom.cpp" > </File> @@ -2858,23 +2914,23 @@ > </File> <File - RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\js\JSEventTargetBase.cpp" + RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\js\JSEventTarget.cpp" > </File> <File - RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\js\JSEventTargetBase.h" + RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\js\JSEventTarget.h" > </File> <File - RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\js\JSEventTargetNode.cpp" + RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\js\JSEventTargetNodeCustom.cpp" > </File> <File - RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\js\JSEventTargetNode.h" + RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\js\JSHistoryCustom.cpp" > </File> <File - RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\js\JSHistoryCustom.cpp" + RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\js\JSHTMLAllCollection.cpp" > </File> <File @@ -2918,11 +2974,11 @@ > </File> <File - RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\js\JSHTMLInputElementBase.cpp" + RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\js\JSHTMLInputElementCustom.cpp" > </File> <File - RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\js\JSHTMLInputElementBase.h" + RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\js\JSHTMLInputElementCustom.h" > </File> <File @@ -2958,6 +3014,10 @@ > </File> <File + RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\js\JSImageDataCustom.cpp" + > + </File> + <File RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\js\JSInspectedObjectWrapper.cpp" > </File> @@ -2978,6 +3038,22 @@ > </File> <File + RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\js\JSMessageChannelConstructor.cpp" + > + </File> + <File + RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\js\JSMessageChannelConstructor.h" + > + </File> + <File + RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\js\JSMessageChannelCustom.cpp" + > + </File> + <File + RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\js\JSMessagePortCustom.cpp" + > + </File> + <File RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\js\JSMimeTypeArrayCustom.cpp" > </File> @@ -3022,14 +3098,6 @@ > </File> <File - RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\js\JSNSResolver.cpp" - > - </File> - <File - RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\js\JSNSResolver.h" - > - </File> - <File RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\js\JSPluginArrayCustom.cpp" > </File> @@ -3070,11 +3138,7 @@ > </File> <File - RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\js\JSSVGLazyEventListener.cpp" - > - </File> - <File - RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\js\JSSVGLazyEventListener.h" + RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\js\JSSVGElementInstanceCustom.cpp" > </File> <File @@ -3194,7 +3258,7 @@ > </File> <File - RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\js\ScriptControllerWin.cpp" + RelativePath="..\..\port\bindings\js\ScriptControllerChromium.cpp" > </File> <File diff --git a/webkit/glue/cpp_bound_class.cc b/webkit/glue/cpp_bound_class.cc index fa97eb6..95d67c0 100644 --- a/webkit/glue/cpp_bound_class.cc +++ b/webkit/glue/cpp_bound_class.cc @@ -240,7 +240,7 @@ bool CppBoundClass::IsMethodRegistered(std::string name) { void CppBoundClass::BindToJavascript(WebFrame* frame, const std::wstring& classname) { #if USE(JSC) - KJS::JSLock lock(false); + JSC::JSLock lock(false); #endif // Create an NPObject using our static NPClass. The first argument (a diff --git a/webkit/glue/npruntime_util.cc b/webkit/glue/npruntime_util.cc index cdfd1ac..364401f 100644 --- a/webkit/glue/npruntime_util.cc +++ b/webkit/glue/npruntime_util.cc @@ -11,7 +11,7 @@ #include "webkit/port/bindings/v8/np_v8object.h" #elif USE(JAVASCRIPTCORE_BINDINGS) #include "bridge/c/c_utility.h" -using KJS::Bindings::PrivateIdentifier; +using JSC::Bindings::PrivateIdentifier; #endif #include "base/pickle.h" diff --git a/webkit/glue/webframe_impl.cc b/webkit/glue/webframe_impl.cc index 8875057..eb1d1b4 100644 --- a/webkit/glue/webframe_impl.cc +++ b/webkit/glue/webframe_impl.cc @@ -715,14 +715,14 @@ void WebFrameImpl::BindToWindowObject(const std::wstring& name, #endif #if USE(JSC) - KJS::JSGlobalObject* window = frame_->script()->globalObject(); - KJS::ExecState* exec = window->globalExec(); - KJS::Bindings::RootObject* root = frame_->script()->bindingRootObject(); + JSC::JSGlobalObject* window = frame_->script()->globalObject(); + JSC::ExecState* exec = window->globalExec(); + JSC::Bindings::RootObject* root = frame_->script()->bindingRootObject(); ASSERT(exec); - KJS::RuntimeObjectImp* instance = KJS::Bindings::Instance::createRuntimeObject( - exec, KJS::Bindings::CInstance::create(object, root)); - KJS::Identifier id(exec, key.latin1().data()); - KJS::PutPropertySlot slot; + JSC::RuntimeObjectImp* instance = JSC::Bindings::Instance::createRuntimeObject( + exec, JSC::Bindings::CInstance::create(object, root)); + JSC::Identifier id(exec, key.latin1().data()); + JSC::PutPropertySlot slot; window->put(exec, id, instance, slot); #endif } diff --git a/webkit/pending/ExceptionContext.h b/webkit/pending/ExceptionContext.h index 529b8f3..f9914dc 100644 --- a/webkit/pending/ExceptionContext.h +++ b/webkit/pending/ExceptionContext.h @@ -36,7 +36,7 @@ #include "ScriptController.h" #if USE(JSC) -namespace KJS { +namespace JSC { class ExecState; } #endif @@ -58,8 +58,8 @@ public: #if USE(V8) ExceptionContext(); #elif USE(JSC) - ExceptionContext(KJS::ExecState* exec) : m_exec(exec) {} - KJS::ExecState* exec() const { return m_exec; } + ExceptionContext(JSC::ExecState* exec) : m_exec(exec) {} + JSC::ExecState* exec() const { return m_exec; } #endif ~ExceptionContext() {} @@ -77,7 +77,7 @@ private: JSException m_exception; ExceptionCatcher* m_exceptionCatcher; #elif USE(JSC) - KJS::ExecState* m_exec; + JSC::ExecState* m_exec; #endif }; diff --git a/webkit/port/bindings/js/ScriptControllerChromium.cpp b/webkit/port/bindings/js/ScriptControllerChromium.cpp new file mode 100644 index 0000000..cb6ed97 --- /dev/null +++ b/webkit/port/bindings/js/ScriptControllerChromium.cpp @@ -0,0 +1,70 @@ +// 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 "ScriptController.h" + +#include "bindings/npruntime.h" +#include "c_instance.h" + +#undef LOG // glue defines its own LOG macro +#include "webkit/glue/webplugin_impl.h" + +namespace WebCore { + +JSInstanceHandle ScriptController::createScriptInstanceForWidget(Widget* widget) +{ + ASSERT(widget != 0); + + if (widget->isFrameView()) + return JSInstanceHolder::EmptyInstance(); + + // Note: We have to trust that the widget passed to us here + // is a WebPluginImpl. There isn't a way to dynamically verify + // it, since the derived class (Widget) has no identifier. + WebPluginContainer* container = static_cast<WebPluginContainer*>(widget); + if (!container) + return JSInstanceHolder::EmptyInstance(); + + NPObject* npObject = container->GetPluginScriptableObject(); + if (!npObject) + return JSInstanceHolder::EmptyInstance(); + + // Register 'widget' with the frame so that we can teardown + // subobjects when the container goes away. + RefPtr<JSC::Bindings::RootObject> root = createRootObject(widget); + RefPtr<JSC::Bindings::Instance> instance = + JSC::Bindings::CInstance::create(npObject, root.release()); + // GetPluginScriptableObject returns a retained NPObject. + // The caller is expected to release it. + NPN_ReleaseObject(npObject); + return instance.release(); +} + +} // namespace WebCpre diff --git a/webkit/port/page/inspector/InspectorController.cpp b/webkit/port/page/inspector/InspectorController.cpp index f18a6bb..43f41ae 100644 --- a/webkit/port/page/inspector/InspectorController.cpp +++ b/webkit/port/page/inspector/InspectorController.cpp @@ -799,7 +799,7 @@ void InspectorController::addMessageToConsole(MessageSource source, MessageLevel if (!enabled()) return; - addConsoleMessage(new ConsoleMessage(source, level, context, m_groupLevel)); + addConsoleMessage(context, new ConsoleMessage(source, level, context, m_groupLevel)); } void InspectorController::addMessageToConsole(MessageSource source, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceID) @@ -807,10 +807,10 @@ void InspectorController::addMessageToConsole(MessageSource source, MessageLevel if (!enabled()) return; - addConsoleMessage(new ConsoleMessage(source, level, message, lineNumber, sourceID, m_groupLevel)); + addConsoleMessage(0, new ConsoleMessage(source, level, message, lineNumber, sourceID, m_groupLevel)); } -void InspectorController::addConsoleMessage(ConsoleMessage* consoleMessage) +void InspectorController::addConsoleMessage(ScriptCallContext* context, ConsoleMessage* consoleMessage) { ASSERT(enabled()); ASSERT_ARG(consoleMessage, consoleMessage); @@ -843,7 +843,7 @@ void InspectorController::startGroup(MessageSource source, ScriptCallContext* co { ++m_groupLevel; - addConsoleMessage(new ConsoleMessage(source, StartGroupMessageLevel, context, m_groupLevel)); + addConsoleMessage(context, new ConsoleMessage(source, StartGroupMessageLevel, context, m_groupLevel)); } void InspectorController::endGroup(MessageSource source, unsigned lineNumber, const String& sourceURL) @@ -853,7 +853,7 @@ void InspectorController::endGroup(MessageSource source, unsigned lineNumber, co --m_groupLevel; - addConsoleMessage(new ConsoleMessage(source, EndGroupMessageLevel, String(), lineNumber, sourceURL, m_groupLevel)); + addConsoleMessage(0, new ConsoleMessage(source, EndGroupMessageLevel, String(), lineNumber, sourceURL, m_groupLevel)); } void InspectorController::attachWindow() |