Commit 1adac3e7 authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

Rename WindowTimers to WindowOrWorkerGlobalScope

 * window_tiemrs.idl -> window_or_worker_global_scope.idl
 * dom_window_timers.{cc,h} -> window_or_worker_global_scope.{cc,h}
 * blink::DOMWindowTimers -> blink::WindowOrWorkerGlobalScope

in order to match to the HTML standard.

This CL has no behavior changes.

Bug: 701499
Change-Id: Iec6fd1cca6d62d4292f6067047c97440d1d31a33
Reviewed-on: https://chromium-review.googlesource.com/c/1347968Reviewed-by: default avatarYuki Shiino <yukishiino@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610371}
parent 7c10d9bb
...@@ -540,7 +540,7 @@ core_dependency_idl_files = ...@@ -540,7 +540,7 @@ core_dependency_idl_files =
"frame/navigator_user_activation.idl", "frame/navigator_user_activation.idl",
"frame/window_base64.idl", "frame/window_base64.idl",
"frame/window_event_handlers.idl", "frame/window_event_handlers.idl",
"frame/window_timers.idl", "frame/window_or_worker_global_scope.idl",
"fullscreen/document_fullscreen.idl", "fullscreen/document_fullscreen.idl",
"fullscreen/element_fullscreen.idl", "fullscreen/element_fullscreen.idl",
"html/html_hyperlink_element_utils.idl", "html/html_hyperlink_element_utils.idl",
......
...@@ -44,8 +44,6 @@ blink_core_sources("frame") { ...@@ -44,8 +44,6 @@ blink_core_sources("frame") {
"dom_window.h", "dom_window.h",
"dom_window_base64.cc", "dom_window_base64.cc",
"dom_window_base64.h", "dom_window_base64.h",
"dom_window_timers.cc",
"dom_window_timers.h",
"embedded_content_view.h", "embedded_content_view.h",
"event_handler_registry.cc", "event_handler_registry.cc",
"event_handler_registry.h", "event_handler_registry.h",
...@@ -184,5 +182,7 @@ blink_core_sources("frame") { ...@@ -184,5 +182,7 @@ blink_core_sources("frame") {
"web_view_frame_widget.cc", "web_view_frame_widget.cc",
"web_view_frame_widget.h", "web_view_frame_widget.h",
"window_event_handlers.h", "window_event_handlers.h",
"window_or_worker_global_scope.cc",
"window_or_worker_global_scope.h",
] ]
} }
...@@ -234,4 +234,4 @@ ...@@ -234,4 +234,4 @@
Window implements GlobalEventHandlers; Window implements GlobalEventHandlers;
Window implements WindowBase64; Window implements WindowBase64;
Window implements WindowEventHandlers; Window implements WindowEventHandlers;
Window implements WindowTimers; Window implements WindowOrWorkerGlobalScope;
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "third_party/blink/renderer/core/frame/dom_window_timers.h" #include "third_party/blink/renderer/core/frame/window_or_worker_global_scope.h"
#include "third_party/blink/renderer/bindings/core/v8/string_or_trusted_script.h" #include "third_party/blink/renderer/bindings/core/v8/string_or_trusted_script.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_gc_for_context_dispose.h" #include "third_party/blink/renderer/bindings/core/v8/v8_gc_for_context_dispose.h"
...@@ -80,11 +80,12 @@ static bool IsAllowed(ScriptState* script_state, ...@@ -80,11 +80,12 @@ static bool IsAllowed(ScriptState* script_state,
return false; return false;
} }
int DOMWindowTimers::setTimeout(ScriptState* script_state, int WindowOrWorkerGlobalScope::setTimeout(
EventTarget& event_target, ScriptState* script_state,
const ScriptValue& handler, EventTarget& event_target,
int timeout, const ScriptValue& handler,
const Vector<ScriptValue>& arguments) { int timeout,
const Vector<ScriptValue>& arguments) {
ExecutionContext* execution_context = event_target.GetExecutionContext(); ExecutionContext* execution_context = event_target.GetExecutionContext();
if (!IsAllowed(script_state, execution_context, false, g_empty_string)) if (!IsAllowed(script_state, execution_context, false, g_empty_string))
return 0; return 0;
...@@ -99,7 +100,7 @@ int DOMWindowTimers::setTimeout(ScriptState* script_state, ...@@ -99,7 +100,7 @@ int DOMWindowTimers::setTimeout(ScriptState* script_state,
TimeDelta::FromMilliseconds(timeout), true); TimeDelta::FromMilliseconds(timeout), true);
} }
int DOMWindowTimers::setTimeout( int WindowOrWorkerGlobalScope::setTimeout(
ScriptState* script_state, ScriptState* script_state,
EventTarget& event_target, EventTarget& event_target,
const StringOrTrustedScript& string_or_trusted_script, const StringOrTrustedScript& string_or_trusted_script,
...@@ -118,11 +119,12 @@ int DOMWindowTimers::setTimeout( ...@@ -118,11 +119,12 @@ int DOMWindowTimers::setTimeout(
arguments); arguments);
} }
int DOMWindowTimers::setTimeoutFromString(ScriptState* script_state, int WindowOrWorkerGlobalScope::setTimeoutFromString(
EventTarget& event_target, ScriptState* script_state,
const String& handler, EventTarget& event_target,
int timeout, const String& handler,
const Vector<ScriptValue>&) { int timeout,
const Vector<ScriptValue>&) {
ExecutionContext* execution_context = event_target.GetExecutionContext(); ExecutionContext* execution_context = event_target.GetExecutionContext();
if (!IsAllowed(script_state, execution_context, true, handler)) if (!IsAllowed(script_state, execution_context, true, handler))
return 0; return 0;
...@@ -141,11 +143,12 @@ int DOMWindowTimers::setTimeoutFromString(ScriptState* script_state, ...@@ -141,11 +143,12 @@ int DOMWindowTimers::setTimeoutFromString(ScriptState* script_state,
TimeDelta::FromMilliseconds(timeout), true); TimeDelta::FromMilliseconds(timeout), true);
} }
int DOMWindowTimers::setInterval(ScriptState* script_state, int WindowOrWorkerGlobalScope::setInterval(
EventTarget& event_target, ScriptState* script_state,
const ScriptValue& handler, EventTarget& event_target,
int timeout, const ScriptValue& handler,
const Vector<ScriptValue>& arguments) { int timeout,
const Vector<ScriptValue>& arguments) {
ExecutionContext* execution_context = event_target.GetExecutionContext(); ExecutionContext* execution_context = event_target.GetExecutionContext();
if (!IsAllowed(script_state, execution_context, false, g_empty_string)) if (!IsAllowed(script_state, execution_context, false, g_empty_string))
return 0; return 0;
...@@ -155,7 +158,7 @@ int DOMWindowTimers::setInterval(ScriptState* script_state, ...@@ -155,7 +158,7 @@ int DOMWindowTimers::setInterval(ScriptState* script_state,
TimeDelta::FromMilliseconds(timeout), false); TimeDelta::FromMilliseconds(timeout), false);
} }
int DOMWindowTimers::setInterval( int WindowOrWorkerGlobalScope::setInterval(
ScriptState* script_state, ScriptState* script_state,
EventTarget& event_target, EventTarget& event_target,
const StringOrTrustedScript& string_or_trusted_script, const StringOrTrustedScript& string_or_trusted_script,
...@@ -174,11 +177,12 @@ int DOMWindowTimers::setInterval( ...@@ -174,11 +177,12 @@ int DOMWindowTimers::setInterval(
arguments); arguments);
} }
int DOMWindowTimers::setIntervalFromString(ScriptState* script_state, int WindowOrWorkerGlobalScope::setIntervalFromString(
EventTarget& event_target, ScriptState* script_state,
const String& handler, EventTarget& event_target,
int timeout, const String& handler,
const Vector<ScriptValue>&) { int timeout,
const Vector<ScriptValue>&) {
ExecutionContext* execution_context = event_target.GetExecutionContext(); ExecutionContext* execution_context = event_target.GetExecutionContext();
if (!IsAllowed(script_state, execution_context, true, handler)) if (!IsAllowed(script_state, execution_context, true, handler))
return 0; return 0;
...@@ -192,12 +196,14 @@ int DOMWindowTimers::setIntervalFromString(ScriptState* script_state, ...@@ -192,12 +196,14 @@ int DOMWindowTimers::setIntervalFromString(ScriptState* script_state,
TimeDelta::FromMilliseconds(timeout), false); TimeDelta::FromMilliseconds(timeout), false);
} }
void DOMWindowTimers::clearTimeout(EventTarget& event_target, int timeout_id) { void WindowOrWorkerGlobalScope::clearTimeout(EventTarget& event_target,
int timeout_id) {
if (ExecutionContext* context = event_target.GetExecutionContext()) if (ExecutionContext* context = event_target.GetExecutionContext())
DOMTimer::RemoveByID(context, timeout_id); DOMTimer::RemoveByID(context, timeout_id);
} }
void DOMWindowTimers::clearInterval(EventTarget& event_target, int timeout_id) { void WindowOrWorkerGlobalScope::clearInterval(EventTarget& event_target,
int timeout_id) {
if (ExecutionContext* context = event_target.GetExecutionContext()) if (ExecutionContext* context = event_target.GetExecutionContext())
DOMTimer::RemoveByID(context, timeout_id); DOMTimer::RemoveByID(context, timeout_id);
} }
......
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_DOM_WINDOW_TIMERS_H_ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_WINDOW_OR_WORKER_GLOBAL_SCOPE_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_DOM_WINDOW_TIMERS_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_WINDOW_OR_WORKER_GLOBAL_SCOPE_H_
#include "third_party/blink/renderer/platform/wtf/allocator.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/forward.h"
...@@ -45,8 +45,8 @@ class ScriptState; ...@@ -45,8 +45,8 @@ class ScriptState;
class ScriptValue; class ScriptValue;
class StringOrTrustedScript; class StringOrTrustedScript;
class DOMWindowTimers { class WindowOrWorkerGlobalScope {
STATIC_ONLY(DOMWindowTimers); STATIC_ONLY(WindowOrWorkerGlobalScope);
public: public:
static int setTimeout(ScriptState*, static int setTimeout(ScriptState*,
...@@ -87,4 +87,4 @@ class DOMWindowTimers { ...@@ -87,4 +87,4 @@ class DOMWindowTimers {
} // namespace blink } // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_DOM_WINDOW_TIMERS_H_ #endif // THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_WINDOW_OR_WORKER_GLOBAL_SCOPE_H_
...@@ -29,11 +29,10 @@ ...@@ -29,11 +29,10 @@
// https://html.spec.whatwg.org/C/timers-and-user-prompts.html#timers // https://html.spec.whatwg.org/C/timers-and-user-prompts.html#timers
[ [
ImplementedAs=DOMWindowTimers,
LegacyTreatAsPartialInterface, LegacyTreatAsPartialInterface,
NoInterfaceObject, // Always used on target of 'implements' NoInterfaceObject, // Always used on target of 'implements'
Exposed=(Window,Worker) Exposed=(Window,Worker)
] interface WindowTimers { ] interface WindowOrWorkerGlobalScope {
// TODO(yukishiino): Use TimerHandler (or Function at least) to implement // TODO(yukishiino): Use TimerHandler (or Function at least) to implement
// setTimeout and setInterval. // setTimeout and setInterval.
// https://html.spec.whatwg.org/C/webappapis.html#windoworworkerglobalscope-mixin // https://html.spec.whatwg.org/C/webappapis.html#windoworworkerglobalscope-mixin
......
...@@ -80,6 +80,6 @@ ...@@ -80,6 +80,6 @@
}; };
WorkerGlobalScope implements WindowBase64; WorkerGlobalScope implements WindowBase64;
WorkerGlobalScope implements WindowTimers; WorkerGlobalScope implements WindowOrWorkerGlobalScope;
// TODO(fserb): this needs to be enabled once we get out of RuntimeEnabled. // TODO(fserb): this needs to be enabled once we get out of RuntimeEnabled.
//WorkerGlobalScope implements FontFaceSource; //WorkerGlobalScope implements FontFaceSource;
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