Skip to content

Commit

Permalink
Verstion 10.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bablosoft committed May 16, 2016
0 parents commit 5ef313c
Show file tree
Hide file tree
Showing 1,147 changed files with 146,593 additions and 0 deletions.
98 changes: 98 additions & 0 deletions ChromeWorker/ChromeWorker.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
TEMPLATE = app
CONFIG += windows
CONFIG -= app_bundle
CONFIG -= qt

DEFINES+=CURL_STATICLIB
SOURCES += main.cpp \
mainapp.cpp \
mainhandler.cpp \
pipesclient.cpp \
log.cpp \
commandparser.cpp \
proxydata.cpp \
xml_encoder.cpp \
devtoolshandler.cpp \
cookievisitor.cpp \
converter.cpp \
match.cpp \
base64.cpp \
browserdata.cpp \
v8handler.cpp \
javascriptextensions.cpp \
elementcommand.cpp \
browsereventsemulator.cpp \
toolboxhandler.cpp \
mainlayout.cpp \
scenariohandler.cpp \
toolboxv8handler.cpp \
scenariov8handler.cpp \
inspectresult.cpp \
variablesextractor.cpp \
extract_functions.cpp \
png/lodepng.cpp \
settings.cpp \
translate.cpp \
curlresourcehandler.cpp \
trim.cpp \
split.cpp \
readallfile.cpp \
replace.cpp \
multithreading.cpp

INCLUDEPATH += $(BAS_PATH_WORKER)/include

LIBS += -L$(BAS_PATH_WORKER)/lib -llibcef -lcef_sandbox -llibcef_dll_wrapper -lAdvapi32 -luser32 -lPsapi -lshell32 -lDbgHelp -lgdi32 -llibcurl -llibeay32 -lssleay32 -lnetwork-uri
QMAKE_CXXFLAGS_RELEASE += /MT

QMAKE_CXXFLAGS_DEBUG += /MTd /FS

HEADERS += \
mainapp.h \
mainhandler.h \
pipesclient.h \
log.h \
commandparser.h \
processcheck.h \
proxydata.h \
xml_encoder.h \
devtoolshandler.h \
cookievisitor.h \
converter.h \
json/picojson.h \
match.h \
base64.h \
browserdata.h \
v8handler.h \
elementcommand.h \
javascriptextensions.h \
browsereventsemulator.h \
resource.h \
toolboxhandler.h \
mainlayout.h \
scenariohandler.h \
toolboxv8handler.h \
scenariov8handler.h \
inspectresult.h \
variablesextractor.h \
extract_functions.h \
png/lodepng.h \
settings.h \
translate.h \
curlresourcehandler.h \
opensslmultithreaded.h \
trim.h \
split.h \
readallfile.h \
replace.h \
refcountpublic.h \
multithreading.h

INCLUDEPATH += xml json png

win32:RC_FILE = main.rc

DISTFILES += \
main.rc

QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS,5.01
Binary file added ChromeWorker/Logo.ico
Binary file not shown.
Binary file added ChromeWorker/Maximize.bmp
Binary file not shown.
Binary file added ChromeWorker/Minimize.bmp
Binary file not shown.
96 changes: 96 additions & 0 deletions ChromeWorker/base64.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
#include "base64.h"
#include <iostream>

static const std::string base64_chars =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789+/";


static inline bool is_base64(unsigned char c) {
return (isalnum(c) || (c == '+') || (c == '/'));
}

std::string base64_encode(unsigned char const* bytes_to_encode, unsigned int in_len) {
std::string ret;
int i = 0;
int j = 0;
unsigned char char_array_3[3];
unsigned char char_array_4[4];

while (in_len--) {
char_array_3[i++] = *(bytes_to_encode++);
if (i == 3) {
char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;
char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4);
char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6);
char_array_4[3] = char_array_3[2] & 0x3f;

for(i = 0; (i <4) ; i++)
ret += base64_chars[char_array_4[i]];
i = 0;
}
}

if (i)
{
for(j = i; j < 3; j++)
char_array_3[j] = '\0';

char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;
char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4);
char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6);
char_array_4[3] = char_array_3[2] & 0x3f;

for (j = 0; (j < i + 1); j++)
ret += base64_chars[char_array_4[j]];

while((i++ < 3))
ret += '=';

}

return ret;

}

std::string base64_decode(std::string const& encoded_string) {
int in_len = encoded_string.size();
int i = 0;
int j = 0;
int in_ = 0;
unsigned char char_array_4[4], char_array_3[3];
std::string ret;

while (in_len-- && ( encoded_string[in_] != '=') && is_base64(encoded_string[in_])) {
char_array_4[i++] = encoded_string[in_]; in_++;
if (i ==4) {
for (i = 0; i <4; i++)
char_array_4[i] = base64_chars.find(char_array_4[i]);

char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4);
char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2);
char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3];

for (i = 0; (i < 3); i++)
ret += char_array_3[i];
i = 0;
}
}

if (i) {
for (j = i; j <4; j++)
char_array_4[j] = 0;

for (j = 0; j <4; j++)
char_array_4[j] = base64_chars.find(char_array_4[j]);

char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4);
char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2);
char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3];

for (j = 0; (j < i - 1); j++) ret += char_array_3[j];
}

return ret;
}
10 changes: 10 additions & 0 deletions ChromeWorker/base64.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef BASE64
#define BASE64

#include <string>

std::string base64_encode(unsigned char const* , unsigned int len);
std::string base64_decode(std::string const& s);

#endif // BASE64

7 changes: 7 additions & 0 deletions ChromeWorker/browserdata.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include "browserdata.h"

BrowserData::BrowserData()
{

}

42 changes: 42 additions & 0 deletions ChromeWorker/browserdata.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#ifndef BROWSERDATA_H
#define BROWSERDATA_H

#include <vector>
#include <memory>
#include <map>
#include "proxydata.h"
#include "include/cef_base.h"
#include "inspectresult.h"
#include <atomic>

class BrowserData
{
public:
BrowserData();

std::map<std::string,std::string> _Headers;
std::string _OpenFileName;
ProxyData _Proxy;
CefWindowHandle _MainWindowHandle;
CefWindowHandle _ParentWindowHandle;
std::vector<std::pair<bool, std::string> > _CacheMask;
std::vector<std::pair<bool, std::string> > _RequestMask;
std::vector<std::pair<std::string, int> > _LoadedUrls;
std::vector<std::pair<std::string, std::shared_ptr<std::vector<char> > > > _CachedData;
std::atomic_int WidthBrowser;
std::atomic_int HeightBrowser;
std::atomic_int WidthAll;
std::atomic_int HeightAll;
std::atomic_int ScrollX;
std::atomic_int ScrollY;
std::atomic_int CursorX;
std::atomic_int CursorY;
std::atomic_bool IsRecord;
InspectResult _Inspect;

//Reset
std::atomic_bool IsReset;
std::atomic_bool IsAboutBlankLoaded;
};

#endif // BROWSERDATA_H
Loading

0 comments on commit 5ef313c

Please sign in to comment.