Skip to content

Commit

Permalink
Revert "Display a custom page for Dev Tools Discovery"
Browse files Browse the repository at this point in the history
This reverts commit 2e7030c.

Reverts #401. Based upon feedback from Warchamp, needs a bit more
discussion and a bit more time in the oven. Also realized I missed the
lack of RAII on that one string pointer.
  • Loading branch information
Lain-B committed May 23, 2023
1 parent 2e7030c commit 5c8c9e7
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 204 deletions.
38 changes: 0 additions & 38 deletions browser-app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,6 @@ CefRefPtr<CefBrowserProcessHandler> BrowserApp::GetBrowserProcessHandler()
return this;
}

CefRefPtr<CefResourceBundleHandler> BrowserApp::GetResourceBundleHandler()
{
return this;
}

BrowserApp::~BrowserApp()
{
if (devToolsFile != nullptr)
free(devToolsFile);
}

void BrowserApp::OnRegisterCustomSchemes(CefRawPtr<CefSchemeRegistrar> registrar)
{
registrar->AddCustomScheme("http",
Expand Down Expand Up @@ -418,33 +407,6 @@ bool BrowserApp::Execute(const CefString &name, CefRefPtr<CefV8Value>,
return true;
}

bool BrowserApp::GetDataResource(int resource_id, void *&data,
size_t &data_size)
{
if (resource_id == IDR_CEF_DEVTOOLS_DISCOVERY_PAGE &&
devToolsFile != nullptr) {
data = devToolsFile;
data_size = strlen(devToolsFile);
return true;
}
return false;
}

bool BrowserApp::GetLocalizedString(int, CefString &)
{
return false;
};

bool BrowserApp::GetDataResourceForScale(int, ScaleFactor, void *&, size_t &)
{
return false;
};

void BrowserApp::SetDevToolsFile(char *data)
{
devToolsFile = strdup(data);
}

#ifdef ENABLE_BROWSER_QT_LOOP
Q_DECLARE_METATYPE(MessageTask);
MessageObject messageObject;
Expand Down
16 changes: 0 additions & 16 deletions browser-app.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ extern void QueueBrowserTask(CefRefPtr<CefBrowser> browser, BrowserFunc func);
class BrowserApp : public CefApp,
public CefRenderProcessHandler,
public CefBrowserProcessHandler,
public CefResourceBundleHandler,
public CefV8Handler {

void ExecuteJSFunction(CefRefPtr<CefBrowser> browser,
Expand All @@ -78,21 +77,17 @@ class BrowserApp : public CefApp,
bool shared_texture_available;
CallbackMap callbackMap;
int callbackId;
char *devToolsFile;

public:
inline BrowserApp(bool shared_texture_available_ = false)
: shared_texture_available(shared_texture_available_)
{
}
~BrowserApp();

virtual CefRefPtr<CefRenderProcessHandler>
GetRenderProcessHandler() override;
virtual CefRefPtr<CefBrowserProcessHandler>
GetBrowserProcessHandler() override;
virtual CefRefPtr<CefResourceBundleHandler>
GetResourceBundleHandler() override;
virtual void OnBeforeChildProcessLaunch(
CefRefPtr<CefCommandLine> command_line) override;
virtual void OnRegisterCustomSchemes(
Expand All @@ -114,16 +109,6 @@ class BrowserApp : public CefApp,
CefRefPtr<CefV8Value> &retval,
CefString &exception) override;

/* CefResourceBundleHandler */
virtual bool GetDataResource(int resource_id, void *&data,
size_t &data_size) override;
virtual bool GetLocalizedString(int message_id,
CefString &string) override;
virtual bool GetDataResourceForScale(int resource_id,
ScaleFactor scale_factor,
void *&data,
size_t &data_size) override;

#ifdef ENABLE_BROWSER_QT_LOOP
virtual void OnScheduleMessagePumpWork(int64 delay_ms) override;
QTimer frameTimer;
Expand All @@ -138,7 +123,6 @@ class BrowserApp : public CefApp,
void SetDocumentVisibility(CefRefPtr<CefBrowser> browser,
bool isVisible);
#endif
void SetDevToolsFile(char *data);

IMPLEMENT_REFCOUNTING(BrowserApp);
};
2 changes: 0 additions & 2 deletions cef-headers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
#include <include/cef_render_process_handler.h>
#include <include/cef_request_context_handler.h>
#include <include/cef_jsdialog_handler.h>
#include <include/cef_resource_bundle_handler.h>
#include <include/cef_pack_resources.h>
#if defined(__APPLE__)
#include "include/wrapper/cef_library_loader.h"
#endif
Expand Down
144 changes: 0 additions & 144 deletions data/dev_tools_discovery.html

This file was deleted.

4 changes: 0 additions & 4 deletions obs-browser-plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,10 +387,6 @@ static void BrowserInit(void)

app = new BrowserApp(tex_sharing_avail);

BPtr<char> pagesPath = obs_module_file("dev_tools_discovery.html");
BPtr<char> pagesFile = os_quick_read_utf8_file(pagesPath);
app->SetDevToolsFile(pagesFile);

#ifdef _WIN32
CefExecuteProcess(args, app, nullptr);
#endif
Expand Down

0 comments on commit 5c8c9e7

Please sign in to comment.