Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Unified Diff: Source/bindings/core/v8/PageScriptDebugServer.cpp

Issue 847803002: Make ScriptStreamer and dependents Oilpan friendly. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: nullptr tidying Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/bindings/core/v8/PageScriptDebugServer.cpp
diff --git a/Source/bindings/core/v8/PageScriptDebugServer.cpp b/Source/bindings/core/v8/PageScriptDebugServer.cpp
index c5e9190be87e4fb2f98e63c2bc1ac455123232da..e9c05fb4c499cc9fa287d78c954ded59f684040f 100644
--- a/Source/bindings/core/v8/PageScriptDebugServer.cpp
+++ b/Source/bindings/core/v8/PageScriptDebugServer.cpp
@@ -33,6 +33,7 @@
#include "bindings/core/v8/DOMWrapperWorld.h"
#include "bindings/core/v8/ScriptController.h"
+#include "bindings/core/v8/ScriptPreprocessor.h"
#include "bindings/core/v8/ScriptSourceCode.h"
#include "bindings/core/v8/V8Binding.h"
#include "bindings/core/v8/V8ScriptRunner.h"
@@ -77,16 +78,16 @@ static LocalFrame* retrieveFrameWithGlobalObjectCheck(v8::Handle<v8::Context> co
void PageScriptDebugServer::setPreprocessorSource(const String& preprocessorSource)
{
if (preprocessorSource.isEmpty())
- m_preprocessorSourceCode.clear();
+ m_preprocessorSourceCode = nullptr;
else
- m_preprocessorSourceCode = adoptPtr(new ScriptSourceCode(preprocessorSource));
+ m_preprocessorSourceCode = ScriptSourceCode(preprocessorSource);
m_scriptPreprocessor.clear();
}
PageScriptDebugServer& PageScriptDebugServer::shared()
{
- DEFINE_STATIC_LOCAL(PageScriptDebugServer, server, ());
- return server;
+ DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<PageScriptDebugServer>, server, (adoptPtrWillBeNoop(new PageScriptDebugServer())));
+ return *server;
}
v8::Isolate* PageScriptDebugServer::s_mainThreadIsolate = 0;
@@ -98,7 +99,8 @@ void PageScriptDebugServer::setMainThreadIsolate(v8::Isolate* isolate)
PageScriptDebugServer::PageScriptDebugServer()
: ScriptDebugServer(s_mainThreadIsolate)
- , m_pausedPage(0)
+ , m_pausedPage(nullptr)
+ , m_preprocessorSourceCode()
{
}
@@ -106,6 +108,16 @@ PageScriptDebugServer::~PageScriptDebugServer()
{
}
+void PageScriptDebugServer::trace(Visitor* visitor)
+{
+#if ENABLE(OILPAN)
+ visitor->trace(m_listenersMap);
+ visitor->trace(m_pausedPage);
+ visitor->trace(m_preprocessorSourceCode);
haraken 2015/01/22 08:45:11 Just want to confirm, but does visitor->trace(m_pr
sof 2015/01/22 09:16:45 I think it will statically resolve to the trace()
+#endif
+ ScriptDebugServer::trace(visitor);
+}
+
void PageScriptDebugServer::addListener(ScriptDebugListener* listener, Page* page)
{
ScriptController& scriptController = page->deprecatedLocalMainFrame()->script();
@@ -277,7 +289,7 @@ bool PageScriptDebugServer::canPreprocess(LocalFrame* frame)
// Web page to ensure that the debugger's console initialization code has completed.
if (!m_scriptPreprocessor) {
TemporaryChange<bool> isPreprocessing(isCreatingPreprocessor, true);
- m_scriptPreprocessor = adoptPtr(new ScriptPreprocessor(m_isolate, *m_preprocessorSourceCode.get(), frame));
+ m_scriptPreprocessor = adoptPtr(new ScriptPreprocessor(m_isolate, m_preprocessorSourceCode.get(), frame));
}
if (m_scriptPreprocessor->isValid())
@@ -285,18 +297,18 @@ bool PageScriptDebugServer::canPreprocess(LocalFrame* frame)
m_scriptPreprocessor.clear();
// Don't retry the compile if we fail one time.
- m_preprocessorSourceCode.clear();
+ m_preprocessorSourceCode = nullptr;
return false;
}
// Source to Source processing iff debugger enabled and it has loaded a preprocessor.
-PassOwnPtr<ScriptSourceCode> PageScriptDebugServer::preprocess(LocalFrame* frame, const ScriptSourceCode& sourceCode)
+Nullable<ScriptSourceCode> PageScriptDebugServer::preprocess(LocalFrame* frame, const ScriptSourceCode& sourceCode)
{
if (!canPreprocess(frame))
- return PassOwnPtr<ScriptSourceCode>();
+ return nullptr;
String preprocessedSource = m_scriptPreprocessor->preprocessSourceCode(sourceCode.source(), sourceCode.url());
- return adoptPtr(new ScriptSourceCode(preprocessedSource, sourceCode.url()));
+ return ScriptSourceCode(preprocessedSource, sourceCode.url());
}
String PageScriptDebugServer::preprocessEventListener(LocalFrame* frame, const String& source, const String& url, const String& functionName)

Powered by Google App Engine
This is Rietveld 408576698