PHP 7.4.33
Preview: FallbackRuntimeAgentDelegate.h Size: 2.28 KB
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/react-native/ReactCommon/jsinspector-modern/FallbackRuntimeAgentDelegate.h
/*
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

#pragma once

#include "SessionState.h"

#include <jsinspector-modern/InspectorInterfaces.h>
#include <jsinspector-modern/RuntimeAgent.h>

namespace facebook::react::jsinspector_modern {

/**
 * A RuntimeAgentDelegate that handles requests from the Chrome DevTools
 * Protocol for a JavaScript runtime that does not support debugging.
 */
class FallbackRuntimeAgentDelegate : public RuntimeAgentDelegate {
 public:
  /**
   * \param frontendChannel A channel used to send responses and events to the
   * frontend.
   * \param sessionState The state of the current debugger session.
   * \param engineDescription A description of the JavaScript engine being
   * debugged. This string will be used in messages sent to the frontend.
   */
  FallbackRuntimeAgentDelegate(
      FrontendChannel frontendChannel,
      const SessionState& sessionState,
      std::string engineDescription);

  /**
   * Handle a CDP request.  The response will be sent over the provided
   * \c FrontendChannel synchronously or asynchronously.
   * \param req The parsed request.
   * \returns true if this agent has responded, or will respond asynchronously,
   * to the request (with either a success or error message). False if the
   * agent expects another agent to respond to the request instead.
   */
  bool handleRequest(const cdp::PreparsedRequest& req) override;

 private:
  /**
   * Send a user-facing message explaining that this is not a debuggable
   * runtime. You must ensure that the frontend has enabled Log notifications
   * (using Log.enable) prior to calling this function.
   */
  void sendFallbackRuntimeWarning();

  /**
   * Send a simple Log.entryAdded notification with the given text.
   * You must ensure that the frontend has enabled Log notifications (using
   * Log.enable) prior to calling this function. In Chrome DevTools, the message
   * will appear in the Console tab along with regular console messages.
   * \param text The text to send.
   */
  void sendWarningLogEntry(std::string_view text);

  FrontendChannel frontendChannel_;
  std::string engineDescription_;
};

} // namespace facebook::react::jsinspector_modern

Directory Contents

Dirs: 2 × Files: 54
Name Size Perms Modified Actions
tests DIR
- drwxr-xr-x 2025-03-28 11:04:41
Edit Download
tracing DIR
- drwxr-xr-x 2025-03-28 11:04:43
Edit Download
2.54 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
2.03 KB lrw-r--r-- 2025-03-28 11:04:39
Edit Download
3.49 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
1.02 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
1.26 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
1.13 KB lrw-r--r-- 2025-03-28 11:04:39
Edit Download
2.17 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
1.81 KB lrw-r--r-- 2025-03-28 11:04:39
Edit Download
3.01 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
500 B lrw-r--r-- 2025-03-28 11:04:39
Edit Download
512 B lrw-r--r-- 2025-03-28 11:04:41
Edit Download
2.10 KB lrw-r--r-- 2025-03-28 11:04:39
Edit Download
2.28 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
1.49 KB lrw-r--r-- 2025-03-28 11:04:39
Edit Download
1.31 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
1.27 KB lrw-r--r-- 2025-03-28 11:04:40
Edit Download
8.55 KB lrw-r--r-- 2025-03-28 11:04:39
Edit Download
3.77 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
445 B lrw-r--r-- 2025-03-28 11:04:41
Edit Download
8.41 KB lrw-r--r-- 2025-03-28 11:04:39
Edit Download
9.62 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
2.21 KB lrw-r--r-- 2025-03-28 11:04:39
Edit Download
1.65 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
5.07 KB lrw-r--r-- 2025-03-28 11:04:39
Edit Download
4.99 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
11.52 KB lrw-r--r-- 2025-03-28 11:04:39
Edit Download
2.71 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
3.80 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
1015 B lrw-r--r-- 2025-03-28 11:04:39
Edit Download
1.45 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
4.96 KB lrw-r--r-- 2025-03-28 11:04:39
Edit Download
2.08 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
2.63 KB lrw-r--r-- 2025-03-28 11:04:39
Edit Download
3.72 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
14.16 KB lrw-r--r-- 2025-03-28 11:04:39
Edit Download
8.33 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
2.51 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
544 B lrw-r--r-- 2025-03-28 11:04:41
Edit Download
5.77 KB lrw-r--r-- 2025-03-28 11:04:39
Edit Download
3.22 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
1.74 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
5.25 KB lrw-r--r-- 2025-03-28 11:04:39
Edit Download
9.06 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
15.77 KB lrw-r--r-- 2025-03-28 11:04:39
Edit Download
4.71 KB lrw-r--r-- 2025-03-28 11:04:39
Edit Download
2.78 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
2.02 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
855 B lrw-r--r-- 2025-03-28 11:04:41
Edit Download
1.79 KB lrw-r--r-- 2025-03-28 11:04:40
Edit Download
1.01 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
1.40 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
2.25 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
2.03 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
1.97 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
If ZipArchive is unavailable, a .tar will be created (no compression).