forked from chromiumembedded/java-cef
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCefResourceSkipCallback_N.cpp
More file actions
34 lines (28 loc) · 1004 Bytes
/
CefResourceSkipCallback_N.cpp
File metadata and controls
34 lines (28 loc) · 1004 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright (c) 2024 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include "CefResourceSkipCallback_N.h"
#include "include/cef_resource_handler.h"
#include "jni_scoped_helpers.h"
namespace {
CefRefPtr<CefResourceSkipCallback> GetSelf(jlong self) {
return reinterpret_cast<CefResourceSkipCallback*>(self);
}
void ClearSelf(JNIEnv* env, jobject obj) {
// Clear the reference added in ResourceHandler.
SetCefForJNIObject<CefResourceSkipCallback>(env, obj, nullptr,
"CefResourceSkipCallback");
}
} // namespace
JNIEXPORT void JNICALL
Java_org_cef_callback_CefResourceSkipCallback_1N_N_1Continue(
JNIEnv* env,
jobject obj,
jlong self,
jlong bytes_skipped) {
CefRefPtr<CefResourceSkipCallback> callback = GetSelf(self);
if (!callback)
return;
callback->Continue(bytes_skipped);
ClearSelf(env, obj);
}