Skip to content
Permalink
Browse files
Unreviewed, rolling out r106912.
http://trac.webkit.org/changeset/106912
https://bugs.webkit.org/show_bug.cgi?id=77947

"AppleWebKit build is broken" (Requested by haraken on
#webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-02-07

Source/WebCore:

* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::~ScriptExecutionContext):
(WebCore):
* dom/ScriptExecutionContext.h:
(WebCore):
(ScriptExecutionContext):
* html/DOMURL.cpp:
(WebCore::DOMURL::DOMURL):
(WebCore):
(WebCore::DOMURL::~DOMURL):
(WebCore::DOMURL::contextDestroyed):
(WebCore::DOMURL::createObjectURL):
(WebCore::DOMURL::revokeObjectURL):
* html/DOMURL.h:
(WebCore::DOMURL::create):
(DOMURL):
* html/DOMURL.idl:
* html/PublicURLManager.h: Removed.
* page/DOMWindow.cpp:
(WebCore):
(WebCore::DOMWindow::webkitURL):
* page/DOMWindow.h:
(DOMWindow):
* page/DOMWindow.idl:
* workers/WorkerContext.cpp:
(WebCore):
(WebCore::WorkerContext::webkitURL):
* workers/WorkerContext.h:
(WorkerContext):
* workers/WorkerContext.idl:

LayoutTests:

* fast/dom/DOMURL/check-instanceof-domurl-functions-expected.txt: Removed.
* fast/dom/DOMURL/check-instanceof-domurl-functions.html: Removed.

Canonical link: https://commits.webkit.org/94832@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@106914 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
WebKit Review Bot authored and xharaken committed Feb 7, 2012
1 parent b8b98e6 commit 2f9acb6d757e73a1cd00328face25fa9f630a741
Showing 16 changed files with 142 additions and 179 deletions.
@@ -1,3 +1,15 @@
2012-02-07 Sheriff Bot <webkit.review.bot@gmail.com>

Unreviewed, rolling out r106912.
http://trac.webkit.org/changeset/106912
https://bugs.webkit.org/show_bug.cgi?id=77947

"AppleWebKit build is broken" (Requested by haraken on
#webkit).

* fast/dom/DOMURL/check-instanceof-domurl-functions-expected.txt: Removed.
* fast/dom/DOMURL/check-instanceof-domurl-functions.html: Removed.

2012-02-07 Kaustubh Atrawalkar <kaustubh@motorola.com>

Migrate createObjectURL & revokeObjectURL to static (Class) methods.

This file was deleted.

This file was deleted.

@@ -1,3 +1,43 @@
2012-02-07 Sheriff Bot <webkit.review.bot@gmail.com>

Unreviewed, rolling out r106912.
http://trac.webkit.org/changeset/106912
https://bugs.webkit.org/show_bug.cgi?id=77947

"AppleWebKit build is broken" (Requested by haraken on
#webkit).

* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::~ScriptExecutionContext):
(WebCore):
* dom/ScriptExecutionContext.h:
(WebCore):
(ScriptExecutionContext):
* html/DOMURL.cpp:
(WebCore::DOMURL::DOMURL):
(WebCore):
(WebCore::DOMURL::~DOMURL):
(WebCore::DOMURL::contextDestroyed):
(WebCore::DOMURL::createObjectURL):
(WebCore::DOMURL::revokeObjectURL):
* html/DOMURL.h:
(WebCore::DOMURL::create):
(DOMURL):
* html/DOMURL.idl:
* html/PublicURLManager.h: Removed.
* page/DOMWindow.cpp:
(WebCore):
(WebCore::DOMWindow::webkitURL):
* page/DOMWindow.h:
(DOMWindow):
* page/DOMWindow.idl:
* workers/WorkerContext.cpp:
(WebCore):
(WebCore::WorkerContext::webkitURL):
* workers/WorkerContext.h:
(WorkerContext):
* workers/WorkerContext.idl:

2012-02-07 Kentaro Hara <haraken@chromium.org>

Unreviewed, rolling out r106862.
@@ -38,7 +38,6 @@
#include "EventTarget.h"
#include "FileThread.h"
#include "MessagePort.h"
#include "PublicURLManager.h"
#include "ScriptCallStack.h"
#include "SecurityOrigin.h"
#include "Settings.h"
@@ -127,10 +126,6 @@ ScriptExecutionContext::~ScriptExecutionContext()
m_fileThread = 0;
}
#endif
#if ENABLE(BLOB)
if (m_publicURLManager)
m_publicURLManager->contextDestroyed();
#endif
}

#if ENABLE(SQL_DATABASE)
@@ -390,15 +385,6 @@ FileThread* ScriptExecutionContext::fileThread()
}
#endif

#if ENABLE(BLOB)
PublicURLManager& ScriptExecutionContext::publicURLManager()
{
if (!m_publicURLManager)
m_publicURLManager = PublicURLManager::create();
return *m_publicURLManager;
}
#endif

void ScriptExecutionContext::adjustMinimumTimerInterval(double oldMinimumTimerInterval)
{
if (minimumTimerInterval() != oldMinimumTimerInterval) {
@@ -30,7 +30,6 @@
#include "ActiveDOMObject.h"
#include "ConsoleTypes.h"
#include "KURL.h"
#include "PublicURLManager.h"
#include "ScriptCallStack.h"
#include "SecurityContext.h"
#include <wtf/Forward.h>
@@ -54,9 +53,6 @@ class EventQueue;
class EventTarget;
class MessagePort;

#if ENABLE(BLOB)
class PublicURLManager;
#endif
#if ENABLE(SQL_DATABASE)
class Database;
class DatabaseTaskSynchronizer;
@@ -107,9 +103,6 @@ class ScriptExecutionContext : public SecurityContext {
virtual void resumeActiveDOMObjects();
virtual void stopActiveDOMObjects();

#if ENABLE(BLOB)
PublicURLManager& publicURLManager();
#endif
void didCreateActiveDOMObject(ActiveDOMObject*, void* upcastPointer);
void willDestroyActiveDOMObject(ActiveDOMObject*);

@@ -212,9 +205,6 @@ class ScriptExecutionContext : public SecurityContext {
bool m_inDispatchErrorEvent;
class PendingException;
OwnPtr<Vector<OwnPtr<PendingException> > > m_pendingExceptions;
#if ENABLE(BLOB)
OwnPtr<PublicURLManager> m_publicURLManager;
#endif

#if ENABLE(SQL_DATABASE)
RefPtr<DatabaseThread> m_databaseThread;
@@ -1,6 +1,5 @@
/*
* Copyright (C) 2011 Google Inc. All rights reserved.
* Copyright (C) 2012 Motorola Mobility Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,15 +29,11 @@

#include "DOMURL.h"

#include "ActiveDOMObject.h"
#include "Blob.h"
#include "BlobURL.h"
#include "KURL.h"
#include "PublicURLManager.h"
#include "ScriptExecutionContext.h"
#include "SecurityOrigin.h"
#include "ThreadableBlobRegistry.h"
#include <wtf/PassOwnPtr.h>
#include <wtf/MainThread.h>

#if ENABLE(MEDIA_STREAM)
@@ -48,62 +43,84 @@

namespace WebCore {

DOMURL::DOMURL(ScriptExecutionContext* scriptExecutionContext)
: ContextDestructionObserver(scriptExecutionContext)
{
}

DOMURL::~DOMURL()
{
}

void DOMURL::contextDestroyed()
{
ContextDestructionObserver::contextDestroyed();

HashSet<String>::iterator publicBlobURLsEnd = m_publicBlobURLs.end();
for (HashSet<String>::iterator iter = m_publicBlobURLs.begin(); iter != publicBlobURLsEnd; ++iter)
ThreadableBlobRegistry::unregisterBlobURL(KURL(ParsedURLString, *iter));

#if ENABLE(MEDIA_STREAM)
HashSet<String>::iterator publicStreamURLsEnd = m_publicStreamURLs.end();
for (HashSet<String>::iterator iter = m_publicStreamURLs.begin(); iter != publicStreamURLsEnd; ++iter)
MediaStreamRegistry::registry().unregisterMediaStreamURL(KURL(ParsedURLString, *iter));
#endif
}

#if ENABLE(MEDIA_STREAM)
String DOMURL::createObjectURL(ScriptExecutionContext* scriptExecutionContext, MediaStream* stream)
String DOMURL::createObjectURL(MediaStream* stream)
{
if (!scriptExecutionContext || !stream)
if (!m_scriptExecutionContext || !stream)
return String();

KURL publicURL = BlobURL::createPublicURL(scriptExecutionContext->securityOrigin());
KURL publicURL = BlobURL::createPublicURL(scriptExecutionContext()->securityOrigin());
if (publicURL.isEmpty())
return String();

// Since WebWorkers cannot obtain Stream objects, we should be on the main thread.
ASSERT(isMainThread());

MediaStreamRegistry::registry().registerMediaStreamURL(publicURL, stream);
scriptExecutionContext->publicURLManager().streamURLs().add(publicURL.string());
m_publicStreamURLs.add(publicURL.string());

return publicURL.string();
}
#endif

String DOMURL::createObjectURL(ScriptExecutionContext* scriptExecutionContext, Blob* blob)
String DOMURL::createObjectURL(Blob* blob)
{
if (!scriptExecutionContext || !blob)
if (!m_scriptExecutionContext || !blob)
return String();

KURL publicURL = BlobURL::createPublicURL(scriptExecutionContext->securityOrigin());
KURL publicURL = BlobURL::createPublicURL(scriptExecutionContext()->securityOrigin());
if (publicURL.isEmpty())
return String();

ThreadableBlobRegistry::registerBlobURL(publicURL, blob->url());
scriptExecutionContext->publicURLManager().blobURLs().add(publicURL.string());
m_publicBlobURLs.add(publicURL.string());

return publicURL.string();
}

void DOMURL::revokeObjectURL(ScriptExecutionContext* scriptExecutionContext, const String& urlString)
void DOMURL::revokeObjectURL(const String& urlString)
{
if (!scriptExecutionContext)
if (!m_scriptExecutionContext)
return;

KURL url(KURL(), urlString);

HashSet<String>& blobURLs = scriptExecutionContext->publicURLManager().blobURLs();
if (blobURLs.contains(url.string())) {
if (m_publicBlobURLs.contains(url.string())) {
ThreadableBlobRegistry::unregisterBlobURL(url);
blobURLs.remove(url.string());
m_publicBlobURLs.remove(url.string());
}

#if ENABLE(MEDIA_STREAM)
HashSet<String>& streamURLs = scriptExecutionContext->publicURLManager().streamURLs();
if (streamURLs.contains(url.string())) {
if (m_publicStreamURLs.contains(url.string())) {
// FIXME: make sure of this assertion below. Raise a spec question if required.
// Since WebWorkers cannot obtain Stream objects, we should be on the main thread.
ASSERT(isMainThread());
MediaStreamRegistry::registry().unregisterMediaStreamURL(url);
streamURLs.remove(url.string());
m_publicStreamURLs.remove(url.string());
}
#endif
}
@@ -1,6 +1,5 @@
/*
* Copyright (C) 2011 Google Inc. All rights reserved.
* Copyright (C) 2012 Motorola Mobility Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,7 +26,9 @@
#ifndef DOMURL_h
#define DOMURL_h

#include "KURL.h"
#if ENABLE(BLOB)

#include "ActiveDOMObject.h"
#include "PlatformString.h"
#include <wtf/HashSet.h>
#include <wtf/PassRefPtr.h>
@@ -39,22 +40,30 @@ class Blob;
class MediaStream;
class ScriptExecutionContext;

class DOMURL : public RefCounted<DOMURL> {

class DOMURL : public RefCounted<DOMURL>, public ContextDestructionObserver {
public:
static PassRefPtr<DOMURL> create() { return adoptRef(new DOMURL); }

#if ENABLE(BLOB)
static void contextDestroyed(ScriptExecutionContext*);
static PassRefPtr<DOMURL> create(ScriptExecutionContext* scriptExecutionContext) { return adoptRef(new DOMURL(scriptExecutionContext)); }
~DOMURL();

static String createObjectURL(ScriptExecutionContext*, Blob*);
static void revokeObjectURL(ScriptExecutionContext*, const String&);
#if ENABLE(MEDIA_STREAM)
static String createObjectURL(ScriptExecutionContext*, MediaStream*);
String createObjectURL(MediaStream*);
#endif
String createObjectURL(Blob*);
void revokeObjectURL(const String&);

private:
explicit DOMURL(ScriptExecutionContext*);

virtual void contextDestroyed();

HashSet<String> m_publicBlobURLs;
#if ENABLE(MEDIA_STREAM)
HashSet<String> m_publicStreamURLs;
#endif
};

} // namespace WebCore

#endif // ENABLE(BLOB)

#endif // DOMURL_h
@@ -1,6 +1,5 @@
/*
* Copyright (C) 2011 Google Inc. All rights reserved.
* Copyright (C) 2012 Motorola Mobility Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,15 +26,15 @@
module html {
interface [
Conditional=BLOB,
Constructor,
OmitConstructor,
GenerateNativeConverter,
JSGenerateToJS,
JSNoStaticTables
] DOMURL {
#if defined(ENABLE_MEDIA_STREAM) && ENABLE_MEDIA_STREAM
static [CallWith=ScriptExecutionContext,ConvertNullStringTo=Undefined] DOMString createObjectURL(in MediaStream stream);
[ConvertNullStringTo=Undefined] DOMString createObjectURL(in MediaStream stream);
#endif
static [CallWith=ScriptExecutionContext,ConvertNullStringTo=Undefined] DOMString createObjectURL(in Blob blob);
static [CallWith=ScriptExecutionContext] void revokeObjectURL(in DOMString url);
[ConvertNullStringTo=Undefined] DOMString createObjectURL(in Blob blob);
void revokeObjectURL(in DOMString url);
};
}

0 comments on commit 2f9acb6

Please sign in to comment.