summaryrefslogtreecommitdiff
path: root/Source/WebCore/inspector/CommandLineAPIModule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/inspector/CommandLineAPIModule.cpp')
-rw-r--r--Source/WebCore/inspector/CommandLineAPIModule.cpp30
1 files changed, 14 insertions, 16 deletions
diff --git a/Source/WebCore/inspector/CommandLineAPIModule.cpp b/Source/WebCore/inspector/CommandLineAPIModule.cpp
index 90af6503f..e66ae8620 100644
--- a/Source/WebCore/inspector/CommandLineAPIModule.cpp
+++ b/Source/WebCore/inspector/CommandLineAPIModule.cpp
@@ -26,11 +26,10 @@
#include "config.h"
#include "CommandLineAPIModule.h"
-#if ENABLE(INSPECTOR)
-
#include "CommandLineAPIModuleSource.h"
-#include "JSCommandLineAPIHost.h"
-#include "PageInjectedScriptManager.h"
+#include "JSDOMGlobalObject.h"
+#include "WebInjectedScriptManager.h"
+#include <heap/HeapInlines.h>
#include <inspector/InjectedScript.h>
using namespace JSC;
@@ -38,31 +37,30 @@ using namespace Inspector;
namespace WebCore {
-CommandLineAPIModule::CommandLineAPIModule()
- : InjectedScriptModule(ASCIILiteral("CommandLineAPI"))
+void CommandLineAPIModule::injectIfNeeded(InjectedScriptManager* injectedScriptManager, const InjectedScript& injectedScript)
{
+ CommandLineAPIModule module;
+ module.ensureInjected(injectedScriptManager, injectedScript);
}
-void CommandLineAPIModule::injectIfNeeded(InjectedScriptManager* injectedScriptManager, InjectedScript injectedScript)
+CommandLineAPIModule::CommandLineAPIModule()
+ : InjectedScriptModule(ASCIILiteral("CommandLineAPI"))
{
- CommandLineAPIModule module;
- module.ensureInjected(injectedScriptManager, injectedScript);
}
String CommandLineAPIModule::source() const
{
- return String(reinterpret_cast<const char*>(CommandLineAPIModuleSource_js), sizeof(CommandLineAPIModuleSource_js));
+ return StringImpl::createWithoutCopying(CommandLineAPIModuleSource_js, sizeof(CommandLineAPIModuleSource_js));
}
-JSC::JSValue CommandLineAPIModule::host(InjectedScriptManager* injectedScriptManager, JSC::ExecState* exec) const
+JSValue CommandLineAPIModule::host(InjectedScriptManager* injectedScriptManager, ExecState* exec) const
{
- // CommandLineAPIModule should only ever be used by a PageInjectedScriptManager.
- PageInjectedScriptManager* pageInjectedScriptManager = static_cast<PageInjectedScriptManager*>(injectedScriptManager);
+ // CommandLineAPIModule should only ever be used by a WebInjectedScriptManager.
+ WebInjectedScriptManager* pageInjectedScriptManager = static_cast<WebInjectedScriptManager*>(injectedScriptManager);
ASSERT(pageInjectedScriptManager->commandLineAPIHost());
+
JSDOMGlobalObject* globalObject = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject());
- return toJS(exec, globalObject, pageInjectedScriptManager->commandLineAPIHost());
+ return pageInjectedScriptManager->commandLineAPIHost()->wrapper(exec, globalObject);
}
} // namespace WebCore
-
-#endif // ENABLE(INSPECTOR)