blob: eda4fbba9e454c03f99979be853842fa023d701e [file] [log] [blame]
joepeck@webkit.orgfbdc00d2014-01-25 17:48:16 +00001/*
bburg@apple.com84eff9e2015-09-05 16:06:23 +00002 * Copyright (C) 2014, 2015 Apple Inc. All rights reserved.
joepeck@webkit.orgfbdc00d2014-01-25 17:48:16 +00003 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
commit-queue@webkit.org35dd3012016-08-15 20:55:16 +000026#pragma once
joepeck@webkit.orgfbdc00d2014-01-25 17:48:16 +000027
annulen@yandex.ru6712c2d2017-06-25 17:40:30 +000028#include "InspectorFrontendDispatchers.h"
joepeck@webkit.orgfbdc00d2014-01-25 17:48:16 +000029#include "InspectorRuntimeAgent.h"
joepeck@webkit.orgfbdc00d2014-01-25 17:48:16 +000030
31namespace JSC {
32class JSGlobalObject;
33}
34
35namespace Inspector {
36
37class JSGlobalObjectRuntimeAgent final : public InspectorRuntimeAgent {
commit-queue@webkit.org6a4af632017-11-29 07:26:41 +000038 WTF_MAKE_NONCOPYABLE(JSGlobalObjectRuntimeAgent);
39 WTF_MAKE_FAST_ALLOCATED;
joepeck@webkit.orgfbdc00d2014-01-25 17:48:16 +000040public:
bburg@apple.comd81c28d2015-09-05 18:52:16 +000041 JSGlobalObjectRuntimeAgent(JSAgentContext&);
joepeck@webkit.orgfbdc00d2014-01-25 17:48:16 +000042
darin@apple.com11ff47c2016-03-04 16:47:55 +000043 void didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*) override;
joepeck@webkit.orgfbdc00d2014-01-25 17:48:16 +000044
darin@apple.com11ff47c2016-03-04 16:47:55 +000045 InjectedScript injectedScriptForEval(ErrorString&, const int* executionContextId) override;
joepeck@webkit.orgfbdc00d2014-01-25 17:48:16 +000046
commit-queue@webkit.org24490412014-04-08 22:46:10 +000047 // NOTE: JavaScript inspector does not yet need to mute a console because no messages
48 // are sent to the console outside of the API boundary or console object.
darin@apple.com11ff47c2016-03-04 16:47:55 +000049 void muteConsole() override { }
50 void unmuteConsole() override { }
joepeck@webkit.orgfbdc00d2014-01-25 17:48:16 +000051
52private:
burg@cs.washington.edu91ba8732015-02-14 23:25:53 +000053 std::unique_ptr<RuntimeFrontendDispatcher> m_frontendDispatcher;
54 RefPtr<RuntimeBackendDispatcher> m_backendDispatcher;
joepeck@webkit.orgfbdc00d2014-01-25 17:48:16 +000055 JSC::JSGlobalObject& m_globalObject;
56};
57
58} // namespace Inspector