<commit_before>#ifndef CEF_TESTS_CEFCLIENT_NATIVE_HANDLER_H_
#define CEF_TESTS_CEFCLIENT_NATIVE_HANDLER_H_

#include "include/cef_base.h"
#include "include/cef_v8.h"
#include <string>
#include <map>

struct CallbackContext {
	CefRefPtr<CefV8Context> context;
	CefRefPtr<CefV8Value> function;
	CefRefPtr<CefV8Value> eventTypes;
};

struct NotifyContext {
	int descriptor;
	std::map<int, std::map<std::string, CallbackContext> > callbacks;
};

class NativeHandler: public CefV8Handler {
public:
	NativeHandler();

	CefRefPtr<CefV8Value> object;

	GtkWidget* window;

	std::string path;

	int notifyFd;

	unsigned long int idCounter;

	std::map<int, std::map<std::string, CallbackContext> > pathCallbacks;

	std::map<std::string, int> pathDescriptors;

	virtual bool Execute(const CefString& name, CefRefPtr<CefV8Value> object,
			const CefV8ValueList& arguments, CefRefPtr<CefV8Value>& retval,
			CefString& exception);

	void NotifyWatchers();

IMPLEMENT_REFCOUNTING(NativeHandler)
	;

private:
	void Exists(const CefString& name, CefRefPtr<CefV8Value> object,
			const CefV8ValueList& arguments, CefRefPtr<CefV8Value>& retval,
			CefString& exception);

	void Read(const CefString& name, CefRefPtr<CefV8Value> object,
			const CefV8ValueList& arguments, CefRefPtr<CefV8Value>& retval,
			CefString& exception);

	void Absolute(const CefString& name, CefRefPtr<CefV8Value> object,
			const CefV8ValueList& arguments, CefRefPtr<CefV8Value>& retval,
			CefString& exception);

	void List(const CefString& name, CefRefPtr<CefV8Value> object,
			const CefV8ValueList& arguments, CefRefPtr<CefV8Value>& retval,
			CefString& exception);

	void AsyncList(const CefString& name, CefRefPtr<CefV8Value> object,
			const CefV8ValueList& arguments, CefRefPtr<CefV8Value>& retval,
			CefString& exception);

	void IsFile(const CefString& name, CefRefPtr<CefV8Value> object,
			const CefV8ValueList& arguments, CefRefPtr<CefV8Value>& retval,
			CefString& exception);

	void IsDirectory(const CefString& name, CefRefPtr<CefV8Value> object,
			const CefV8ValueList& arguments, CefRefPtr<CefV8Value>& retval,
			CefString& exception);
<commit_msg>Make path watching fields private<commit_after>#ifndef CEF_TESTS_CEFCLIENT_NATIVE_HANDLER_H_
#define CEF_TESTS_CEFCLIENT_NATIVE_HANDLER_H_

#include "include/cef_base.h"
#include "include/cef_v8.h"
#include <string>
#include <map>

struct CallbackContext {
	CefRefPtr<CefV8Context> context;
	CefRefPtr<CefV8Value> function;
	CefRefPtr<CefV8Value> eventTypes;
};

struct NotifyContext {
	int descriptor;
	std::map<int, std::map<std::string, CallbackContext> > callbacks;
};

class NativeHandler: public CefV8Handler {
public:
	NativeHandler();

	CefRefPtr<CefV8Value> object;

	GtkWidget* window;

	std::string path;

	virtual bool Execute(const CefString& name, CefRefPtr<CefV8Value> object,
			const CefV8ValueList& arguments, CefRefPtr<CefV8Value>& retval,
			CefString& exception);

	void NotifyWatchers();

IMPLEMENT_REFCOUNTING(NativeHandler)
	;

private:

	int notifyFd;

	unsigned long int idCounter;

	std::map<int, std::map<std::string, CallbackContext> > pathCallbacks;

	std::map<std::string, int> pathDescriptors;

	void Exists(const CefString& name, CefRefPtr<CefV8Value> object,
			const CefV8ValueList& arguments, CefRefPtr<CefV8Value>& retval,
			CefString& exception);

	void Read(const CefString& name, CefRefPtr<CefV8Value> object,
			const CefV8ValueList& arguments, CefRefPtr<CefV8Value>& retval,
			CefString& exception);

	void Absolute(const CefString& name, CefRefPtr<CefV8Value> object,
			const CefV8ValueList& arguments, CefRefPtr<CefV8Value>& retval,
			CefString& exception);

	void List(const CefString& name, CefRefPtr<CefV8Value> object,
			const CefV8ValueList& arguments, CefRefPtr<CefV8Value>& retval,
			CefString& exception);

	void AsyncList(const CefString& name, CefRefPtr<CefV8Value> object,
			const CefV8ValueList& arguments, CefRefPtr<CefV8Value>& retval,
			CefString& exception);

	void IsFile(const CefString& name, CefRefPtr<CefV8Value> object,
			const CefV8ValueList& arguments, CefRefPtr<CefV8Value>& retval,
			CefString& exception);

	void IsDirectory(const CefString& name, CefRefPtr<CefV8Value> object,
			const CefV8ValueList& arguments, CefRefPtr<CefV8Value>& retval,
			CefString& exception);

{'fraction_non_alphanumeric': 0.0999299556385711, 'fraction_numerical': 0.014008872285780995, 'mean_word_length': 6.962825278810409, 'pattern_counts': {'":': 0, '<': 57, '<?xml version=': 0, '>': 57, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7629566', 'n_tokens_mistral': 1684, 'n_tokens_neox': 1608, 'n_words': 328}