Commit cec48c8f authored by Hwanseung Lee's avatar Hwanseung Lee Committed by Commit Bot

make a static-only class for DOMWindowTimers instead of namespace

Namespace should be lower-cased. DOMWindowTimers Namespace also
should be lower-cased,
and it is used to [ImplementedAs] to implement WindowTimers.
According to Blink IDL extended attributes[1],
it doesn't mention class name's rule.
so it looks like not violate to use snake_case in any rules.

However this CL makes DOMWindowTimers a static-only class
because ImplementedAs=dom_window_timers is inconsistent
with other ImplementedAs instances.

This CL has no behavior changes.

[1]https://chromium.googlesource.com/chromium/src/+/HEAD/third_party/blink/renderer/bindings/IDLExtendedAttributes.md#ImplementedAs_i_m_s_a

Bug: None
Change-Id: Ia1d7305ebc28feb0c50d6b406ab381998959038e
Reviewed-on: https://chromium-review.googlesource.com/c/1307533
Commit-Queue: Hwanseung Lee <hs1217.lee@samsung.com>
Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605231}
parent 5b5ea84e
......@@ -46,8 +46,6 @@
namespace blink {
namespace DOMWindowTimers {
static bool IsAllowed(ScriptState* script_state,
ExecutionContext* execution_context,
bool is_eval,
......@@ -82,7 +80,7 @@ static bool IsAllowed(ScriptState* script_state,
return false;
}
int setTimeout(ScriptState* script_state,
int DOMWindowTimers::setTimeout(ScriptState* script_state,
EventTarget& event_target,
const ScriptValue& handler,
int timeout,
......@@ -101,7 +99,8 @@ int setTimeout(ScriptState* script_state,
TimeDelta::FromMilliseconds(timeout), true);
}
int setTimeout(ScriptState* script_state,
int DOMWindowTimers::setTimeout(
ScriptState* script_state,
EventTarget& event_target,
const StringOrTrustedScript& string_or_trusted_script,
int timeout,
......@@ -119,7 +118,7 @@ int setTimeout(ScriptState* script_state,
arguments);
}
int setTimeoutFromString(ScriptState* script_state,
int DOMWindowTimers::setTimeoutFromString(ScriptState* script_state,
EventTarget& event_target,
const String& handler,
int timeout,
......@@ -142,7 +141,7 @@ int setTimeoutFromString(ScriptState* script_state,
TimeDelta::FromMilliseconds(timeout), true);
}
int setInterval(ScriptState* script_state,
int DOMWindowTimers::setInterval(ScriptState* script_state,
EventTarget& event_target,
const ScriptValue& handler,
int timeout,
......@@ -156,7 +155,8 @@ int setInterval(ScriptState* script_state,
TimeDelta::FromMilliseconds(timeout), false);
}
int setInterval(ScriptState* script_state,
int DOMWindowTimers::setInterval(
ScriptState* script_state,
EventTarget& event_target,
const StringOrTrustedScript& string_or_trusted_script,
int timeout,
......@@ -174,7 +174,7 @@ int setInterval(ScriptState* script_state,
arguments);
}
int setIntervalFromString(ScriptState* script_state,
int DOMWindowTimers::setIntervalFromString(ScriptState* script_state,
EventTarget& event_target,
const String& handler,
int timeout,
......@@ -192,16 +192,14 @@ int setIntervalFromString(ScriptState* script_state,
TimeDelta::FromMilliseconds(timeout), false);
}
void clearTimeout(EventTarget& event_target, int timeout_id) {
void DOMWindowTimers::clearTimeout(EventTarget& event_target, int timeout_id) {
if (ExecutionContext* context = event_target.GetExecutionContext())
DOMTimer::RemoveByID(context, timeout_id);
}
void clearInterval(EventTarget& event_target, int timeout_id) {
void DOMWindowTimers::clearInterval(EventTarget& event_target, int timeout_id) {
if (ExecutionContext* context = event_target.GetExecutionContext())
DOMTimer::RemoveByID(context, timeout_id);
}
} // namespace DOMWindowTimers
} // namespace blink
......@@ -33,6 +33,7 @@
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_DOM_WINDOW_TIMERS_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_DOM_WINDOW_TIMERS_H_
#include "third_party/blink/renderer/platform/wtf/allocator.h"
#include "third_party/blink/renderer/platform/wtf/forward.h"
#include "third_party/blink/renderer/platform/wtf/vector.h"
......@@ -44,42 +45,45 @@ class ScriptState;
class ScriptValue;
class StringOrTrustedScript;
namespace DOMWindowTimers {
int setTimeout(ScriptState*,
class DOMWindowTimers {
STATIC_ONLY(DOMWindowTimers);
public:
static int setTimeout(ScriptState*,
EventTarget&,
const ScriptValue& handler,
int timeout,
const Vector<ScriptValue>& arguments);
int setTimeout(ScriptState*,
static int setTimeout(ScriptState*,
EventTarget&,
const StringOrTrustedScript&,
int timeout,
const Vector<ScriptValue>&,
ExceptionState&);
int setTimeoutFromString(ScriptState*,
static int setTimeoutFromString(ScriptState*,
EventTarget&,
const String& handler,
int timeout,
const Vector<ScriptValue>&);
int setInterval(ScriptState*,
static int setInterval(ScriptState*,
EventTarget&,
const ScriptValue& handler,
int timeout,
const Vector<ScriptValue>&);
int setInterval(ScriptState*,
static int setInterval(ScriptState*,
EventTarget&,
const StringOrTrustedScript&,
int timeout,
const Vector<ScriptValue>&,
ExceptionState&);
int setIntervalFromString(ScriptState*,
static int setIntervalFromString(ScriptState*,
EventTarget&,
const String& handler,
int timeout,
const Vector<ScriptValue>&);
void clearTimeout(EventTarget&, int timeout_id);
void clearInterval(EventTarget&, int timeout_id);
}
static void clearTimeout(EventTarget&, int timeout_id);
static void clearInterval(EventTarget&, int timeout_id);
};
} // 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