Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (199641 => 199642)
--- trunk/Source/_javascript_Core/ChangeLog 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/_javascript_Core/ChangeLog 2016-04-17 18:39:13 UTC (rev 199642)
@@ -1,3 +1,28 @@
+2016-04-17 Darin Adler <[email protected]>
+
+ Remove more uses of Deprecated::ScriptXXX
+ https://bugs.webkit.org/show_bug.cgi?id=156660
+
+ Reviewed by Antti Koivisto.
+
+ * bindings/ScriptFunctionCall.cpp:
+ (Deprecated::ScriptCallArgumentHandler::appendArgument): Deleted
+ unneeded overloads that take a ScriptObject and ScriptValue.
+ * bindings/ScriptFunctionCall.h: Ditto.
+
+ * bindings/ScriptObject.h: Added operator so this can change
+ itself into a JSObject*. Helps while phasing this class out.
+
+ * bindings/ScriptValue.h: Export toInspectorValue so it can be
+ used in WebCore.
+
+ * inspector/InjectedScriptManager.cpp:
+ (Inspector::InjectedScriptManager::createInjectedScript): Changed
+ return value from Deprecated::ScriptObject to JSObject*.
+ (Inspector::InjectedScriptManager::injectedScriptFor): Updated for
+ the return value change above.
+ * inspector/InjectedScriptManager.h: Ditto.
+
2016-04-16 Benjamin Poulain <[email protected]>
[JSC] DFG should support relational comparisons of Number and Other
Modified: trunk/Source/_javascript_Core/bindings/ScriptFunctionCall.cpp (199641 => 199642)
--- trunk/Source/_javascript_Core/bindings/ScriptFunctionCall.cpp 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/_javascript_Core/bindings/ScriptFunctionCall.cpp 2016-04-17 18:39:13 UTC (rev 199642)
@@ -41,15 +41,6 @@
namespace Deprecated {
-void ScriptCallArgumentHandler::appendArgument(const Deprecated::ScriptObject& argument)
-{
- if (argument.scriptState() != m_exec) {
- ASSERT_NOT_REACHED();
- return;
- }
- m_arguments.append(argument.jsObject());
-}
-
void ScriptCallArgumentHandler::appendArgument(const String& argument)
{
JSLockHolder lock(m_exec);
Modified: trunk/Source/_javascript_Core/bindings/ScriptFunctionCall.h (199641 => 199642)
--- trunk/Source/_javascript_Core/bindings/ScriptFunctionCall.h 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/_javascript_Core/bindings/ScriptFunctionCall.h 2016-04-17 18:39:13 UTC (rev 199642)
@@ -46,8 +46,6 @@
public:
ScriptCallArgumentHandler(JSC::ExecState* state) : m_exec(state) { }
- void appendArgument(const ScriptObject&);
- void appendArgument(const ScriptValue&);
void appendArgument(const char*);
void appendArgument(const String&);
void appendArgument(JSC::JSValue);
Modified: trunk/Source/_javascript_Core/bindings/ScriptObject.h (199641 => 199642)
--- trunk/Source/_javascript_Core/bindings/ScriptObject.h 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/_javascript_Core/bindings/ScriptObject.h 2016-04-17 18:39:13 UTC (rev 199642)
@@ -29,8 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef ScriptObject_h
-#define ScriptObject_h
+#pragma once
#include "JSObject.h"
#include "ScriptValue.h"
@@ -41,15 +40,15 @@
public:
JS_EXPORT_PRIVATE ScriptObject(JSC::ExecState*, JSC::JSObject*);
JS_EXPORT_PRIVATE ScriptObject(JSC::ExecState*, const ScriptValue&);
- ScriptObject() : m_scriptState(nullptr) { }
+ ScriptObject() { }
+ operator JSC::JSObject*() const { return jsObject(); }
+
JSC::JSObject* jsObject() const { return asObject(jsValue()); }
JSC::ExecState* scriptState() const { return m_scriptState; }
-protected:
- JSC::ExecState* m_scriptState;
+private:
+ JSC::ExecState* m_scriptState { nullptr };
};
} // namespace Deprecated
-
-#endif // ScriptObject_h
Modified: trunk/Source/_javascript_Core/bindings/ScriptValue.h (199641 => 199642)
--- trunk/Source/_javascript_Core/bindings/ScriptValue.h 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/_javascript_Core/bindings/ScriptValue.h 2016-04-17 18:39:13 UTC (rev 199642)
@@ -43,7 +43,7 @@
class InspectorValue;
-RefPtr<InspectorValue> toInspectorValue(JSC::ExecState&, JSC::JSValue);
+JS_EXPORT_PRIVATE RefPtr<InspectorValue> toInspectorValue(JSC::ExecState&, JSC::JSValue);
}
Modified: trunk/Source/_javascript_Core/inspector/InjectedScriptManager.cpp (199641 => 199642)
--- trunk/Source/_javascript_Core/inspector/InjectedScriptManager.cpp 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/_javascript_Core/inspector/InjectedScriptManager.cpp 2016-04-17 18:39:13 UTC (rev 199642)
@@ -131,7 +131,7 @@
return StringImpl::createWithoutCopying(InjectedScriptSource_js, sizeof(InjectedScriptSource_js));
}
-Deprecated::ScriptObject InjectedScriptManager::createInjectedScript(const String& source, ExecState* scriptState, int id)
+JSC::JSObject* InjectedScriptManager::createInjectedScript(const String& source, ExecState* scriptState, int id)
{
JSLockHolder lock(scriptState);
@@ -143,12 +143,12 @@
InspectorEvaluateHandler evaluateHandler = m_environment.evaluateHandler();
JSValue functionValue = evaluateHandler(scriptState, sourceCode, globalThisValue, evaluationException);
if (evaluationException)
- return Deprecated::ScriptObject();
+ return nullptr;
CallData callData;
CallType callType = getCallData(functionValue, callData);
if (callType == CallType::None)
- return Deprecated::ScriptObject();
+ return nullptr;
MarkedArgumentBuffer args;
args.append(m_injectedScriptHost->wrapper(scriptState, globalObject));
@@ -157,10 +157,7 @@
JSValue result = JSC::call(scriptState, functionValue, callType, callData, globalThisValue, args);
scriptState->clearException();
- if (result.isObject())
- return Deprecated::ScriptObject(scriptState, result.getObject());
-
- return Deprecated::ScriptObject();
+ return result.getObject();
}
InjectedScript InjectedScriptManager::injectedScriptFor(ExecState* inspectedExecState)
@@ -176,14 +173,14 @@
return InjectedScript();
int id = injectedScriptIdFor(inspectedExecState);
- Deprecated::ScriptObject injectedScriptObject = createInjectedScript(injectedScriptSource(), inspectedExecState, id);
- if (injectedScriptObject.scriptState() != inspectedExecState) {
+ auto injectedScriptObject = createInjectedScript(injectedScriptSource(), inspectedExecState, id);
+ if (!injectedScriptObject) {
WTFLogAlways("Failed to parse/execute InjectedScriptSource.js!");
WTFLogAlways("%s\n", injectedScriptSource().ascii().data());
RELEASE_ASSERT_NOT_REACHED();
}
- InjectedScript result(injectedScriptObject, &m_environment);
+ InjectedScript result({ inspectedExecState, injectedScriptObject }, &m_environment);
m_idToInjectedScript.set(id, result);
didCreateInjectedScript(result);
return result;
Modified: trunk/Source/_javascript_Core/inspector/InjectedScriptManager.h (199641 => 199642)
--- trunk/Source/_javascript_Core/inspector/InjectedScriptManager.h 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/_javascript_Core/inspector/InjectedScriptManager.h 2016-04-17 18:39:13 UTC (rev 199642)
@@ -74,7 +74,7 @@
private:
String injectedScriptSource();
- Deprecated::ScriptObject createInjectedScript(const String& source, JSC::ExecState*, int id);
+ JSC::JSObject* createInjectedScript(const String& source, JSC::ExecState*, int id);
InspectorEnvironment& m_environment;
RefPtr<InjectedScriptHost> m_injectedScriptHost;
Modified: trunk/Source/WebCore/ChangeLog (199641 => 199642)
--- trunk/Source/WebCore/ChangeLog 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/ChangeLog 2016-04-17 18:39:13 UTC (rev 199642)
@@ -1,3 +1,128 @@
+2016-04-17 Darin Adler <[email protected]>
+
+ Remove more uses of Deprecated::ScriptXXX
+ https://bugs.webkit.org/show_bug.cgi?id=156660
+
+ Reviewed by Antti Koivisto.
+
+ * Modules/mediacontrols/MediaControlsHost.h: Removed unneeded include.
+
+ * Modules/plugins/PluginReplacement.h: Removed unneeded include.
+ Changed argument to installReplacement into a reference. Changed return
+ value for creation function from PassRefPtr to Ref.
+
+ * Modules/plugins/QuickTimePluginReplacement.h: Removed unneeded includes and
+ forward declarations. Marked class final. Made almost everything private.
+
+ * Modules/plugins/QuickTimePluginReplacement.mm:
+ (WebCore::QuickTimePluginReplacement::create): Changed to return Ref.
+ (WebCore::QuickTimePluginReplacement::installReplacement): Changed to take
+ a reference.
+
+ * Modules/plugins/YouTubePluginReplacement.cpp:
+ (WebCore::YouTubePluginReplacement::create): Changed to return Ref.
+ (WebCore::YouTubePluginReplacement::installReplacement): Changed to take
+ a reference.
+
+ * Modules/plugins/YouTubePluginReplacement.h: Removed unneeded includes and
+ forward declarations. Marked class final. Changed return type of create.
+
+ * Modules/websockets/WebSocket.cpp:
+ (WebCore::WebSocket::didReceiveBinaryData): Removed local variable so the
+ MessageEvent::create function gets a Ref&& instead of a RefPtr without having
+ to add explicit WTFMove.
+
+ * bindings/js/DOMRequestState.h: Removed code that set m_exec twice.
+
+ * bindings/js/Dictionary.h: Reformatted function templates to use a single
+ line so they are easier to look at.
+ (WebCore::Dictionary::getEventListener): Rewrote this so it no longer uses
+ a Deprecated::ScriptValue and also make it a little more compact and terse.
+
+ * bindings/js/JSCommandLineAPIHostCustom.cpp:
+ (WebCore::JSCommandLineAPIHost::inspect): Rewrote to use JSValue instead of
+ Deprecated::ScriptValue. Considerably more efficient.
+
+ * bindings/js/JSMessageEventCustom.cpp:
+ (WebCore::JSMessageEvent::data): Streamlined to use Deprecated::ScriptValue
+ a little bit less.
+
+ * bindings/js/JSNodeCustom.cpp: Moved include here from header.
+ * bindings/js/JSNodeCustom.h: Moved include from here to cpp file.
+
+ * bindings/js/JSPopStateEventCustom.cpp:
+ (WebCore::JSPopStateEvent::state): Updated for changes to return value of the
+ state() and serializedState functions.
+
+ * bindings/js/ScriptState.h: Removed the ScriptState typedef.
+
+ * bindings/js/SerializedScriptValue.cpp: Moved include here from header.
+ * bindings/js/SerializedScriptValue.h: Moved include from here to cpp file.
+
+ * css/FontFace.cpp:
+ (WebCore::FontFace::create): Changed argument to JSValue instead of ScriptValue.
+ * css/FontFace.h: Ditto.
+
+ * dom/MessageEvent.cpp: Moved create functions in here from header file.
+ Removed some unused ones including one that took a Deprecated::ScriptValue.
+ * dom/MessageEvent.h: Streamlined create functions, removing unused functions,
+ unused arguments, and unused default values for arguments. Also moved them all
+ into the cpp file instead of inlining them. Also changed the return type of
+ dataAsScriptValue to JSValue.
+
+ * dom/NodeFilterCondition.h: Removed unneeded include. Tweaked formatting.
+
+ * dom/PopStateEvent.h: Changed return value of state to be a JSValue and of
+ serializedState to be a raw pointer, not a PassRefPtr.
+
+ * dom/Traversal.h: Removed unneeded include. Removed unnecessary use of
+ unsigned long instead of unsigned. Fixed indentation.
+
+ * html/HTMLPlugInElement.cpp:
+ (WebCore::HTMLPlugInElement::didAddUserAgentShadowRoot): Pass reference.
+
+ * inspector/InspectorDOMAgent.cpp:
+ (WebCore::InspectorDOMAgent::buildObjectForEventListener): Pass JSValue instead
+ of constructing a Deprecated::ScriptValue.
+
+ * inspector/InspectorFrontendHost.cpp:
+ (WebCore::FrontendMenuProvider::disconnect): Initialize without explicitly
+ mentioning the Deprecated::ScriptObject type.
+
+ * inspector/InspectorIndexedDBAgent.cpp: Removed unneeded include.
+
+ * inspector/InspectorInstrumentation.h: Removed unneeded include and also
+ declaration of two non-existent functions.
+
+ * page/DOMWindow.cpp:
+ (WebCore::PostMessageTimer::PostMessageTimer): Tweaked types a little bit to
+ match what is used in MessageEvent now.
+ (WebCore::PostMessageTimer::event): Streamlined a bit and changed type to
+ reference.
+ (WebCore::DOMWindow::postMessage): Updated for changes above.
+ (WebCore::DOMWindow::postMessageTimerFired): Ditto.
+
+ * page/EventSource.cpp:
+ (WebCore::EventSource::createMessageEvent): Removed now-unneeded
+ "false, false" from MessageEvent::create function call.
+
+ * page/csp/ContentSecurityPolicy.h: Removed unneeded include.
+
+ * page/csp/ContentSecurityPolicyDirectiveList.h: Removed unneeded
+ include and also unneeded non-copyable, since the class has a reference as
+ a data member and so is automatically non-copyable.
+
+ * testing/Internals.cpp:
+ (WebCore::Internals::description): Changed to take JSValue.
+ (WebCore::Internals::parserMetaData): Ditto.
+ (WebCore::Internals::serializeObject): Removed unnecessary copying of vector.
+ (WebCore::Internals::isFromCurrentWorld): Changed to take JSValue.
+ (WebCore::Internals::isReadableStreamDisturbed): Changed to not rely on the
+ ScriptState typedef and call it JSC::ExecState.
+
+ * testing/Internals.h: Removed unneeded includes. Removed unneeded and
+ inappropriate use of ASSERT_NO_EXCEPTION.
+
2016-04-17 Youenn Fablet <[email protected]>
[Fetch API] Consume HTTP data as a ReadableStream
Modified: trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.h (199641 => 199642)
--- trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.h 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.h 2016-04-17 18:39:13 UTC (rev 199642)
@@ -23,12 +23,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef MediaControlsHost_h
-#define MediaControlsHost_h
+#pragma once
#if ENABLE(MEDIA_CONTROLS_SCRIPT)
-#include "ScriptState.h"
#include <bindings/ScriptObject.h>
#include <wtf/RefCounted.h>
#include <wtf/Vector.h>
@@ -90,5 +88,3 @@
}
#endif
-
-#endif
Modified: trunk/Source/WebCore/Modules/plugins/PluginReplacement.h (199641 => 199642)
--- trunk/Source/WebCore/Modules/plugins/PluginReplacement.h 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/Modules/plugins/PluginReplacement.h 2016-04-17 18:39:13 UTC (rev 199642)
@@ -23,11 +23,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef PluginReplacement_h
-#define PluginReplacement_h
+#pragma once
#include "RenderPtr.h"
-#include <wtf/RefCounted.h>
#include <wtf/text/WTFString.h>
namespace JSC {
@@ -47,17 +45,14 @@
public:
virtual ~PluginReplacement() { }
- virtual bool installReplacement(ShadowRoot*) = 0;
- virtual JSC::JSObject* scriptObject() { return 0; }
+ virtual bool installReplacement(ShadowRoot&) = 0;
+ virtual JSC::JSObject* scriptObject() { return nullptr; }
virtual bool willCreateRenderer() { return false; }
virtual RenderPtr<RenderElement> createElementRenderer(HTMLPlugInElement&, Ref<RenderStyle>&&, const RenderTreePosition&) = 0;
-
-protected:
- PluginReplacement() { }
};
-typedef PassRefPtr<PluginReplacement> (*CreatePluginReplacement)(HTMLPlugInElement&, const Vector<String>& paramNames, const Vector<String>& paramValues);
+typedef Ref<PluginReplacement> (*CreatePluginReplacement)(HTMLPlugInElement&, const Vector<String>& paramNames, const Vector<String>& paramValues);
typedef bool (*PluginReplacementSupportsType)(const String&);
typedef bool (*PluginReplacementSupportsFileExtension)(const String&);
typedef bool (*PluginReplacementSupportsURL)(const URL&);
@@ -80,7 +75,7 @@
{
}
- PassRefPtr<PluginReplacement> create(HTMLPlugInElement& element, const Vector<String>& paramNames, const Vector<String>& paramValues) const { return m_constructor(element, paramNames, paramValues); }
+ Ref<PluginReplacement> create(HTMLPlugInElement& element, const Vector<String>& paramNames, const Vector<String>& paramValues) const { return m_constructor(element, paramNames, paramValues); }
bool supportsType(const String& mimeType) const { return m_supportsType(mimeType); }
bool supportsFileExtension(const String& extension) const { return m_supportsFileExtension(extension); }
bool supportsURL(const URL& url) const { return m_supportsURL(url); }
@@ -95,5 +90,3 @@
typedef void (*PluginReplacementRegistrar)(const ReplacementPlugin&);
}
-
-#endif
Modified: trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.h (199641 => 199642)
--- trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.h 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.h 2016-04-17 18:39:13 UTC (rev 199642)
@@ -23,47 +23,39 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef QuickTimePluginReplacement_h
-#define QuickTimePluginReplacement_h
+#pragma once
#include "PluginReplacement.h"
-#include "ScriptState.h"
-#include <bindings/ScriptObject.h>
-#include <wtf/RefCounted.h>
-#include <wtf/text/WTFString.h>
namespace WebCore {
-class HTMLPlugInElement;
+class DOMWrapperWorld;
class HTMLVideoElement;
-class RenderElement;
-class RenderStyle;
-class ShadowRoot;
-class QuickTimePluginReplacement : public PluginReplacement {
+class QuickTimePluginReplacement final : public PluginReplacement {
public:
static void registerPluginReplacement(PluginReplacementRegistrar);
- static bool supportsMimeType(const String&);
- static bool supportsFileExtension(const String&);
- static bool supportsURL(const URL&) { return true; }
-
- static PassRefPtr<PluginReplacement> create(HTMLPlugInElement&, const Vector<String>& paramNames, const Vector<String>& paramValues);
- ~QuickTimePluginReplacement();
- bool installReplacement(ShadowRoot*) override;
- JSC::JSObject* scriptObject() override { return m_scriptObject; }
+ virtual ~QuickTimePluginReplacement();
- bool willCreateRenderer() override { return m_mediaElement; }
- RenderPtr<RenderElement> createElementRenderer(HTMLPlugInElement&, Ref<RenderStyle>&&, const RenderTreePosition&) override;
-
- HTMLVideoElement* parentElement() { return m_mediaElement.get(); }
-
unsigned long long movieSize() const;
void postEvent(const String&);
+ HTMLVideoElement* parentElement() { return m_mediaElement.get(); }
+
private:
QuickTimePluginReplacement(HTMLPlugInElement&, const Vector<String>& paramNames, const Vector<String>& paramValues);
+ static Ref<PluginReplacement> create(HTMLPlugInElement&, const Vector<String>& paramNames, const Vector<String>& paramValues);
+ static bool supportsMimeType(const String&);
+ static bool supportsFileExtension(const String&);
+ static bool supportsURL(const URL&) { return true; }
+ bool installReplacement(ShadowRoot&) final;
+ JSC::JSObject* scriptObject() final { return m_scriptObject; }
+
+ bool willCreateRenderer() final { return m_mediaElement; }
+ RenderPtr<RenderElement> createElementRenderer(HTMLPlugInElement&, Ref<RenderStyle>&&, const RenderTreePosition&) final;
+
bool ensureReplacementScriptInjected();
DOMWrapperWorld& isolatedWorld();
@@ -71,9 +63,7 @@
RefPtr<HTMLVideoElement> m_mediaElement;
const Vector<String> m_names;
const Vector<String> m_values;
- JSC::JSObject* m_scriptObject;
+ JSC::JSObject* m_scriptObject; // FIXME: Why is it safe to have this pointer here? What keeps it alive during GC?
};
}
-
-#endif
Modified: trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.mm (199641 => 199642)
--- trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.mm 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.mm 2016-04-17 18:39:13 UTC (rev 199642)
@@ -75,9 +75,9 @@
registrar(ReplacementPlugin(create, supportsMimeType, supportsFileExtension, supportsURL));
}
-PassRefPtr<PluginReplacement> QuickTimePluginReplacement::create(HTMLPlugInElement& plugin, const Vector<String>& paramNames, const Vector<String>& paramValues)
+Ref<PluginReplacement> QuickTimePluginReplacement::create(HTMLPlugInElement& plugin, const Vector<String>& paramNames, const Vector<String>& paramValues)
{
- return adoptRef(new QuickTimePluginReplacement(plugin, paramNames, paramValues));
+ return adoptRef(*new QuickTimePluginReplacement(plugin, paramNames, paramValues));
}
bool QuickTimePluginReplacement::supportsMimeType(const String& mimeType)
@@ -171,7 +171,7 @@
return true;
}
-bool QuickTimePluginReplacement::installReplacement(ShadowRoot* root)
+bool QuickTimePluginReplacement::installReplacement(ShadowRoot& root)
{
if (!ensureReplacementScriptInjected())
return false;
@@ -197,7 +197,7 @@
return false;
JSC::MarkedArgumentBuffer argList;
- argList.append(toJS(exec, globalObject, root));
+ argList.append(toJS(exec, globalObject, &root));
argList.append(toJS(exec, globalObject, m_parentElement));
argList.append(toJS(exec, globalObject, this));
argList.append(toJS<String>(exec, globalObject, m_names));
Modified: trunk/Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp (199641 => 199642)
--- trunk/Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp 2016-04-17 18:39:13 UTC (rev 199642)
@@ -43,9 +43,9 @@
registrar(ReplacementPlugin(create, supportsMimeType, supportsFileExtension, supportsURL));
}
-PassRefPtr<PluginReplacement> YouTubePluginReplacement::create(HTMLPlugInElement& plugin, const Vector<String>& paramNames, const Vector<String>& paramValues)
+Ref<PluginReplacement> YouTubePluginReplacement::create(HTMLPlugInElement& plugin, const Vector<String>& paramNames, const Vector<String>& paramValues)
{
- return adoptRef(new YouTubePluginReplacement(plugin, paramNames, paramValues));
+ return adoptRef(*new YouTubePluginReplacement(plugin, paramNames, paramValues));
}
bool YouTubePluginReplacement::supportsMimeType(const String& mimeType)
@@ -77,11 +77,11 @@
return m_embedShadowElement->createElementRenderer(WTFMove(style), insertionPosition);
}
-bool YouTubePluginReplacement::installReplacement(ShadowRoot* root)
+bool YouTubePluginReplacement::installReplacement(ShadowRoot& root)
{
m_embedShadowElement = YouTubeEmbedShadowElement::create(m_parentElement->document());
- root->appendChild(*m_embedShadowElement);
+ root.appendChild(*m_embedShadowElement);
Ref<HTMLIFrameElement> iframeElement = HTMLIFrameElement::create(HTMLNames::iframeTag, m_parentElement->document());
if (m_attributes.contains("width"))
Modified: trunk/Source/WebCore/Modules/plugins/YouTubePluginReplacement.h (199641 => 199642)
--- trunk/Source/WebCore/Modules/plugins/YouTubePluginReplacement.h 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/Modules/plugins/YouTubePluginReplacement.h 2016-04-17 18:39:13 UTC (rev 199642)
@@ -23,24 +23,16 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef YouTubePluginReplacement_h
-#define YouTubePluginReplacement_h
+#pragma once
#include "PluginReplacement.h"
-
#include <wtf/HashMap.h>
-#include <wtf/RetainPtr.h>
namespace WebCore {
-class HTMLPlugInElement;
-class HTMLIFrameElement;
-class RenderElement;
-class RenderStyle;
-class ShadowRoot;
class YouTubeEmbedShadowElement;
-class YouTubePluginReplacement : public PluginReplacement {
+class YouTubePluginReplacement final : public PluginReplacement {
public:
static void registerPluginReplacement(PluginReplacementRegistrar);
@@ -48,25 +40,21 @@
private:
YouTubePluginReplacement(HTMLPlugInElement&, const Vector<String>& paramNames, const Vector<String>& paramValues);
-
+ static Ref<PluginReplacement> create(HTMLPlugInElement&, const Vector<String>& paramNames, const Vector<String>& paramValues);
static bool supportsMimeType(const String&);
static bool supportsFileExtension(const String&);
static bool supportsURL(const URL&);
-
- static PassRefPtr<PluginReplacement> create(HTMLPlugInElement&, const Vector<String>& paramNames, const Vector<String>& paramValues);
- bool installReplacement(ShadowRoot*) override;
-
+ bool installReplacement(ShadowRoot&) final;
+
String youTubeURL(const String& rawURL);
-
- bool willCreateRenderer() override { return m_embedShadowElement; }
- RenderPtr<RenderElement> createElementRenderer(HTMLPlugInElement&, Ref<RenderStyle>&&, const RenderTreePosition&) override;
-
+
+ bool willCreateRenderer() final { return m_embedShadowElement; }
+ RenderPtr<RenderElement> createElementRenderer(HTMLPlugInElement&, Ref<RenderStyle>&&, const RenderTreePosition&) final;
+
HTMLPlugInElement* m_parentElement;
RefPtr<YouTubeEmbedShadowElement> m_embedShadowElement;
KeyValueMap m_attributes;
};
}
-
-#endif
Modified: trunk/Source/WebCore/Modules/websockets/WebSocket.cpp (199641 => 199642)
--- trunk/Source/WebCore/Modules/websockets/WebSocket.cpp 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/Modules/websockets/WebSocket.cpp 2016-04-17 18:39:13 UTC (rev 199642)
@@ -565,13 +565,10 @@
{
LOG(Network, "WebSocket %p didReceiveBinaryData() %lu byte binary message", this, static_cast<unsigned long>(binaryData.size()));
switch (m_binaryType) {
- case BinaryTypeBlob: {
+ case BinaryTypeBlob:
// FIXME: We just received the data from NetworkProcess, and are sending it back. This is inefficient.
- RefPtr<Blob> blob = Blob::create(WTFMove(binaryData), emptyString());
- dispatchEvent(MessageEvent::create(blob.release(), SecurityOrigin::create(m_url)->toString()));
+ dispatchEvent(MessageEvent::create(Blob::create(WTFMove(binaryData), emptyString()), SecurityOrigin::create(m_url)->toString()));
break;
- }
-
case BinaryTypeArrayBuffer:
dispatchEvent(MessageEvent::create(ArrayBuffer::create(binaryData.data(), binaryData.size()), SecurityOrigin::create(m_url)->toString()));
break;
Modified: trunk/Source/WebCore/bindings/js/DOMRequestState.h (199641 => 199642)
--- trunk/Source/WebCore/bindings/js/DOMRequestState.h 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/bindings/js/DOMRequestState.h 2016-04-17 18:39:13 UTC (rev 199642)
@@ -25,8 +25,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef DOMRequestState_h
-#define DOMRequestState_h
+#pragma once
#include "DOMWrapperWorld.h"
#include "Document.h"
@@ -41,7 +40,6 @@
public:
explicit DOMRequestState(ScriptExecutionContext* scriptExecutionContext)
: m_scriptExecutionContext(scriptExecutionContext)
- , m_exec(nullptr)
{
if (is<Document>(*m_scriptExecutionContext)) {
Document& document = downcast<Document>(*m_scriptExecutionContext);
@@ -79,4 +77,3 @@
};
}
-#endif
Modified: trunk/Source/WebCore/bindings/js/Dictionary.h (199641 => 199642)
--- trunk/Source/WebCore/bindings/js/Dictionary.h 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/bindings/js/Dictionary.h 2016-04-17 18:39:13 UTC (rev 199642)
@@ -24,8 +24,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef Dictionary_h
-#define Dictionary_h
+#pragma once
#include "JSDictionary.h"
#include "JSEventListener.h"
@@ -47,18 +46,13 @@
Dictionary(JSC::ExecState*, JSC::JSValue);
// Returns true if a value was found for the provided property.
- template <typename Result>
- bool get(const char* propertyName, Result&) const;
- template <typename Result>
- bool get(const String& propertyName, Result&) const;
+ template<typename Result> bool get(const char* propertyName, Result&) const;
+ template<typename Result> bool get(const String& propertyName, Result&) const;
- template <typename Result>
- Optional<Result> get(const char* propertyName) const;
+ template<typename Result> Optional<Result> get(const char* propertyName) const;
- template <typename T>
- RefPtr<EventListener> getEventListener(const char* propertyName, T* target) const;
- template <typename T>
- RefPtr<EventListener> getEventListener(const String& propertyName, T* target) const;
+ template<typename T> RefPtr<EventListener> getEventListener(const char* propertyName, T* target) const;
+ template<typename T> RefPtr<EventListener> getEventListener(const String& propertyName, T* target) const;
bool isObject() const { return m_dictionary.isValid(); }
bool isUndefinedOrNull() const { return !m_dictionary.isValid(); }
@@ -69,61 +63,40 @@
JSC::ExecState* execState() const { return m_dictionary.execState(); }
private:
- template <typename T>
- JSC::JSObject* asJSObject(T*) const;
+ template<typename T> JSC::JSObject* asJSObject(T*) const;
JSDictionary m_dictionary;
};
-template <typename Result>
-bool Dictionary::get(const char* propertyName, Result& result) const
+template<typename Result> bool Dictionary::get(const char* propertyName, Result& result) const
{
- if (!m_dictionary.isValid())
- return false;
-
- return m_dictionary.get(propertyName, result);
+ return m_dictionary.isValid() && m_dictionary.get(propertyName, result);
}
-template <typename Result>
-bool Dictionary::get(const String& propertyName, Result& result) const
+template<typename Result> bool Dictionary::get(const String& propertyName, Result& result) const
{
return get(propertyName.utf8().data(), result);
}
-template<typename Result>
-Optional<Result> Dictionary::get(const char* propertyName) const
+template<typename Result> Optional<Result> Dictionary::get(const char* propertyName) const
{
Result result;
-
if (!get(propertyName, result))
return Nullopt;
-
return result;
}
-template <typename T>
-RefPtr<EventListener> Dictionary::getEventListener(const char* propertyName, T* target) const
+template<typename T> RefPtr<EventListener> Dictionary::getEventListener(const char* propertyName, T* target) const
{
- if (!m_dictionary.isValid())
+ JSC::JSValue eventListener;
+ if (!get(propertyName, eventListener) || !eventListener || !eventListener.isObject())
return nullptr;
-
- Deprecated::ScriptValue eventListener;
- if (!m_dictionary.tryGetProperty(propertyName, eventListener))
- return nullptr;
- if (eventListener.hasNoValue())
- return nullptr;
- if (!eventListener.isObject())
- return nullptr;
-
- return JSEventListener::create(asObject(eventListener.jsValue()), asJSObject(target), true, currentWorld(m_dictionary.execState()));
+ return JSEventListener::create(asObject(eventListener), asJSObject(target), true, currentWorld(execState()));
}
-template <typename T>
-RefPtr<EventListener> Dictionary::getEventListener(const String& propertyName, T* target) const
+template<typename T> RefPtr<EventListener> Dictionary::getEventListener(const String& propertyName, T* target) const
{
return getEventListener(propertyName.utf8().data(), target);
}
}
-
-#endif // Dictionary_h
Modified: trunk/Source/WebCore/bindings/js/JSCommandLineAPIHostCustom.cpp (199641 => 199642)
--- trunk/Source/WebCore/bindings/js/JSCommandLineAPIHostCustom.cpp 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/bindings/js/JSCommandLineAPIHostCustom.cpp 2016-04-17 18:39:13 UTC (rev 199642)
@@ -122,12 +122,10 @@
JSValue JSCommandLineAPIHost::inspect(ExecState& state)
{
- if (state.argumentCount() >= 2) {
- Deprecated::ScriptValue object(state.vm(), state.uncheckedArgument(0));
- Deprecated::ScriptValue hints(state.vm(), state.uncheckedArgument(1));
- wrapped().inspectImpl(object.toInspectorValue(&state), hints.toInspectorValue(&state));
- }
-
+ if (state.argumentCount() < 2)
+ return jsUndefined();
+ wrapped().inspectImpl(Inspector::toInspectorValue(state, state.uncheckedArgument(0)),
+ Inspector::toInspectorValue(state, state.uncheckedArgument(1)));
return jsUndefined();
}
Modified: trunk/Source/WebCore/bindings/js/JSMessageEventCustom.cpp (199641 => 199642)
--- trunk/Source/WebCore/bindings/js/JSMessageEventCustom.cpp 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/bindings/js/JSMessageEventCustom.cpp 2016-04-17 18:39:13 UTC (rev 199642)
@@ -57,11 +57,10 @@
JSValue result;
switch (event.dataType()) {
case MessageEvent::DataTypeScriptValue: {
- Deprecated::ScriptValue scriptValue = event.dataAsScriptValue();
- if (scriptValue.hasNoValue())
+ JSValue dataValue = event.dataAsScriptValue();
+ if (!dataValue)
result = jsNull();
else {
- JSValue dataValue = scriptValue.jsValue();
// We need to make sure MessageEvents do not leak objects in their state property across isolated DOM worlds.
// Ideally, we would check that the worlds have different privileges but that's not possible yet.
if (dataValue.isObject() && &worldForDOMObject(dataValue.getObject()) != ¤tWorld(&state)) {
@@ -120,7 +119,7 @@
if (state.hadException())
return jsUndefined();
}
- Deprecated::ScriptValue dataArg = Deprecated::ScriptValue(state.vm(), state.argument(3));
+ Deprecated::ScriptValue dataArg(state.vm(), state.argument(3));
if (state.hadException())
return jsUndefined();
Modified: trunk/Source/WebCore/bindings/js/JSNodeCustom.cpp (199641 => 199642)
--- trunk/Source/WebCore/bindings/js/JSNodeCustom.cpp 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/bindings/js/JSNodeCustom.cpp 2016-04-17 18:39:13 UTC (rev 199642)
@@ -61,6 +61,7 @@
#include "ProcessingInstruction.h"
#include "RegisteredEventListener.h"
#include "SVGElement.h"
+#include "ScriptState.h"
#include "ShadowRoot.h"
#include "StyleSheet.h"
#include "StyledElement.h"
Modified: trunk/Source/WebCore/bindings/js/JSNodeCustom.h (199641 => 199642)
--- trunk/Source/WebCore/bindings/js/JSNodeCustom.h 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/bindings/js/JSNodeCustom.h 2016-04-17 18:39:13 UTC (rev 199642)
@@ -23,12 +23,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef JSNodeCustom_h
-#define JSNodeCustom_h
+#pragma once
#include "JSDOMBinding.h"
#include "JSNode.h"
-#include "ScriptState.h"
#include "ShadowRoot.h"
namespace WebCore {
@@ -91,5 +89,3 @@
}
} // namespace WebCore
-
-#endif // JSDOMNodeCustom_h
Modified: trunk/Source/WebCore/bindings/js/JSPopStateEventCustom.cpp (199641 => 199642)
--- trunk/Source/WebCore/bindings/js/JSPopStateEventCustom.cpp 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/bindings/js/JSPopStateEventCustom.cpp 2016-04-17 18:39:13 UTC (rev 199642)
@@ -58,17 +58,15 @@
PopStateEvent& event = wrapped();
- if (!event.state().hasNoValue()) {
+ if (auto eventState = event.state()) {
// We need to make sure a PopStateEvent does not leak objects in its state property across isolated DOM worlds.
// Ideally, we would check that the worlds have different privileges but that's not possible yet.
- JSValue eventState = event.state().jsValue();
if (eventState.isObject() && &worldForDOMObject(eventState.getObject()) != ¤tWorld(&state)) {
- if (RefPtr<SerializedScriptValue> serializedValue = event.trySerializeState(&state))
+ if (auto serializedValue = event.trySerializeState(&state))
eventState = serializedValue->deserialize(&state, globalObject(), nullptr);
else
eventState = jsNull();
}
-
return cacheState(state, this, eventState);
}
@@ -82,7 +80,7 @@
// The current history state object might've changed in the meantime, so we need to take care
// of using the correct one, and always share the same deserialization with history.state.
- bool isSameState = history->isSameAsCurrentState(event.serializedState().get());
+ bool isSameState = history->isSameAsCurrentState(event.serializedState());
JSValue result;
if (isSameState) {
Modified: trunk/Source/WebCore/bindings/js/ScriptState.h (199641 => 199642)
--- trunk/Source/WebCore/bindings/js/ScriptState.h 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/bindings/js/ScriptState.h 2016-04-17 18:39:13 UTC (rev 199642)
@@ -29,14 +29,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef ScriptState_h
-#define ScriptState_h
+#pragma once
namespace JSC {
class ExecState;
}
namespace WebCore {
+
class DOMWindow;
class DOMWrapperWorld;
class Frame;
@@ -45,12 +45,6 @@
class ScriptExecutionContext;
class WorkerGlobalScope;
-// The idea is to expose "state-like" methods (hadException, and any other
-// methods where ExecState just dips into vm) of JSC::ExecState as a
-// separate abstraction.
-// For now, the separation is purely by convention.
-typedef JSC::ExecState ScriptState;
-
DOMWindow* domWindowFromExecState(JSC::ExecState*);
Frame* frameFromExecState(JSC::ExecState*);
ScriptExecutionContext* scriptExecutionContextFromExecState(JSC::ExecState*);
@@ -62,5 +56,3 @@
JSC::ExecState* execStateFromWorkerGlobalScope(WorkerGlobalScope*);
} // namespace WebCore
-
-#endif // ScriptState_h
Modified: trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp (199641 => 199642)
--- trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp 2016-04-17 18:39:13 UTC (rev 199642)
@@ -49,6 +49,7 @@
#include "JSMessagePort.h"
#include "JSNavigator.h"
#include "ScriptExecutionContext.h"
+#include "ScriptState.h"
#include "SharedBuffer.h"
#include "WebCoreJSClientData.h"
#include <limits>
Modified: trunk/Source/WebCore/bindings/js/SerializedScriptValue.h (199641 => 199642)
--- trunk/Source/WebCore/bindings/js/SerializedScriptValue.h 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/bindings/js/SerializedScriptValue.h 2016-04-17 18:39:13 UTC (rev 199642)
@@ -24,10 +24,8 @@
*
*/
-#ifndef SerializedScriptValue_h
-#define SerializedScriptValue_h
+#pragma once
-#include "ScriptState.h"
#include <bindings/ScriptValue.h>
#include <heap/Strong.h>
#include <runtime/ArrayBuffer.h>
@@ -115,5 +113,3 @@
};
}
-
-#endif // SerializedScriptValue_h
Modified: trunk/Source/WebCore/css/FontFace.cpp (199641 => 199642)
--- trunk/Source/WebCore/css/FontFace.cpp 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/css/FontFace.cpp 2016-04-17 18:39:13 UTC (rev 199642)
@@ -57,7 +57,7 @@
return result.isNull() ? Nullopt : Optional<String>(result);
}
-RefPtr<FontFace> FontFace::create(JSC::ExecState& execState, ScriptExecutionContext& context, const String& family, const Deprecated::ScriptValue& source, const Dictionary& descriptors, ExceptionCode& ec)
+RefPtr<FontFace> FontFace::create(JSC::ExecState& execState, ScriptExecutionContext& context, const String& family, JSC::JSValue source, const Dictionary& descriptors, ExceptionCode& ec)
{
if (!context.isDocument()) {
ec = TypeError;
@@ -66,20 +66,19 @@
Ref<FontFace> result = adoptRef(*new FontFace(execState, downcast<Document>(context).fontSelector()));
+ ec = 0;
result->setFamily(family, ec);
if (ec)
return nullptr;
- if (source.jsValue().isString()) {
- String sourceString = source.jsValue().toString(&execState)->value(&execState);
+ if (source.isString()) {
+ String sourceString = source.toString(&execState)->value(&execState);
auto value = FontFace::parseString(sourceString, CSSPropertySrc);
- if (is<CSSValueList>(value.get())) {
- CSSValueList& srcList = downcast<CSSValueList>(*value);
- CSSFontFace::appendSources(result->backing(), srcList, &downcast<Document>(context), false);
- } else {
+ if (!is<CSSValueList>(value.get())) {
ec = SYNTAX_ERR;
return nullptr;
}
+ CSSFontFace::appendSources(result->backing(), downcast<CSSValueList>(*value), &downcast<Document>(context), false);
}
if (auto style = valueFromDictionary(descriptors, "style"))
Modified: trunk/Source/WebCore/css/FontFace.h (199641 => 199642)
--- trunk/Source/WebCore/css/FontFace.h 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/css/FontFace.h 2016-04-17 18:39:13 UTC (rev 199642)
@@ -48,7 +48,7 @@
class FontFace final : public RefCounted<FontFace>, public CSSFontFace::Client {
public:
- static RefPtr<FontFace> create(JSC::ExecState&, ScriptExecutionContext&, const String& family, const Deprecated::ScriptValue& source, const Dictionary& descriptors, ExceptionCode&);
+ static RefPtr<FontFace> create(JSC::ExecState&, ScriptExecutionContext&, const String& family, JSC::JSValue source, const Dictionary& descriptors, ExceptionCode&);
static Ref<FontFace> create(JSC::ExecState&, CSSFontFace&);
virtual ~FontFace();
Modified: trunk/Source/WebCore/dom/MessageEvent.cpp (199641 => 199642)
--- trunk/Source/WebCore/dom/MessageEvent.cpp 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/dom/MessageEvent.cpp 2016-04-17 18:39:13 UTC (rev 199642)
@@ -28,6 +28,8 @@
#include "config.h"
#include "MessageEvent.h"
+#include "Blob.h"
+#include "DOMWindow.h"
#include <runtime/JSCInlines.h>
namespace WebCore {
@@ -37,12 +39,12 @@
return !source || source->toDOMWindow() || source->isMessagePort();
}
-MessageEvent::MessageEvent()
+inline MessageEvent::MessageEvent()
: m_dataType(DataTypeScriptValue)
{
}
-MessageEvent::MessageEvent(const AtomicString& type, const MessageEventInit& initializer)
+inline MessageEvent::MessageEvent(const AtomicString& type, const MessageEventInit& initializer)
: Event(type, initializer)
, m_dataType(DataTypeScriptValue)
, m_dataAsScriptValue(initializer.data)
@@ -53,40 +55,28 @@
{
}
-MessageEvent::MessageEvent(const Deprecated::ScriptValue& data, const String& origin, const String& lastEventId, PassRefPtr<EventTarget> source, std::unique_ptr<MessagePortArray> ports)
+inline MessageEvent::MessageEvent(RefPtr<SerializedScriptValue>&& data, const String& origin, const String& lastEventId, EventTarget* source, std::unique_ptr<MessagePortArray> ports)
: Event(eventNames().messageEvent, false, false)
- , m_dataType(DataTypeScriptValue)
- , m_dataAsScriptValue(data)
- , m_origin(origin)
- , m_lastEventId(lastEventId)
- , m_source(source)
- , m_ports(WTFMove(ports))
-{
- ASSERT(isValidSource(m_source.get()));
-}
-
-MessageEvent::MessageEvent(PassRefPtr<SerializedScriptValue> data, const String& origin, const String& lastEventId, PassRefPtr<EventTarget> source, std::unique_ptr<MessagePortArray> ports)
- : Event(eventNames().messageEvent, false, false)
, m_dataType(DataTypeSerializedScriptValue)
- , m_dataAsSerializedScriptValue(data)
+ , m_dataAsSerializedScriptValue(WTFMove(data))
, m_origin(origin)
, m_lastEventId(lastEventId)
, m_source(source)
, m_ports(WTFMove(ports))
{
- ASSERT(isValidSource(m_source.get()));
+ ASSERT(isValidSource(source));
}
-MessageEvent::MessageEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<SerializedScriptValue> data, const String& origin, const String& lastEventId)
- : Event(type, canBubble, cancelable)
+inline MessageEvent::MessageEvent(const AtomicString& type, RefPtr<SerializedScriptValue>&& data, const String& origin, const String& lastEventId)
+ : Event(type, false, false)
, m_dataType(DataTypeSerializedScriptValue)
- , m_dataAsSerializedScriptValue(data)
+ , m_dataAsSerializedScriptValue(WTFMove(data))
, m_origin(origin)
, m_lastEventId(lastEventId)
{
}
-MessageEvent::MessageEvent(const String& data, const String& origin)
+inline MessageEvent::MessageEvent(const String& data, const String& origin)
: Event(eventNames().messageEvent, false, false)
, m_dataType(DataTypeString)
, m_dataAsString(data)
@@ -94,15 +84,15 @@
{
}
-MessageEvent::MessageEvent(PassRefPtr<Blob> data, const String& origin)
+inline MessageEvent::MessageEvent(Ref<Blob>&& data, const String& origin)
: Event(eventNames().messageEvent, false, false)
, m_dataType(DataTypeBlob)
- , m_dataAsBlob(data)
+ , m_dataAsBlob(WTFMove(data))
, m_origin(origin)
{
}
-MessageEvent::MessageEvent(Ref<ArrayBuffer>&& data, const String& origin)
+inline MessageEvent::MessageEvent(Ref<ArrayBuffer>&& data, const String& origin)
: Event(eventNames().messageEvent, false, false)
, m_dataType(DataTypeArrayBuffer)
, m_dataAsArrayBuffer(WTFMove(data))
@@ -110,6 +100,41 @@
{
}
+Ref<MessageEvent> MessageEvent::create(std::unique_ptr<MessagePortArray> ports, RefPtr<SerializedScriptValue>&& data, const String& origin, const String& lastEventId, EventTarget* source)
+{
+ return adoptRef(*new MessageEvent(WTFMove(data), origin, lastEventId, source, WTFMove(ports)));
+}
+
+Ref<MessageEvent> MessageEvent::create(const AtomicString& type, RefPtr<SerializedScriptValue>&& data, const String& origin, const String& lastEventId)
+{
+ return adoptRef(*new MessageEvent(type, WTFMove(data), origin, lastEventId));
+}
+
+Ref<MessageEvent> MessageEvent::create(const String& data, const String& origin)
+{
+ return adoptRef(*new MessageEvent(data, origin));
+}
+
+Ref<MessageEvent> MessageEvent::create(Ref<Blob>&& data, const String& origin)
+{
+ return adoptRef(*new MessageEvent(WTFMove(data), origin));
+}
+
+Ref<MessageEvent> MessageEvent::create(Ref<ArrayBuffer>&& data, const String& origin)
+{
+ return adoptRef(*new MessageEvent(WTFMove(data), origin));
+}
+
+Ref<MessageEvent> MessageEvent::createForBindings()
+{
+ return adoptRef(*new MessageEvent);
+}
+
+Ref<MessageEvent> MessageEvent::createForBindings(const AtomicString& type, const MessageEventInit& initializer)
+{
+ return adoptRef(*new MessageEvent(type, initializer));
+}
+
MessageEvent::~MessageEvent()
{
}
Modified: trunk/Source/WebCore/dom/MessageEvent.h (199641 => 199642)
--- trunk/Source/WebCore/dom/MessageEvent.h 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/dom/MessageEvent.h 2016-04-17 18:39:13 UTC (rev 199642)
@@ -25,21 +25,16 @@
*
*/
-#ifndef MessageEvent_h
-#define MessageEvent_h
+#pragma once
-#include "Blob.h"
-#include "DOMWindow.h"
#include "Event.h"
#include "MessagePort.h"
#include "SerializedScriptValue.h"
#include <bindings/ScriptValue.h>
-#include <memory>
-#include <runtime/ArrayBuffer.h>
namespace WebCore {
-class EventTarget;
+class Blob;
struct MessageEventInit : public EventInit {
Deprecated::ScriptValue data;
@@ -51,38 +46,13 @@
class MessageEvent final : public Event {
public:
- static Ref<MessageEvent> create(std::unique_ptr<MessagePortArray> ports, const Deprecated::ScriptValue& data = "" const String& origin = String(), const String& lastEventId = String(), PassRefPtr<EventTarget> source = nullptr)
- {
- return adoptRef(*new MessageEvent(data, origin, lastEventId, source, WTFMove(ports)));
- }
- static Ref<MessageEvent> create(std::unique_ptr<MessagePortArray> ports, PassRefPtr<SerializedScriptValue> data, const String& origin = String(), const String& lastEventId = String(), PassRefPtr<EventTarget> source = nullptr)
- {
- return adoptRef(*new MessageEvent(data, origin, lastEventId, source, WTFMove(ports)));
- }
- static Ref<MessageEvent> create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<SerializedScriptValue> data, const String& origin, const String& lastEventId)
- {
- return adoptRef(*new MessageEvent(type, canBubble, cancelable, data, origin, lastEventId));
- }
- static Ref<MessageEvent> create(const String& data, const String& origin = String())
- {
- return adoptRef(*new MessageEvent(data, origin));
- }
- static Ref<MessageEvent> create(PassRefPtr<Blob> data, const String& origin = String())
- {
- return adoptRef(*new MessageEvent(data, origin));
- }
- static Ref<MessageEvent> create(Ref<ArrayBuffer>&& data, const String& origin = String())
- {
- return adoptRef(*new MessageEvent(WTFMove(data), origin));
- }
- static Ref<MessageEvent> createForBindings()
- {
- return adoptRef(*new MessageEvent);
- }
- static Ref<MessageEvent> createForBindings(const AtomicString& type, const MessageEventInit& initializer)
- {
- return adoptRef(*new MessageEvent(type, initializer));
- }
+ static Ref<MessageEvent> create(std::unique_ptr<MessagePortArray>, RefPtr<SerializedScriptValue>&&, const String& origin = { }, const String& lastEventId = { }, EventTarget* source = nullptr);
+ static Ref<MessageEvent> create(const AtomicString& type, RefPtr<SerializedScriptValue>&&, const String& origin, const String& lastEventId);
+ static Ref<MessageEvent> create(const String& data, const String& origin = { });
+ static Ref<MessageEvent> create(Ref<Blob>&& data, const String& origin);
+ static Ref<MessageEvent> create(Ref<ArrayBuffer>&& data, const String& origin = { });
+ static Ref<MessageEvent> createForBindings();
+ static Ref<MessageEvent> createForBindings(const AtomicString& type, const MessageEventInit&);
virtual ~MessageEvent();
void initMessageEvent(const AtomicString& type, bool canBubble, bool cancelable, const Deprecated::ScriptValue& data, const String& origin, const String& lastEventId, DOMWindow* source, std::unique_ptr<MessagePortArray>);
@@ -110,7 +80,7 @@
DataTypeArrayBuffer
};
DataType dataType() const { return m_dataType; }
- const Deprecated::ScriptValue& dataAsScriptValue() const { ASSERT(m_dataType == DataTypeScriptValue); return m_dataAsScriptValue; }
+ JSC::JSValue dataAsScriptValue() const { ASSERT(m_dataType == DataTypeScriptValue); return m_dataAsScriptValue; }
PassRefPtr<SerializedScriptValue> dataAsSerializedScriptValue() const { ASSERT(m_dataType == DataTypeSerializedScriptValue); return m_dataAsSerializedScriptValue; }
String dataAsString() const { ASSERT(m_dataType == DataTypeString); return m_dataAsString; }
Blob* dataAsBlob() const { ASSERT(m_dataType == DataTypeBlob); return m_dataAsBlob.get(); }
@@ -121,14 +91,12 @@
private:
MessageEvent();
MessageEvent(const AtomicString&, const MessageEventInit&);
- MessageEvent(const Deprecated::ScriptValue& data, const String& origin, const String& lastEventId, PassRefPtr<EventTarget> source, std::unique_ptr<MessagePortArray>);
- MessageEvent(PassRefPtr<SerializedScriptValue> data, const String& origin, const String& lastEventId, PassRefPtr<EventTarget> source, std::unique_ptr<MessagePortArray>);
- MessageEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<SerializedScriptValue> data, const String& origin, const String& lastEventId);
+ MessageEvent(RefPtr<SerializedScriptValue>&& data, const String& origin, const String& lastEventId, EventTarget* source, std::unique_ptr<MessagePortArray>);
+ MessageEvent(const AtomicString& type, RefPtr<SerializedScriptValue>&& data, const String& origin, const String& lastEventId);
+ MessageEvent(const String& data, const String& origin);
+ MessageEvent(Ref<Blob>&& data, const String& origin);
+ MessageEvent(Ref<ArrayBuffer>&& data, const String& origin);
- explicit MessageEvent(const String& data, const String& origin);
- explicit MessageEvent(PassRefPtr<Blob> data, const String& origin);
- explicit MessageEvent(Ref<ArrayBuffer>&& data, const String& origin);
-
DataType m_dataType;
Deprecated::ScriptValue m_dataAsScriptValue;
RefPtr<SerializedScriptValue> m_dataAsSerializedScriptValue;
@@ -143,5 +111,3 @@
};
} // namespace WebCore
-
-#endif // MessageEvent_h
Modified: trunk/Source/WebCore/dom/NodeFilterCondition.h (199641 => 199642)
--- trunk/Source/WebCore/dom/NodeFilterCondition.h 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/dom/NodeFilterCondition.h 2016-04-17 18:39:13 UTC (rev 199642)
@@ -22,29 +22,23 @@
*
*/
-#ifndef NodeFilterCondition_h
-#define NodeFilterCondition_h
+#pragma once
-#include "ScriptState.h"
#include <wtf/RefCounted.h>
namespace JSC {
-
class SlotVisitor;
-
}
namespace WebCore {
- class Node;
+class Node;
- class NodeFilterCondition : public RefCounted<NodeFilterCondition> {
- public:
- virtual ~NodeFilterCondition() { }
- virtual short acceptNode(Node*) const = 0;
- virtual void visitAggregate(JSC::SlotVisitor&) { }
- };
+class NodeFilterCondition : public RefCounted<NodeFilterCondition> {
+public:
+ virtual ~NodeFilterCondition() { }
+ virtual short acceptNode(Node*) const = 0;
+ virtual void visitAggregate(JSC::SlotVisitor&) { }
+};
} // namespace WebCore
-
-#endif // NodeFilterCondition_h
Modified: trunk/Source/WebCore/dom/PopStateEvent.h (199641 => 199642)
--- trunk/Source/WebCore/dom/PopStateEvent.h 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/dom/PopStateEvent.h 2016-04-17 18:39:13 UTC (rev 199642)
@@ -24,33 +24,31 @@
*
*/
-#ifndef PopStateEvent_h
-#define PopStateEvent_h
+#pragma once
#include "Event.h"
-#include "SerializedScriptValue.h"
#include <bindings/ScriptValue.h>
namespace WebCore {
+class History;
+class SerializedScriptValue;
+
struct PopStateEventInit : public EventInit {
Deprecated::ScriptValue state;
};
-class History;
-class SerializedScriptValue;
-
class PopStateEvent final : public Event {
public:
virtual ~PopStateEvent();
static Ref<PopStateEvent> create(RefPtr<SerializedScriptValue>&&, PassRefPtr<History>);
static Ref<PopStateEvent> createForBindings(const AtomicString&, const PopStateEventInit&);
- PassRefPtr<SerializedScriptValue> serializedState() const { ASSERT(m_serializedState); return m_serializedState; }
-
+ JSC::JSValue state() const { return m_state; }
+ SerializedScriptValue* serializedState() const { return m_serializedState.get(); }
+
RefPtr<SerializedScriptValue> trySerializeState(JSC::ExecState*);
- const Deprecated::ScriptValue& state() const { return m_state; }
History* history() const { return m_history.get(); }
EventInterface eventInterface() const override;
@@ -66,5 +64,3 @@
};
} // namespace WebCore
-
-#endif // PopStateEvent_h
Modified: trunk/Source/WebCore/dom/Traversal.cpp (199641 => 199642)
--- trunk/Source/WebCore/dom/Traversal.cpp 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/dom/Traversal.cpp 2016-04-17 18:39:13 UTC (rev 199642)
@@ -30,7 +30,7 @@
namespace WebCore {
-NodeIteratorBase::NodeIteratorBase(Node& rootNode, unsigned long whatToShow, RefPtr<NodeFilter>&& nodeFilter)
+NodeIteratorBase::NodeIteratorBase(Node& rootNode, unsigned whatToShow, RefPtr<NodeFilter>&& nodeFilter)
: m_root(&rootNode)
, m_whatToShow(whatToShow)
, m_filter(WTFMove(nodeFilter))
Modified: trunk/Source/WebCore/dom/Traversal.h (199641 => 199642)
--- trunk/Source/WebCore/dom/Traversal.h 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/dom/Traversal.h 2016-04-17 18:39:13 UTC (rev 199642)
@@ -22,34 +22,30 @@
*
*/
-#ifndef Traversal_h
-#define Traversal_h
+#pragma once
-#include "ScriptState.h"
#include <wtf/RefPtr.h>
namespace WebCore {
- class Node;
- class NodeFilter;
+class Node;
+class NodeFilter;
- class NodeIteratorBase {
- public:
- Node* root() const { return m_root.get(); }
- unsigned long whatToShow() const { return m_whatToShow; }
- NodeFilter* filter() const { return m_filter.get(); }
- bool expandEntityReferences() const { return false; }
+class NodeIteratorBase {
+public:
+ Node* root() const { return m_root.get(); }
+ unsigned whatToShow() const { return m_whatToShow; }
+ NodeFilter* filter() const { return m_filter.get(); }
+ bool expandEntityReferences() const { return false; }
- protected:
- NodeIteratorBase(Node&, unsigned long whatToShow, RefPtr<NodeFilter>&&);
- short acceptNode(Node*) const;
+protected:
+ NodeIteratorBase(Node&, unsigned whatToShow, RefPtr<NodeFilter>&&);
+ short acceptNode(Node*) const;
- private:
- RefPtr<Node> m_root;
- unsigned long m_whatToShow;
- RefPtr<NodeFilter> m_filter;
- };
+private:
+ RefPtr<Node> m_root;
+ unsigned m_whatToShow;
+ RefPtr<NodeFilter> m_filter;
+};
} // namespace WebCore
-
-#endif // Traversal_h
Modified: trunk/Source/WebCore/html/HTMLPlugInElement.cpp (199641 => 199642)
--- trunk/Source/WebCore/html/HTMLPlugInElement.cpp 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/html/HTMLPlugInElement.cpp 2016-04-17 18:39:13 UTC (rev 199642)
@@ -327,7 +327,7 @@
return;
root->setResetStyleInheritance(true);
- if (m_pluginReplacement->installReplacement(root)) {
+ if (m_pluginReplacement->installReplacement(*root)) {
setDisplayState(DisplayingPluginReplacement);
setNeedsStyleRecalc(ReconstructRenderTree);
}
Modified: trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp (199641 => 199642)
--- trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp 2016-04-17 18:39:13 UTC (rev 199642)
@@ -1496,7 +1496,7 @@
if (objectGroupId && handler && state) {
InjectedScript injectedScript = m_injectedScriptManager.injectedScriptFor(state);
if (!injectedScript.hasNoValue())
- value->setHandler(injectedScript.wrapObject(Deprecated::ScriptValue(state->vm(), handler), *objectGroupId));
+ value->setHandler(injectedScript.wrapObject(handler, *objectGroupId));
}
if (!scriptID.isNull()) {
auto location = Inspector::Protocol::Debugger::Location::create()
Modified: trunk/Source/WebCore/inspector/InspectorFrontendHost.cpp (199641 => 199642)
--- trunk/Source/WebCore/inspector/InspectorFrontendHost.cpp 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/inspector/InspectorFrontendHost.cpp 2016-04-17 18:39:13 UTC (rev 199642)
@@ -68,7 +68,7 @@
void disconnect()
{
- m_frontendApiObject = Deprecated::ScriptObject();
+ m_frontendApiObject = { };
m_frontendHost = nullptr;
}
Modified: trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp (199641 => 199642)
--- trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp 2016-04-17 18:39:13 UTC (rev 199642)
@@ -58,6 +58,7 @@
#include "IDBTransaction.h"
#include "InspectorPageAgent.h"
#include "InstrumentingAgents.h"
+#include "ScriptState.h"
#include "SecurityOrigin.h"
#include <inspector/InjectedScript.h>
#include <inspector/InjectedScriptManager.h>
Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.h (199641 => 199642)
--- trunk/Source/WebCore/inspector/InspectorInstrumentation.h 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.h 2016-04-17 18:39:13 UTC (rev 199642)
@@ -29,8 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef InspectorInstrumentation_h
-#define InspectorInstrumentation_h
+#pragma once
#include "CSSSelector.h"
#include "Element.h"
@@ -41,7 +40,6 @@
#include "MemoryPressureHandler.h"
#include "Page.h"
#include "ScriptExecutionContext.h"
-#include "ScriptState.h"
#include "StorageArea.h"
#include "WebSocketFrame.h"
#include <runtime/ConsoleTypes.h>
@@ -255,11 +253,6 @@
static void didReceiveWebSocketFrameError(Document*, unsigned long identifier, const String& errorMessage);
#endif
- static Deprecated::ScriptObject wrapCanvas2DRenderingContextForInstrumentation(Document*, const Deprecated::ScriptObject&);
-#if ENABLE(WEBGL)
- static Deprecated::ScriptObject wrapWebGLRenderingContextForInstrumentation(Document*, const Deprecated::ScriptObject&);
-#endif
-
#if ENABLE(RESOURCE_USAGE)
static void didHandleMemoryPressure(Page&, Critical);
#endif
@@ -1292,5 +1285,3 @@
}
} // namespace WebCore
-
-#endif // !defined(InspectorInstrumentation_h)
Modified: trunk/Source/WebCore/page/DOMWindow.cpp (199641 => 199642)
--- trunk/Source/WebCore/page/DOMWindow.cpp 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/page/DOMWindow.cpp 2016-04-17 18:39:13 UTC (rev 199642)
@@ -144,21 +144,20 @@
class PostMessageTimer : public TimerBase {
public:
- PostMessageTimer(DOMWindow* window, PassRefPtr<SerializedScriptValue> message, const String& sourceOrigin, PassRefPtr<DOMWindow> source, std::unique_ptr<MessagePortChannelArray> channels, SecurityOrigin* targetOrigin, PassRefPtr<ScriptCallStack> stackTrace)
+ PostMessageTimer(DOMWindow& window, PassRefPtr<SerializedScriptValue> message, const String& sourceOrigin, DOMWindow& source, std::unique_ptr<MessagePortChannelArray> channels, RefPtr<SecurityOrigin>&& targetOrigin, RefPtr<ScriptCallStack>&& stackTrace)
: m_window(window)
, m_message(message)
, m_origin(sourceOrigin)
, m_source(source)
, m_channels(WTFMove(channels))
- , m_targetOrigin(targetOrigin)
+ , m_targetOrigin(WTFMove(targetOrigin))
, m_stackTrace(stackTrace)
{
}
- Ref<MessageEvent> event(ScriptExecutionContext* context)
+ Ref<MessageEvent> event(ScriptExecutionContext& context)
{
- std::unique_ptr<MessagePortArray> messagePorts = MessagePort::entanglePorts(*context, WTFMove(m_channels));
- return MessageEvent::create(WTFMove(messagePorts), m_message, m_origin, String(), m_source);
+ return MessageEvent::create(MessagePort::entanglePorts(context, WTFMove(m_channels)), WTFMove(m_message), m_origin, { }, m_source.ptr());
}
SecurityOrigin* targetOrigin() const { return m_targetOrigin.get(); }
ScriptCallStack* stackTrace() const { return m_stackTrace.get(); }
@@ -171,10 +170,10 @@
m_window->postMessageTimerFired(*timer);
}
- RefPtr<DOMWindow> m_window;
+ Ref<DOMWindow> m_window;
RefPtr<SerializedScriptValue> m_message;
String m_origin;
- RefPtr<DOMWindow> m_source;
+ Ref<DOMWindow> m_source;
std::unique_ptr<MessagePortChannelArray> m_channels;
RefPtr<SecurityOrigin> m_targetOrigin;
RefPtr<ScriptCallStack> m_stackTrace;
@@ -899,7 +898,7 @@
}
}
- std::unique_ptr<MessagePortChannelArray> channels = MessagePort::disentanglePorts(ports, ec);
+ auto channels = MessagePort::disentanglePorts(ports, ec);
if (ec)
return;
@@ -915,7 +914,7 @@
stackTrace = createScriptCallStack(JSMainThreadExecState::currentState(), ScriptCallStack::maxCallStackSizeToCapture);
// Schedule the message.
- PostMessageTimer* timer = new PostMessageTimer(this, message, sourceOrigin, &source, WTFMove(channels), target.get(), stackTrace.release());
+ PostMessageTimer* timer = new PostMessageTimer(*this, message, sourceOrigin, source, WTFMove(channels), WTFMove(target), WTFMove(stackTrace));
timer->startOneShot(0);
}
@@ -924,7 +923,7 @@
if (!document() || !isCurrentlyDisplayedInFrame())
return;
- dispatchMessageEventWithOriginCheck(timer.targetOrigin(), timer.event(document()), timer.stackTrace());
+ dispatchMessageEventWithOriginCheck(timer.targetOrigin(), timer.event(*document()), timer.stackTrace());
}
void DOMWindow::dispatchMessageEventWithOriginCheck(SecurityOrigin* intendedTargetOrigin, Event& event, PassRefPtr<ScriptCallStack> stackTrace)
Modified: trunk/Source/WebCore/page/EventSource.cpp (199641 => 199642)
--- trunk/Source/WebCore/page/EventSource.cpp 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/page/EventSource.cpp 2016-04-17 18:39:13 UTC (rev 199642)
@@ -413,7 +413,7 @@
Ref<MessageEvent> EventSource::createMessageEvent()
{
- return MessageEvent::create(m_eventName.isEmpty() ? eventNames().messageEvent : AtomicString(m_eventName), false, false, SerializedScriptValue::create(String::adopt(m_data)), m_eventStreamOrigin, m_lastEventId);
+ return MessageEvent::create(m_eventName.isEmpty() ? eventNames().messageEvent : AtomicString(m_eventName), SerializedScriptValue::create(String::adopt(m_data)), m_eventStreamOrigin, m_lastEventId);
}
} // namespace WebCore
Modified: trunk/Source/WebCore/page/csp/ContentSecurityPolicy.h (199641 => 199642)
--- trunk/Source/WebCore/page/csp/ContentSecurityPolicy.h 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/page/csp/ContentSecurityPolicy.h 2016-04-17 18:39:13 UTC (rev 199642)
@@ -24,15 +24,17 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef ContentSecurityPolicy_h
-#define ContentSecurityPolicy_h
+#pragma once
#include "ContentSecurityPolicyResponseHeaders.h"
-#include "ScriptState.h"
#include <wtf/OptionSet.h>
#include <wtf/Vector.h>
#include <wtf/text/TextPosition.h>
+namespace JSC {
+class ExecState;
+}
+
namespace WTF {
class OrdinalNumber;
}
@@ -43,6 +45,7 @@
class ContentSecurityPolicyDirectiveList;
class ContentSecurityPolicySource;
class DOMStringList;
+class Frame;
class JSDOMWindowShell;
class ScriptExecutionContext;
class SecurityOrigin;
@@ -184,5 +187,3 @@
}
}
-
-#endif
Modified: trunk/Source/WebCore/page/csp/ContentSecurityPolicyDirectiveList.h (199641 => 199642)
--- trunk/Source/WebCore/page/csp/ContentSecurityPolicyDirectiveList.h 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/page/csp/ContentSecurityPolicyDirectiveList.h 2016-04-17 18:39:13 UTC (rev 199642)
@@ -24,21 +24,20 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef ContentSecurityPolicyDirectiveList_h
-#define ContentSecurityPolicyDirectiveList_h
+#pragma once
#include "ContentSecurityPolicy.h"
#include "ContentSecurityPolicyHash.h"
#include "ContentSecurityPolicyMediaListDirective.h"
#include "ContentSecurityPolicySourceListDirective.h"
#include "URL.h"
-#include <wtf/Noncopyable.h>
namespace WebCore {
+class Frame;
+
class ContentSecurityPolicyDirectiveList {
WTF_MAKE_FAST_ALLOCATED;
- WTF_MAKE_NONCOPYABLE(ContentSecurityPolicyDirectiveList)
public:
static std::unique_ptr<ContentSecurityPolicyDirectiveList> create(ContentSecurityPolicy&, const String&, ContentSecurityPolicyHeaderType, ContentSecurityPolicy::PolicyFrom);
ContentSecurityPolicyDirectiveList(ContentSecurityPolicy&, ContentSecurityPolicyHeaderType);
@@ -125,5 +124,3 @@
};
} // namespace WebCore
-
-#endif /* ContentSecurityPolicyDirectiveList_h */
Modified: trunk/Source/WebCore/testing/Internals.cpp (199641 => 199642)
--- trunk/Source/WebCore/testing/Internals.cpp 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/testing/Internals.cpp 2016-04-17 18:39:13 UTC (rev 199642)
@@ -505,9 +505,9 @@
return styleChangeTypeToString(node.styleChangeType());
}
-String Internals::description(Deprecated::ScriptValue value)
+String Internals::description(JSC::JSValue value)
{
- return toString(value.jsValue());
+ return toString(value);
}
bool Internals::isPreloaded(const String& url)
@@ -1491,11 +1491,10 @@
mutable CodeBlock* m_codeBlock;
};
-String Internals::parserMetaData(Deprecated::ScriptValue value)
+String Internals::parserMetaData(JSC::JSValue code)
{
JSC::VM& vm = contextDocument()->vm();
JSC::ExecState* exec = vm.topCallFrame;
- JSC::JSValue code = value.jsValue();
ScriptExecutable* executable;
if (!code || code.isNull() || code.isUndefined()) {
@@ -2525,7 +2524,7 @@
RefPtr<ArrayBuffer> Internals::serializeObject(PassRefPtr<SerializedScriptValue> value) const
{
- Vector<uint8_t> bytes = value->data();
+ auto& bytes = value->data();
return ArrayBuffer::create(bytes.data(), bytes.size());
}
@@ -2536,14 +2535,11 @@
return SerializedScriptValue::adopt(WTFMove(bytes));
}
-bool Internals::isFromCurrentWorld(Deprecated::ScriptValue value) const
+bool Internals::isFromCurrentWorld(JSC::JSValue value) const
{
- ASSERT(!value.hasNoValue());
-
- JSC::ExecState* exec = contextDocument()->vm().topCallFrame;
- if (!value.isObject() || &worldForDOMObject(value.jsValue().getObject()) == ¤tWorld(exec))
- return true;
- return false;
+ ASSERT(value);
+ JSC::ExecState& state = *contextDocument()->vm().topCallFrame;
+ return !value.isObject() || &worldForDOMObject(asObject(value)) == ¤tWorld(&state);
}
void Internals::setUsesOverlayScrollbars(bool enabled)
@@ -3281,7 +3277,7 @@
#if ENABLE(STREAMS_API)
-bool Internals::isReadableStreamDisturbed(ScriptState& state, JSValue stream)
+bool Internals::isReadableStreamDisturbed(JSC::ExecState& state, JSValue stream)
{
JSGlobalObject* globalObject = state.vmEntryGlobalObject();
JSVMClientData* clientData = static_cast<JSVMClientData*>(state.vm().clientData);
Modified: trunk/Source/WebCore/testing/Internals.h (199641 => 199642)
--- trunk/Source/WebCore/testing/Internals.h 2016-04-17 18:04:20 UTC (rev 199641)
+++ trunk/Source/WebCore/testing/Internals.h 2016-04-17 18:39:13 UTC (rev 199642)
@@ -24,20 +24,12 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef Internals_h
-#define Internals_h
+#pragma once
#include "CSSComputedStyleDeclaration.h"
#include "ContextDestructionObserver.h"
-#include "ExceptionCodePlaceholder.h"
-#include "NodeList.h"
#include "PageConsoleClient.h"
-#include "ScriptState.h"
-#include <bindings/ScriptValue.h>
-#include <runtime/ArrayBuffer.h>
#include <runtime/Float32Array.h>
-#include <wtf/RefCounted.h>
-#include <wtf/text/WTFString.h>
namespace WebCore {
@@ -65,6 +57,7 @@
class MockContentFilterSettings;
class MockPageOverlay;
class Node;
+class NodeList;
class Page;
class Range;
class RenderedDocumentMarker;
@@ -77,7 +70,7 @@
typedef int ExceptionCode;
-class Internals : public RefCounted<Internals>, public ContextDestructionObserver {
+class Internals final : public RefCounted<Internals>, private ContextDestructionObserver {
public:
static Ref<Internals> create(Document&);
virtual ~Internals();
@@ -90,7 +83,7 @@
String address(Node&);
bool nodeNeedsStyleRecalc(Node&);
String styleChangeType(Node&);
- String description(Deprecated::ScriptValue);
+ String description(JSC::JSValue);
bool isPreloaded(const String& url);
bool isLoadingFromMemoryCache(const String& url);
@@ -208,7 +201,7 @@
RefPtr<NodeList> nodesFromRect(Document&, int x, int y, unsigned topPadding, unsigned rightPadding,
unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allowShadowContent, bool allowChildFrameContent, ExceptionCode&) const;
- String parserMetaData(Deprecated::ScriptValue = Deprecated::ScriptValue());
+ String parserMetaData(JSC::JSValue = { });
void updateEditorUINowIfScheduled();
@@ -291,8 +284,8 @@
Vector<String> shortcutIconURLs() const;
int numberOfPages(float pageWidthInPixels = 800, float pageHeightInPixels = 600);
- String pageProperty(String, int, ExceptionCode& = ASSERT_NO_EXCEPTION) const;
- String pageSizeAndMarginsInPixels(int, int, int, int, int, int, int, ExceptionCode& = ASSERT_NO_EXCEPTION) const;
+ String pageProperty(String, int, ExceptionCode&) const;
+ String pageSizeAndMarginsInPixels(int, int, int, int, int, int, int, ExceptionCode&) const;
void setPageScaleFactor(float scaleFactor, int x, int y, ExceptionCode&);
void setPageZoomFactor(float zoomFactor, ExceptionCode&);
@@ -344,7 +337,7 @@
RefPtr<ArrayBuffer> serializeObject(PassRefPtr<SerializedScriptValue>) const;
RefPtr<SerializedScriptValue> deserializeBuffer(ArrayBuffer&) const;
- bool isFromCurrentWorld(Deprecated::ScriptValue) const;
+ bool isFromCurrentWorld(JSC::JSValue) const;
void setUsesOverlayScrollbars(bool);
void setUsesMockScrollAnimator(bool);
@@ -472,7 +465,7 @@
void setResourceLoadStatisticsEnabled(bool);
#if ENABLE(STREAMS_API)
- bool isReadableStreamDisturbed(ScriptState&, JSC::JSValue);
+ bool isReadableStreamDisturbed(JSC::ExecState&, JSC::JSValue);
#endif
String composedTreeAsText(Node&);
@@ -490,5 +483,3 @@
};
} // namespace WebCore
-
-#endif