mirror of
https://github.com/Tencent/Hippy.git
synced 2026-10-25 10:40:03 +08:00
* feat(devtools): add vfs network processor for devtools * feat(devtools): move vfs to devtools * fix(devtools): fix ios vfs for devtools include * fix(ios): remove inspectorSourceURLForBridge * chore(devtools): refactor vfs for devtools * feat(devtools): replace base64 lib * chore(devtools): adapter vfs intercept * feat(devtools): move vfs handler to devtools * fix(devtools): ios base64 compile error * feat(devtools): add base64 so include for ios * feat(devtools): move jni_env to outerside
62 lines
2.2 KiB
C++
62 lines
2.2 KiB
C++
/*
|
|
*
|
|
* Tencent is pleased to support the open source community by making
|
|
* Hippy available.
|
|
*
|
|
* Copyright (C) 2019 THL A29 Limited, a Tencent company.
|
|
* All rights reserved.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*
|
|
*/
|
|
#pragma once
|
|
|
|
#include "vfs/handler/uri_handler.h"
|
|
#include "api/notification/devtools_network_notification.h"
|
|
|
|
namespace hippy::devtools {
|
|
|
|
class DevtoolsHandler: public UriHandler {
|
|
using NetworkNotification = hippy::devtools::NetworkNotification;
|
|
public:
|
|
DevtoolsHandler() = default;
|
|
virtual ~DevtoolsHandler() = default;
|
|
|
|
virtual void RequestUntrustedContent(
|
|
std::shared_ptr<SyncContext> ctx,
|
|
std::function<std::shared_ptr<UriHandler>()> next) override;
|
|
virtual void RequestUntrustedContent(
|
|
std::shared_ptr<ASyncContext> ctx,
|
|
std::function<std::shared_ptr<UriHandler>()> next) override;
|
|
|
|
inline void SetNetworkNotification(std::shared_ptr<NetworkNotification> notification) {
|
|
network_notification_ = notification;
|
|
}
|
|
|
|
private:
|
|
std::shared_ptr<NetworkNotification> network_notification_;
|
|
};
|
|
|
|
void SentRequest(const std::shared_ptr<hippy::devtools::NetworkNotification>&,
|
|
const std::string& request_id,
|
|
std::string uri,
|
|
const std::unordered_map<std::string, std::string> &req_meta);
|
|
|
|
void ReceivedResponse(const std::shared_ptr<hippy::devtools::NetworkNotification>&,
|
|
const std::string& request_id,
|
|
int32_t code,
|
|
std::string content,
|
|
const std::unordered_map<std::string, std::string> &rsp_meta,
|
|
const std::unordered_map<std::string, std::string> &req_meta);
|
|
} // namespace hippy::devtools
|