Skip to content

Commit 4e31e66

Browse files
committed
Update to CEF version 3.3029.1604.g364cd86
1 parent 41bc67c commit 4e31e66

9 files changed

Lines changed: 40 additions & 17 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ set_property(GLOBAL PROPERTY OS_FOLDERS ON)
120120
#
121121

122122
# Specify the CEF distribution version.
123-
set(CEF_VERSION "3.2987.1597.gffc5773")
123+
set(CEF_VERSION "3.3029.1604.g364cd86")
124124

125125
# Determine the platform.
126126
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")

java/org/cef/callback/CefSchemeRegistrar.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ public interface CefSchemeRegistrar {
6060
* If |isCorsEnabled| is true the scheme that can be sent CORS requests.
6161
* This value should be true in most cases where |isStandard| is true.
6262
*
63+
* If |isCspBypassing| is true the scheme can bypass Content-Security-Policy
64+
* (CSP) checks. This value should be false in most cases where |isStandard|
65+
* is true.
66+
*
6367
* This function may be called on any thread. It should only be called once
6468
* per unique |schemeName| value. If |schemeName| is already registered or
6569
* if an error occurs this method will return false.
@@ -69,5 +73,6 @@ public boolean addCustomScheme(String schemeName,
6973
boolean isLocal,
7074
boolean isDisplayIsolated,
7175
boolean isSecure,
72-
boolean isCorsEnabled);
76+
boolean isCorsEnabled,
77+
boolean isCspBypassing);
7378
}

java/org/cef/callback/CefSchemeRegistrar_N.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ public boolean addCustomScheme(String schemeName,
1212
boolean isLocal,
1313
boolean isDisplayIsolated,
1414
boolean isSecure,
15-
boolean isCorsEnabled) {
15+
boolean isCorsEnabled,
16+
boolean isCspBypassing) {
1617
try {
1718
return N_AddCustomScheme(schemeName, isStandard, isLocal,
18-
isDisplayIsolated, isSecure, isCorsEnabled);
19+
isDisplayIsolated, isSecure, isCorsEnabled,
20+
isCspBypassing);
1921
} catch (UnsatisfiedLinkError err) {
2022
err.printStackTrace();
2123
}
@@ -27,5 +29,6 @@ private final native boolean N_AddCustomScheme(String schemeName,
2729
boolean isLocal,
2830
boolean isDisplayIsolated,
2931
boolean isSecure,
30-
boolean isCorsEnabled);
32+
boolean isCorsEnabled,
33+
boolean isCspBypassing);
3134
}

java/tests/detailed/handler/AppHandler.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,14 @@ public AppHandler(String[] args) {
2626
// calling CefSchemeRegistrar.addCustomScheme.
2727
@Override
2828
public void onRegisterCustomSchemes(CefSchemeRegistrar registrar) {
29-
if (registrar.addCustomScheme(SearchSchemeHandler.scheme, true, false, false, false, true))
29+
if (registrar.addCustomScheme(SearchSchemeHandler.scheme,
30+
true, false, false, false, true, false)) {
3031
System.out.println("Added scheme " + SearchSchemeHandler.scheme + "://");
31-
if (registrar.addCustomScheme(ClientSchemeHandler.scheme, true, false, false, false, true))
32+
}
33+
if (registrar.addCustomScheme(ClientSchemeHandler.scheme,
34+
true, false, false, false, true, false)) {
3235
System.out.println("Added scheme " + ClientSchemeHandler.scheme + "://");
36+
}
3337
}
3438

3539
// (2) At the next step we have to register a SchemeHandlerFactory which is

native/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,8 +359,9 @@ if(OS_WINDOWS)
359359
COMPILE_FLAGS -DUSING_JAVA
360360
)
361361

362-
# Add the custom manifest files to the DLL.
362+
# Add the custom manifest files to the DLL and helper EXE.
363363
ADD_WINDOWS_MANIFEST("${CMAKE_CURRENT_SOURCE_DIR}" "${JCEF_TARGET}" "dll")
364+
ADD_WINDOWS_MANIFEST("${CMAKE_CURRENT_SOURCE_DIR}" "${JCEF_HELPER_TARGET}" "exe")
364365

365366
# Copy binary and resource files to the target output directory.
366367
COPY_FILES("${JCEF_TARGET}" "${CEF_BINARY_FILES}" "${CEF_BINARY_DIR}" "${CEF_TARGET_OUT_DIR}")

native/CefSchemeRegistrar_N.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
JNIEXPORT jboolean JNICALL Java_org_cef_callback_CefSchemeRegistrar_1N_N_1AddCustomScheme
1515
(JNIEnv *env, jobject obj, jstring jSchemeName, jboolean jIsStandard,
1616
jboolean jIsLocal, jboolean jIsDisplayIsolated, jboolean jIsSecure,
17-
jboolean jIsCorsEnabled) {
17+
jboolean jIsCorsEnabled, jboolean jIsCspBypassing) {
1818

1919
CefRawPtr<CefSchemeRegistrar> registrar =
2020
GetCefFromJNIObject<CefSchemeRegistrar>(env, obj, "CefSchemeRegistrar");
@@ -26,7 +26,8 @@ JNIEXPORT jboolean JNICALL Java_org_cef_callback_CefSchemeRegistrar_1N_N_1AddCus
2626
jIsLocal != JNI_FALSE,
2727
jIsDisplayIsolated != JNI_FALSE,
2828
jIsSecure != JNI_FALSE,
29-
jIsCorsEnabled != JNI_FALSE);
29+
jIsCorsEnabled != JNI_FALSE,
30+
jIsCspBypassing != JNI_FALSE);
3031
if (!result)
3132
return JNI_FALSE;
3233

@@ -44,7 +45,7 @@ JNIEXPORT jboolean JNICALL Java_org_cef_callback_CefSchemeRegistrar_1N_N_1AddCus
4445
fStream << schemeName.ToString().c_str() << "," <<
4546
(jIsStandard != JNI_FALSE) << (jIsLocal != JNI_FALSE) <<
4647
(jIsDisplayIsolated != JNI_FALSE) << (jIsSecure != JNI_FALSE) <<
47-
(jIsCorsEnabled != JNI_FALSE);
48+
(jIsCorsEnabled != JNI_FALSE) << (jIsCspBypassing != JNI_FALSE);
4849
fStream.close();
4950

5051
// 2) Register file to be deleted in CefShutdown()

native/CefSchemeRegistrar_N.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

native/jcef_helper.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ class CefHelperApp : public CefApp,
3434
std::fstream fStream;
3535
std::string fName = util::GetTempFileName("scheme", true);
3636
char schemeName[512] = "";
37-
char cIsStandard, cIsLocal, cIsDisplayIsolated, cIsSecure, cIsCorsEnabled;
38-
bool isStandard, isLocal, isDisplayIsolated, isSecure, isCorsEnabled;
37+
char cIsStandard, cIsLocal, cIsDisplayIsolated, cIsSecure, cIsCorsEnabled, cIsCspBypassing;
38+
bool isStandard, isLocal, isDisplayIsolated, isSecure, isCorsEnabled, isCspBypassing;
3939

4040
fStream.open(fName.c_str(), std::fstream::in);
4141
while (fStream.is_open() && !fStream.eof()) {
@@ -44,15 +44,16 @@ class CefHelperApp : public CefApp,
4444
break;
4545

4646
fStream.get(cIsStandard).get(cIsLocal).get(cIsDisplayIsolated).
47-
get(cIsSecure).get(cIsCorsEnabled);
47+
get(cIsSecure).get(cIsCorsEnabled).get(cIsCspBypassing);
4848
isStandard = (cIsStandard == '1');
4949
isLocal = (cIsLocal == '1');
5050
isDisplayIsolated = (cIsDisplayIsolated == '1');
5151
isSecure = (cIsSecure == '1');
5252
isCorsEnabled = (cIsCorsEnabled == '1');
53+
isCspBypassing = (cIsCspBypassing == '1');
5354

5455
registrar->AddCustomScheme(schemeName, isStandard, isLocal,
55-
isDisplayIsolated, isSecure, isCorsEnabled);
56+
isDisplayIsolated, isSecure, isCorsEnabled, isCspBypassing);
5657
}
5758
fStream.close();
5859
}

native/jcef_helper.exe.manifest

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
3+
<dependency>
4+
<dependentAssembly>
5+
<assemblyIdentity type="Win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"></assemblyIdentity>
6+
</dependentAssembly>
7+
</dependency>
8+
</assembly>

0 commit comments

Comments
 (0)