Skip to content

Commit

Permalink
Fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
ds58 committed Oct 27, 2023
2 parents c45c1a8 + 37f25dc commit 97c4945
Show file tree
Hide file tree
Showing 32 changed files with 140 additions and 114 deletions.
39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen and what happened instead.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Versions (please complete the following information):**
- OS: [e.g. Windows 10, MacOS 13.2, Ubuntu 22.10]
- Java Version: [e.g. OpenJDK 14]
- JCEF Version: [e.g. 87476e9]
- CEF Version: [e.g. 110.0.25]

**Additional context**
Does the problem reproduce with the JCEF simple or detailed sample application at the same version?

Does the problem reproduce with the CEF cefclient or cefsimple sample application at the same version?

Does the problem reproduce with Google Chrome at the same version?

Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,12 @@ set_property(GLOBAL PROPERTY OS_FOLDERS ON)

# Specify the CEF branch
if(NOT DEFINED CEF_BRANCH)
set(CEF_BRANCH "5359")
set(CEF_BRANCH "5845")
endif()

# Specify the CEF distribution version.
if(NOT DEFINED CEF_VERSION)
set(CEF_VERSION "108.4.13+ga98cd4c+chromium-108.0.5359.125")
set(CEF_VERSION "116.0.27+gd8c85ac+chromium-116.0.5845.190")
endif()

# Determine the platform.
Expand Down
8 changes: 0 additions & 8 deletions java/org/cef/CefClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -753,14 +753,6 @@ public boolean getAuthCredentials(CefBrowser browser, String origin_url, boolean
return false;
}

@Override
public boolean onQuotaRequest(
CefBrowser browser, String origin_url, long new_size, CefCallback callback) {
if (requestHandler_ != null && browser != null)
return requestHandler_.onQuotaRequest(browser, origin_url, new_size, callback);
return false;
}

@Override
public boolean onCertificateError(
CefBrowser browser, ErrorCode cert_error, String request_url, CefCallback callback) {
Expand Down
16 changes: 16 additions & 0 deletions java/org/cef/browser/CefBrowserOsr.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,22 @@ protected void registerListeners() {}
protected void unregisterListeners() {}
};

private static int getDndAction(int mask) {
// Default to copy if multiple operations are specified.
int action = DnDConstants.ACTION_NONE;
if ((mask & CefDragData.DragOperations.DRAG_OPERATION_COPY)
== CefDragData.DragOperations.DRAG_OPERATION_COPY) {
action = DnDConstants.ACTION_COPY;
} else if ((mask & CefDragData.DragOperations.DRAG_OPERATION_MOVE)
== CefDragData.DragOperations.DRAG_OPERATION_MOVE) {
action = DnDConstants.ACTION_MOVE;
} else if ((mask & CefDragData.DragOperations.DRAG_OPERATION_LINK)
== CefDragData.DragOperations.DRAG_OPERATION_LINK) {
action = DnDConstants.ACTION_LINK;
}
return action;
}

@Override
public boolean startDragging(CefBrowser browser, CefDragData dragData, int mask, int x, int y) {
return true;
Expand Down
1 change: 0 additions & 1 deletion java/org/cef/handler/CefLoadHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ enum ErrorCode {
ERR_NETWORK_CHANGED(-21),
ERR_BLOCKED_BY_ADMINISTRATOR(-22),
ERR_SOCKET_IS_CONNECTED(-23),
ERR_BLOCKED_ENROLLMENT_CHECK_PENDING(-24),
ERR_UPLOAD_STREAM_REWIND_NOT_SUPPORTED(-25),
ERR_CONTEXT_SHUT_DOWN(-26),
ERR_BLOCKED_BY_RESPONSE(-27),
Expand Down
14 changes: 0 additions & 14 deletions java/org/cef/handler/CefRequestHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,20 +103,6 @@ CefResourceRequestHandler getResourceRequestHandler(CefBrowser browser, CefFrame
boolean getAuthCredentials(CefBrowser browser, String origin_url, boolean isProxy, String host,
int port, String realm, String scheme, CefAuthCallback callback);

/**
* Called on the IO thread when JavaScript requests a specific storage quota size via the
* webkitStorageInfo.requestQuota function.
*
* @param browser The corresponding browser.
* @param origin_url Origin of the page making the request.
* @param new_size Requested quota size in bytes.
* @param callback Call CefCallback.Continue() either in this method or at a later time
* to grant or deny the request.
* @return True to handle the request (callback must be executed) or false to cancel.
*/
boolean onQuotaRequest(
CefBrowser browser, String origin_url, long new_size, CefCallback callback);

/**
* Called on the UI thread to handle requests for URLs with an invalid SSL certificate. If
* "ignore-certificate-errors" command-line switch is set all invalid certificates will be
Expand Down
6 changes: 0 additions & 6 deletions java/org/cef/handler/CefRequestHandlerAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ public boolean getAuthCredentials(CefBrowser browser, String origin_url, boolean
return false;
}

@Override
public boolean onQuotaRequest(
CefBrowser browser, String origin_url, long new_size, CefCallback callback) {
return false;
}

@Override
public boolean onCertificateError(
CefBrowser browser, ErrorCode cert_error, String request_url, CefCallback callback) {
Expand Down
6 changes: 0 additions & 6 deletions java/tests/detailed/handler/RequestHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,6 @@ public boolean getAuthCredentials(CefBrowser browser, String origin_url, boolean
return true;
}

@Override
public boolean onQuotaRequest(
CefBrowser browser, String origin_url, long new_size, CefCallback callback) {
return false;
}

@Override
public boolean onCertificateError(
CefBrowser browser, ErrorCode cert_error, String request_url, CefCallback callback) {
Expand Down
6 changes: 0 additions & 6 deletions java/tests/junittests/TestFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,6 @@ public boolean getAuthCredentials(CefBrowser browser, String origin_url, boolean
return false;
}

@Override
public boolean onQuotaRequest(
CefBrowser browser, String origin_url, long new_size, CefCallback callback) {
return false;
}

@Override
public boolean onCertificateError(CefBrowser browser, CefLoadHandler.ErrorCode cert_error,
String request_url, CefCallback callback) {
Expand Down
12 changes: 4 additions & 8 deletions native/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,6 @@ SET_CEF_TARGET_OUT_DIR()
#

if(OS_LINUX)
# Find required libraries and update compiler/linker variables.
FIND_LINUX_LIBRARIES("gmodule-2.0 gtk+-2.0 gthread-2.0")

# Helper executable target.
add_executable(${JCEF_HELPER_TARGET} ${JCEF_HELPER_SRCS})
SET_EXECUTABLE_TARGET_PROPERTIES(${JCEF_HELPER_TARGET})
Expand Down Expand Up @@ -259,16 +256,15 @@ if(OS_LINUX)
COPY_FILES("${JCEF_TARGET}" "${CEF_RESOURCE_FILES}" "${CEF_RESOURCE_DIR}" "${CEF_TARGET_OUT_DIR}")

# TODO(jcef): Eliminate the symlink requirement once we figure out how.
# See https://bitbucket.org/chromiumembedded/java-cef/issues/137#comment-20535941
# See https://github.com/chromiumembedded/java-cef/issues/137#issuecomment-1465038405
add_custom_command(
TARGET ${JCEF_TARGET}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E echo ""
COMMAND ${CMAKE_COMMAND} -E echo "*** Run the following commands manually to create necessary symlinks ***"
COMMAND ${CMAKE_COMMAND} -E echo "sudo ln -s ${CEF_RESOURCE_DIR}/icudtl.dat ${JAVA_DIR}/jre/bin/icudtl.dat"
COMMAND ${CMAKE_COMMAND} -E echo "sudo ln -s ${CEF_BINARY_DIR}/natives_blob.bin ${JAVA_DIR}/jre/bin/natives_blob.bin"
COMMAND ${CMAKE_COMMAND} -E echo "sudo ln -s ${CEF_BINARY_DIR}/snapshot_blob.bin ${JAVA_DIR}/jre/bin/snapshot_blob.bin"
COMMAND ${CMAKE_COMMAND} -E echo "sudo ln -s ${CEF_BINARY_DIR}/v8_context_snapshot.bin ${JAVA_DIR}/jre/bin/v8_context_snapshot.bin"
COMMAND ${CMAKE_COMMAND} -E echo "sudo ln -s ${CEF_RESOURCE_DIR}/icudtl.dat ${JAVA_DIR}/bin/icudtl.dat"
COMMAND ${CMAKE_COMMAND} -E echo "sudo ln -s ${CEF_BINARY_DIR}/snapshot_blob.bin ${JAVA_DIR}/bin/snapshot_blob.bin"
COMMAND ${CMAKE_COMMAND} -E echo "sudo ln -s ${CEF_BINARY_DIR}/v8_context_snapshot.bin ${JAVA_DIR}/bin/v8_context_snapshot.bin"
COMMAND ${CMAKE_COMMAND} -E echo ""
VERBATIM
)
Expand Down
8 changes: 4 additions & 4 deletions native/CefBrowser_N.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1014,12 +1014,12 @@ void getZoomLevel(CefRefPtr<CefBrowserHost> host,
// }
//}

jobject NewJNILongVector(JNIEnv* env, const std::vector<int64>& vals) {
jobject NewJNILongVector(JNIEnv* env, const std::vector<int64_t>& vals) {
ScopedJNIObjectLocal jvector(env, "java/util/Vector");
if (!jvector)
return nullptr;

std::vector<int64>::const_iterator iter;
std::vector<int64_t>::const_iterator iter;
for (iter = vals.begin(); iter != vals.end(); ++iter) {
ScopedJNIObjectLocal argument(
env, NewJNIObject(env, "java/lang/Long", "(J)V", (jlong)*iter));
Expand Down Expand Up @@ -1270,7 +1270,7 @@ JNIEXPORT jobject JNICALL
Java_org_cef_browser_CefBrowser_1N_N_1GetFrameIdentifiers(JNIEnv* env,
jobject obj) {
CefRefPtr<CefBrowser> browser = JNI_GET_BROWSER_OR_RETURN(env, obj, nullptr);
std::vector<int64> identifiers;
std::vector<int64_t> identifiers;
browser->GetFrameIdentifiers(identifiers);
return NewJNILongVector(env, identifiers);
}
Expand Down Expand Up @@ -1569,7 +1569,7 @@ Java_org_cef_browser_CefBrowser_1N_N_1SendKeyEvent(JNIEnv* env,
JNI_STATIC_DEFINE_INT(env, cls, GLFW_REPEAT);

int event_type, modifiers;
char16 key_char;
char16_t key_char;
if (!CallJNIMethodI_V(env, objClass, key_event, "getID", &event_type) ||
!CallJNIMethodC_V(env, objClass, key_event, "getKeyChar", &key_char) ||
!CallJNIMethodI_V(env, objClass, key_event, "getModifiers", &modifiers)) {
Expand Down
2 changes: 1 addition & 1 deletion native/browser_process_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void BrowserProcessHandler::OnContextInitialized() {
JNI_CALL_VOID_METHOD(env, handle_, "onContextInitialized", "()V");
}

void BrowserProcessHandler::OnScheduleMessagePumpWork(int64 delay_ms) {
void BrowserProcessHandler::OnScheduleMessagePumpWork(int64_t delay_ms) {
if (!handle_)
return;

Expand Down
2 changes: 1 addition & 1 deletion native/browser_process_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class BrowserProcessHandler : public CefBrowserProcessHandler {
virtual ~BrowserProcessHandler();

void OnContextInitialized() override;
void OnScheduleMessagePumpWork(int64 delay_ms) override;
void OnScheduleMessagePumpWork(int64_t delay_ms) override;

static CefRefPtr<CefListValue> GetMessageRouterConfigs();
static void AddMessageRouterConfig(const CefMessageRouterConfig& cfg);
Expand Down
4 changes: 1 addition & 3 deletions native/jni_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,6 @@ jobject NewJNIErrorCode(JNIEnv* env, cef_errorcode_t errorCode) {
ERR_BLOCKED_BY_ADMINISTRATOR, jerrorCode);
JNI_CASE(env, "org/cef/handler/CefLoadHandler$ErrorCode",
ERR_SOCKET_IS_CONNECTED, jerrorCode);
JNI_CASE(env, "org/cef/handler/CefLoadHandler$ErrorCode",
ERR_BLOCKED_ENROLLMENT_CHECK_PENDING, jerrorCode);
JNI_CASE(env, "org/cef/handler/CefLoadHandler$ErrorCode",
ERR_UPLOAD_STREAM_REWIND_NOT_SUPPORTED, jerrorCode);
JNI_CASE(env, "org/cef/handler/CefLoadHandler$ErrorCode",
Expand Down Expand Up @@ -949,7 +947,7 @@ bool CallJNIMethodC_V(JNIEnv* env,
jclass cls,
jobject obj,
const char* method_name,
char16* value) {
char16_t* value) {
jmethodID methodID = env->GetMethodID(cls, method_name, "()C");
if (methodID) {
*value = env->CallCharMethod(obj, methodID);
Expand Down
2 changes: 1 addition & 1 deletion native/jni_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ bool CallJNIMethodC_V(JNIEnv* env,
jclass cls,
jobject obj,
const char* method_name,
char16* value);
char16_t* value);

// Call a JNI method that returns a double and accepts no arguments.
bool CallJNIMethodD_V(JNIEnv* env,
Expand Down
4 changes: 2 additions & 2 deletions native/message_router_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ MessageRouterHandler::MessageRouterHandler(JNIEnv* env, jobject handler)
bool MessageRouterHandler::OnQuery(
CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
int64 query_id,
int64_t query_id,
const CefString& request,
bool persistent,
CefRefPtr<CefMessageRouterBrowserSide::Callback> callback) {
Expand Down Expand Up @@ -63,7 +63,7 @@ bool MessageRouterHandler::OnQuery(

void MessageRouterHandler::OnQueryCanceled(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
int64 query_id) {
int64_t query_id) {
ScopedJNIEnv env;
if (!env)
return;
Expand Down
4 changes: 2 additions & 2 deletions native/message_router_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ class MessageRouterHandler : public CefMessageRouterBrowserSide::Handler,
// CefMessageRouterHandler methods
virtual bool OnQuery(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
int64 query_id,
int64_t query_id,
const CefString& request,
bool persistent,
CefRefPtr<Callback> callback) override;
virtual void OnQueryCanceled(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
int64 query_id) override;
int64_t query_id) override;

protected:
ScopedJNIObjectGlobal handle_;
Expand Down
28 changes: 0 additions & 28 deletions native/request_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,34 +143,6 @@ bool RequestHandler::GetAuthCredentials(CefRefPtr<CefBrowser> browser,
return (jresult != JNI_FALSE);
}

bool RequestHandler::OnQuotaRequest(CefRefPtr<CefBrowser> browser,
const CefString& origin_url,
int64 new_size,
CefRefPtr<CefCallback> callback) {
ScopedJNIEnv env;
if (!env)
return false;

ScopedJNIBrowser jbrowser(env, browser);
ScopedJNIString joriginUrl(env, origin_url);
ScopedJNICallback jcallback(env, callback);
jboolean jresult = JNI_FALSE;

JNI_CALL_METHOD(env, handle_, "onQuotaRequest",
"(Lorg/cef/browser/CefBrowser;Ljava/lang/String;"
"JLorg/cef/callback/CefCallback;)Z",
Boolean, jresult, jbrowser.get(), joriginUrl.get(),
(jlong)new_size, jcallback.get());

if (jresult == JNI_FALSE) {
// If the Java method returns "false" the callback won't be used and
// the reference can therefore be removed.
jcallback.SetTemporary();
}

return (jresult != JNI_FALSE);
}

bool RequestHandler::OnCertificateError(CefRefPtr<CefBrowser> browser,
cef_errorcode_t cert_error,
const CefString& request_url,
Expand Down
4 changes: 0 additions & 4 deletions native/request_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ class RequestHandler : public CefRequestHandler {
const CefString& realm,
const CefString& scheme,
CefRefPtr<CefAuthCallback> callback) override;
bool OnQuotaRequest(CefRefPtr<CefBrowser> browser,
const CefString& origin_url,
int64 new_size,
CefRefPtr<CefCallback> callback) override;
bool OnCertificateError(CefRefPtr<CefBrowser> browser,
cef_errorcode_t cert_error,
const CefString& request_url,
Expand Down
2 changes: 1 addition & 1 deletion native/resource_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ bool ResourceHandler::ProcessRequest(CefRefPtr<CefRequest> request,
}

void ResourceHandler::GetResponseHeaders(CefRefPtr<CefResponse> response,
int64& response_length,
int64_t& response_length,
CefString& redirectUrl) {
ScopedJNIEnv env;
if (!env)
Expand Down
2 changes: 1 addition & 1 deletion native/resource_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ResourceHandler : public CefResourceHandler {
bool ProcessRequest(CefRefPtr<CefRequest> request,
CefRefPtr<CefCallback> callback) override;
void GetResponseHeaders(CefRefPtr<CefResponse> response,
int64& response_length,
int64_t& response_length,
CefString& redirectUrl) override;
bool ReadResponse(void* data_out,
int bytes_to_read,
Expand Down
2 changes: 1 addition & 1 deletion native/resource_request_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ void ResourceRequestHandler::OnResourceLoadComplete(
CefRefPtr<CefRequest> request,
CefRefPtr<CefResponse> response,
CefResourceRequestHandler::URLRequestStatus status,
int64 received_content_length) {
int64_t received_content_length) {
ScopedJNIEnv env;
if (!env)
return;
Expand Down
Loading

0 comments on commit 97c4945

Please sign in to comment.