Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tales of MajEyal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
K'van
Tales of MajEyal
Commits
3fb5a069
Commit
3fb5a069
authored
10 years ago
by
DarkGod
Browse files
Options
Downloads
Patches
Plain Diff
test stuff
parent
5dc9b48a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/web-cef3/web.cpp
+30
-3
30 additions, 3 deletions
src/web-cef3/web.cpp
src/web-external.h
+1
-0
1 addition, 0 deletions
src/web-external.h
with
31 additions
and
3 deletions
src/web-cef3/web.cpp
+
30
−
3
View file @
3fb5a069
...
...
@@ -89,6 +89,7 @@ class BrowserClient;
class
WebViewOpaque
{
public:
bool
crashed
;
CefRefPtr
<
RenderHandler
>
render
;
CefRefPtr
<
CefBrowser
>
browser
;
CefRefPtr
<
BrowserClient
>
view
;
...
...
@@ -158,6 +159,25 @@ public:
return
false
;
}
virtual
bool
OnBeforePluginLoad
(
CefRefPtr
<
CefBrowser
>
browser
,
const
CefString
&
url
,
const
CefString
&
policy_url
,
CefRefPtr
<
CefWebPluginInfo
>
info
)
OVERRIDE
{
char
*
name
=
cstring_to_c
(
info
->
GetName
());
char
*
path
=
cstring_to_c
(
info
->
GetPath
());
fprintf
(
logfile
,
"[WEBCORE] Forbade plugin %s from %s
\n
"
,
name
,
path
);
free
(
name
);
free
(
path
);
return
true
;
}
virtual
void
OnRenderProcessTerminated
(
CefRefPtr
<
CefBrowser
>
browser
,
TerminationStatus
status
)
OVERRIDE
{
if
((
status
==
TS_ABNORMAL_TERMINATION
)
||
(
status
==
TS_PROCESS_WAS_KILLED
)
||
(
status
==
TS_PROCESS_CRASHED
))
{
opaque
->
crashed
=
true
;
WebEvent
*
event
=
new
WebEvent
();
event
->
kind
=
TE4_WEB_EVENT_END_BROWSER
;
event
->
handlers
=
handlers
;
push_event
(
event
);
}
}
virtual
bool
OnBeforePopup
(
CefRefPtr
<
CefBrowser
>
browser
,
CefRefPtr
<
CefFrame
>
frame
,
const
CefString
&
target_url
,
...
...
@@ -314,12 +334,15 @@ void te4_web_new(web_view_type *view, int w, int h) {
CefWindowInfo
window_info
;
CefBrowserSettings
browserSettings
;
browserSettings
.
java
=
STATE_DISABLED
;
browserSettings
.
plugins
=
STATE_DISABLED
;
window_info
.
SetAsOffScreen
(
NULL
);
window_info
.
SetTransparentPainting
(
true
);
opaque
->
render
=
new
RenderHandler
(
w
,
h
);
opaque
->
view
=
new
BrowserClient
(
opaque
,
opaque
->
render
,
view
->
handlers
);
CefString
curl
(
""
);
opaque
->
browser
=
CefBrowserHost
::
CreateBrowserSync
(
window_info
,
opaque
->
view
.
get
(),
curl
,
browserSettings
);
opaque
->
crashed
=
false
;
view
->
w
=
w
;
view
->
h
=
h
;
...
...
@@ -331,9 +354,13 @@ bool te4_web_close(web_view_type *view) {
WebViewOpaque
*
opaque
=
(
WebViewOpaque
*
)
view
->
opaque
;
if
(
!
view
->
closed
)
{
view
->
closed
=
true
;
fprintf
(
logfile
,
"[WEBCORE] Destroying webview for browser
\n
"
);
opaque
->
browser
->
GetHost
()
->
CloseBrowser
(
true
);
fprintf
(
logfile
,
"[WEBCORE] Destroying send done
\n
"
);
if
(
opaque
->
crashed
)
{
fprintf
(
logfile
,
"[WEBCORE] Destroying webview but it was already crashed, doing nothing
\n
"
);
}
else
{
fprintf
(
logfile
,
"[WEBCORE] Destroying webview for browser
\n
"
);
opaque
->
browser
->
GetHost
()
->
CloseBrowser
(
true
);
fprintf
(
logfile
,
"[WEBCORE] Destroying send done
\n
"
);
}
return
true
;
}
return
false
;
...
...
This diff is collapsed.
Click to expand it.
src/web-external.h
+
1
−
0
View file @
3fb5a069
...
...
@@ -35,6 +35,7 @@ enum web_event_kind {
TE4_WEB_EVENT_LOADING
,
TE4_WEB_EVENT_LOCAL_REQUEST
,
TE4_WEB_EVENT_RUN_LUA
,
TE4_WEB_EVENT_END_BROWSER
,
};
typedef
struct
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment