diff options
Diffstat (limited to 'Source/WebCore/workers')
-rw-r--r-- | Source/WebCore/workers/AbstractWorker.cpp | 7 | ||||
-rw-r--r-- | Source/WebCore/workers/DefaultSharedWorkerRepository.cpp | 7 | ||||
-rw-r--r-- | Source/WebCore/workers/SharedWorker.cpp | 7 | ||||
-rw-r--r-- | Source/WebCore/workers/Worker.cpp | 12 | ||||
-rw-r--r-- | Source/WebCore/workers/WorkerContext.cpp | 19 | ||||
-rw-r--r-- | Source/WebCore/workers/WorkerContext.h | 7 | ||||
-rw-r--r-- | Source/WebCore/workers/WorkerContext.idl | 4 | ||||
-rw-r--r-- | Source/WebCore/workers/WorkerMessagingProxy.cpp | 1 |
8 files changed, 23 insertions, 41 deletions
diff --git a/Source/WebCore/workers/AbstractWorker.cpp b/Source/WebCore/workers/AbstractWorker.cpp index 10bc95f..18a94b5 100644 --- a/Source/WebCore/workers/AbstractWorker.cpp +++ b/Source/WebCore/workers/AbstractWorker.cpp @@ -38,7 +38,7 @@ #include "Event.h" #include "EventException.h" #include "EventNames.h" -#include "InspectorController.h" +#include "InspectorInstrumentation.h" #include "ScriptExecutionContext.h" #include "SecurityOrigin.h" @@ -56,10 +56,7 @@ AbstractWorker::~AbstractWorker() void AbstractWorker::onDestroyWorker() { -#if ENABLE(INSPECTOR) - if (InspectorController* inspector = scriptExecutionContext() ? scriptExecutionContext()->inspectorController() : 0) - inspector->didDestroyWorker(asID()); -#endif + InspectorInstrumentation::didDestroyWorker(scriptExecutionContext(), asID()); } void AbstractWorker::contextDestroyed() diff --git a/Source/WebCore/workers/DefaultSharedWorkerRepository.cpp b/Source/WebCore/workers/DefaultSharedWorkerRepository.cpp index 4a8e947..3a14b62 100644 --- a/Source/WebCore/workers/DefaultSharedWorkerRepository.cpp +++ b/Source/WebCore/workers/DefaultSharedWorkerRepository.cpp @@ -37,7 +37,7 @@ #include "ActiveDOMObject.h" #include "CrossThreadTask.h" #include "Document.h" -#include "InspectorController.h" +#include "InspectorInstrumentation.h" #include "MessageEvent.h" #include "MessagePort.h" #include "NotImplemented.h" @@ -291,10 +291,7 @@ void SharedWorkerScriptLoader::notifyFinished() if (m_scriptLoader->failed()) m_worker->dispatchEvent(Event::create(eventNames().errorEvent, false, true)); else { -#if ENABLE(INSPECTOR) - if (InspectorController* inspector = m_worker->scriptExecutionContext()->inspectorController()) - inspector->scriptImported(m_scriptLoader->identifier(), m_scriptLoader->script()); -#endif + InspectorInstrumentation::scriptImported(m_worker->scriptExecutionContext(), m_scriptLoader->identifier(), m_scriptLoader->script()); DefaultSharedWorkerRepository::instance().workerScriptLoaded(*m_proxy, m_worker->scriptExecutionContext()->userAgent(m_scriptLoader->url()), m_scriptLoader->script(), m_port.release()); } m_worker->unsetPendingActivity(m_worker.get()); diff --git a/Source/WebCore/workers/SharedWorker.cpp b/Source/WebCore/workers/SharedWorker.cpp index 997f9cd..874ea64 100644 --- a/Source/WebCore/workers/SharedWorker.cpp +++ b/Source/WebCore/workers/SharedWorker.cpp @@ -35,7 +35,7 @@ #include "SharedWorker.h" -#include "InspectorController.h" +#include "InspectorInstrumentation.h" #include "KURL.h" #include "MessageChannel.h" #include "MessagePort.h" @@ -64,10 +64,7 @@ PassRefPtr<SharedWorker> SharedWorker::create(const String& url, const String& n SharedWorkerRepository::connect(worker.get(), remotePort.release(), scriptURL, name, ec); -#if ENABLE(INSPECTOR) - if (InspectorController* inspector = context->inspectorController()) - inspector->didCreateWorker(worker->asID(), scriptURL.string(), true); -#endif + InspectorInstrumentation::didCreateWorker(context, worker->asID(), scriptURL.string(), true); return worker.release(); } diff --git a/Source/WebCore/workers/Worker.cpp b/Source/WebCore/workers/Worker.cpp index 32ec997..968352c 100644 --- a/Source/WebCore/workers/Worker.cpp +++ b/Source/WebCore/workers/Worker.cpp @@ -40,7 +40,7 @@ #include "ExceptionCode.h" #include "Frame.h" #include "FrameLoader.h" -#include "InspectorController.h" +#include "InspectorInstrumentation.h" #include "MessageEvent.h" #include "TextEncoding.h" #include "WorkerContextProxy.h" @@ -70,10 +70,7 @@ PassRefPtr<Worker> Worker::create(const String& url, ScriptExecutionContext* con // The worker context does not exist while loading, so we must ensure that the worker object is not collected, nor are its event listeners. worker->setPendingActivity(worker.get()); -#if ENABLE(INSPECTOR) - if (InspectorController* inspector = context->inspectorController()) - inspector->didCreateWorker(worker->asID(), scriptURL.string(), false); -#endif + InspectorInstrumentation::didCreateWorker(context, worker->asID(), scriptURL.string(), false); return worker.release(); } @@ -135,10 +132,7 @@ void Worker::notifyFinished() dispatchEvent(Event::create(eventNames().errorEvent, false, true)); else { m_contextProxy->startWorkerContext(m_scriptLoader->url(), scriptExecutionContext()->userAgent(m_scriptLoader->url()), m_scriptLoader->script()); -#if ENABLE(INSPECTOR) - if (InspectorController* inspector = scriptExecutionContext()->inspectorController()) - inspector->scriptImported(m_scriptLoader->identifier(), m_scriptLoader->script()); -#endif + InspectorInstrumentation::scriptImported(scriptExecutionContext(), m_scriptLoader->identifier(), m_scriptLoader->script()); } m_scriptLoader = 0; diff --git a/Source/WebCore/workers/WorkerContext.cpp b/Source/WebCore/workers/WorkerContext.cpp index 345e5b7..d5d1ccc 100644 --- a/Source/WebCore/workers/WorkerContext.cpp +++ b/Source/WebCore/workers/WorkerContext.cpp @@ -38,11 +38,12 @@ #include "DatabaseSync.h" #include "DatabaseTracker.h" #include "DOMTimer.h" +#include "DOMURL.h" #include "DOMWindow.h" #include "ErrorEvent.h" #include "Event.h" #include "EventException.h" -#include "InspectorController.h" +#include "InspectorInstrumentation.h" #include "KURL.h" #include "MessagePort.h" #include "NotImplemented.h" @@ -245,10 +246,7 @@ void WorkerContext::importScripts(const Vector<String>& urls, ExceptionCode& ec) return; } -#if ENABLE(INSPECTOR) - if (InspectorController* inspector = scriptExecutionContext()->inspectorController()) - inspector->scriptImported(scriptLoader.identifier(), scriptLoader.script()); -#endif + InspectorInstrumentation::scriptImported(scriptExecutionContext(), scriptLoader.identifier(), scriptLoader.script()); ScriptValue exception; m_script->evaluate(ScriptSourceCode(scriptLoader.script(), *it), &exception); @@ -341,14 +339,11 @@ EventTargetData* WorkerContext::ensureEventTargetData() } #if ENABLE(BLOB) -String WorkerContext::createObjectURL(Blob* blob) -{ - return scriptExecutionContext()->createPublicBlobURL(blob).string(); -} - -void WorkerContext::revokeObjectURL(const String& blobURLString) +DOMURL* WorkerContext::webkitURL() const { - scriptExecutionContext()->revokePublicBlobURL(KURL(ParsedURLString, blobURLString)); + if (!m_domURL) + m_domURL = DOMURL::create(this->scriptExecutionContext()); + return m_domURL.get(); } #endif diff --git a/Source/WebCore/workers/WorkerContext.h b/Source/WebCore/workers/WorkerContext.h index 7b6c9a2..a0dbaae 100644 --- a/Source/WebCore/workers/WorkerContext.h +++ b/Source/WebCore/workers/WorkerContext.h @@ -46,6 +46,7 @@ namespace WebCore { class Blob; class DOMFileSystemSync; + class DOMURL; class Database; class DatabaseCallback; class DatabaseSync; @@ -121,8 +122,7 @@ namespace WebCore { virtual bool isJSExecutionTerminated() const; #if ENABLE(BLOB) - String createObjectURL(Blob*); - void revokeObjectURL(const String&); + DOMURL* webkitURL() const; #endif #if ENABLE(FILE_SYSTEM) @@ -186,6 +186,9 @@ namespace WebCore { #if ENABLE_NOTIFICATIONS mutable RefPtr<NotificationCenter> m_notifications; #endif +#if ENABLE(BLOB) + mutable RefPtr<DOMURL> m_domURL; +#endif bool m_closing; bool m_reportingException; EventTargetData m_eventTargetData; diff --git a/Source/WebCore/workers/WorkerContext.idl b/Source/WebCore/workers/WorkerContext.idl index 45ac5b1..ccbd964 100644 --- a/Source/WebCore/workers/WorkerContext.idl +++ b/Source/WebCore/workers/WorkerContext.idl @@ -101,10 +101,10 @@ module threads { attribute BlobBuilderConstructor BlobBuilder; attribute FileReaderConstructor FileReader; attribute FileReaderSyncConstructor FileReaderSync; - DOMString createObjectURL(in Blob blob); - void revokeObjectURL(in DOMString blobURL); #endif + readonly attribute [Conditional=BLOB] DOMURL webkitURL; + #if defined(ENABLE_FILE_SYSTEM) && ENABLE_FILE_SYSTEM const unsigned short TEMPORARY = 0; const unsigned short PERSISTENT = 1; diff --git a/Source/WebCore/workers/WorkerMessagingProxy.cpp b/Source/WebCore/workers/WorkerMessagingProxy.cpp index 10700c6..e89ccb4 100644 --- a/Source/WebCore/workers/WorkerMessagingProxy.cpp +++ b/Source/WebCore/workers/WorkerMessagingProxy.cpp @@ -38,7 +38,6 @@ #include "Document.h" #include "ErrorEvent.h" #include "ExceptionCode.h" -#include "InspectorController.h" #include "MessageEvent.h" #include "ScriptExecutionContext.h" #include "Worker.h" |