Commit 801e56a8 authored by bashi@chromium.org's avatar bashi@chromium.org

Simplify Dictionary::ConversionContext

- Nobody uses the forConstructor().
- m_interfaceName and m_methodName are passed, but nobody uses them.

BUG=433174

Review URL: https://codereview.chromium.org/724183004

git-svn-id: svn://svn.chromium.org/blink/trunk@185360 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 8f86fcbd
...@@ -76,18 +76,13 @@ public: ...@@ -76,18 +76,13 @@ public:
class ConversionContext { class ConversionContext {
public: public:
ConversionContext(const String& interfaceName, const String& methodName, ExceptionState& exceptionState) explicit ConversionContext(ExceptionState& exceptionState)
: m_interfaceName(interfaceName) : m_exceptionState(exceptionState)
, m_methodName(methodName)
, m_exceptionState(exceptionState)
, m_dirty(true) , m_dirty(true)
{ {
resetPerPropertyContext(); resetPerPropertyContext();
} }
const String& interfaceName() const { return m_interfaceName; }
const String& methodName() const { return m_methodName; }
bool forConstructor() const { return m_methodName.isEmpty(); }
ExceptionState& exceptionState() const { return m_exceptionState; } ExceptionState& exceptionState() const { return m_exceptionState; }
bool isNullable() const { return m_isNullable; } bool isNullable() const { return m_isNullable; }
...@@ -100,8 +95,6 @@ public: ...@@ -100,8 +95,6 @@ public:
void resetPerPropertyContext(); void resetPerPropertyContext();
private: private:
const String m_interfaceName;
const String m_methodName;
ExceptionState& m_exceptionState; ExceptionState& m_exceptionState;
bool m_dirty; bool m_dirty;
...@@ -111,7 +104,7 @@ public: ...@@ -111,7 +104,7 @@ public:
class ConversionContextScope { class ConversionContextScope {
public: public:
ConversionContextScope(ConversionContext& context) explicit ConversionContextScope(ConversionContext& context)
: m_context(context) { } : m_context(context) { }
~ConversionContextScope() ~ConversionContextScope()
{ {
......
...@@ -617,11 +617,11 @@ static const V8DOMConfiguration::AttributeConfiguration shadowAttributes[] = { ...@@ -617,11 +617,11 @@ static const V8DOMConfiguration::AttributeConfiguration shadowAttributes[] = {
{##############################################################################} {##############################################################################}
{% block initialize_event %} {% block initialize_event %}
{% if has_event_constructor %} {% if has_event_constructor %}
bool initialize{{cpp_class}}({{cpp_class}}Init& eventInit, const Dictionary& options, ExceptionState& exceptionState, const v8::FunctionCallbackInfo<v8::Value>& info, const String& forEventName) bool initialize{{cpp_class}}({{cpp_class}}Init& eventInit, const Dictionary& options, ExceptionState& exceptionState, const v8::FunctionCallbackInfo<v8::Value>& info)
{ {
Dictionary::ConversionContext conversionContext(forEventName.isEmpty() ? String("{{interface_name}}") : forEventName, "", exceptionState); Dictionary::ConversionContext conversionContext(exceptionState);
{% if parent_interface %}{# any Event interface except Event itself #} {% if parent_interface %}{# any Event interface except Event itself #}
if (!initialize{{parent_interface}}(eventInit, options, exceptionState, info, forEventName.isEmpty() ? String("{{interface_name}}") : forEventName)) if (!initialize{{parent_interface}}(eventInit, options, exceptionState, info))
return false; return false;
{% endif %} {% endif %}
......
...@@ -235,7 +235,7 @@ inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, {{cpp_class}} ...@@ -235,7 +235,7 @@ inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, {{cpp_class}}
{% endif %}{# has_custom_to_v8 #} {% endif %}{# has_custom_to_v8 #}
{% if has_event_constructor %} {% if has_event_constructor %}
bool initialize{{cpp_class}}({{cpp_class}}Init&, const Dictionary&, ExceptionState&, const v8::FunctionCallbackInfo<v8::Value>& info, const String& = ""); bool initialize{{cpp_class}}({{cpp_class}}Init&, const Dictionary&, ExceptionState&, const v8::FunctionCallbackInfo<v8::Value>& info);
{% endif %} {% endif %}
} // namespace blink } // namespace blink
......
...@@ -279,10 +279,10 @@ static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceEventCons ...@@ -279,10 +279,10 @@ static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceEventCons
{"deprecatedImplementedAsInitializedByEventConstructorReadonlyStringAttribute", TestInterfaceEventConstructorV8Internal::deprecatedImplementedAsInitializedByEventConstructorReadonlyStringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, {"deprecatedImplementedAsInitializedByEventConstructorReadonlyStringAttribute", TestInterfaceEventConstructorV8Internal::deprecatedImplementedAsInitializedByEventConstructorReadonlyStringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance},
}; };
bool initializeTestInterfaceEventConstructor(TestInterfaceEventConstructorInit& eventInit, const Dictionary& options, ExceptionState& exceptionState, const v8::FunctionCallbackInfo<v8::Value>& info, const String& forEventName) bool initializeTestInterfaceEventConstructor(TestInterfaceEventConstructorInit& eventInit, const Dictionary& options, ExceptionState& exceptionState, const v8::FunctionCallbackInfo<v8::Value>& info)
{ {
Dictionary::ConversionContext conversionContext(forEventName.isEmpty() ? String("TestInterfaceEventConstructor") : forEventName, "", exceptionState); Dictionary::ConversionContext conversionContext(exceptionState);
if (!initializeEvent(eventInit, options, exceptionState, info, forEventName.isEmpty() ? String("TestInterfaceEventConstructor") : forEventName)) if (!initializeEvent(eventInit, options, exceptionState, info))
return false; return false;
if (!DictionaryHelper::convert(options, conversionContext.setConversionType("DOMString", false), "initializedByEventConstructorReadonlyStringAttribute", eventInit.initializedByEventConstructorReadonlyStringAttribute)) if (!DictionaryHelper::convert(options, conversionContext.setConversionType("DOMString", false), "initializedByEventConstructorReadonlyStringAttribute", eventInit.initializedByEventConstructorReadonlyStringAttribute))
......
...@@ -47,7 +47,7 @@ public: ...@@ -47,7 +47,7 @@ public:
static void installConditionallyEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { } static void installConditionallyEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { }
}; };
bool initializeTestInterfaceEventConstructor(TestInterfaceEventConstructorInit&, const Dictionary&, ExceptionState&, const v8::FunctionCallbackInfo<v8::Value>& info, const String& = ""); bool initializeTestInterfaceEventConstructor(TestInterfaceEventConstructorInit&, const Dictionary&, ExceptionState&, const v8::FunctionCallbackInfo<v8::Value>& info);
} // namespace blink } // namespace blink
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment