Skip to content

Commit fee8e21

Browse files
committed
Initial commit for chromium upgrade 1.0.2
1 parent f7d184b commit fee8e21

111 files changed

Lines changed: 2545 additions & 1385 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,20 @@ set_property(GLOBAL PROPERTY OS_FOLDERS ON)
130130

131131
# Specify the CEF distribution version.
132132
if(NOT DEFINED CEF_VERSION)
133-
set(CEF_VERSION "100.0.14+g4e5ba66+chromium-100.0.4896.75")
133+
set(CEF_VERSION "119.4.7+g55e15c8+chromium-119.0.6045.199")
134134
endif()
135135

136136
# Determine the platform.
137137
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
138138
if("${PROJECT_ARCH}" STREQUAL "arm64")
139139
set(CEF_PLATFORM "macosarm64")
140+
elseif("${PROJECT_ARCH}" STREQUAL "x86_64")
141+
set(CEF_PLATFORM "macosx64")
142+
elseif("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "arm64")
143+
set(PROJECT_ARCH "arm64")
144+
set(CEF_PLATFORM "macosarm64")
140145
else()
146+
set(PROJECT_ARCH "x86_64")
141147
set(CEF_PLATFORM "macosx64")
142148
endif()
143149
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
@@ -161,7 +167,6 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
161167
include(DownloadCEF)
162168
DownloadCEF("${CEF_PLATFORM}" "${CEF_VERSION}" "${CMAKE_SOURCE_DIR}/third_party/cef")
163169

164-
165170
# Add the CEF binary distribution's cmake/ directory to the module path.
166171
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CEF_ROOT}/cmake")
167172

@@ -273,12 +278,19 @@ file(COPY "${CEF_ROOT}/README.txt" DESTINATION "${CMAKE_BINARY_DIR}")
273278
if(OS_WINDOWS)
274279
set(GS_PLATFORM "win32")
275280
set(GS_HASHPATH "win/clang-format.exe.sha1")
281+
set(GS_OUTPATH "win/clang-format.exe")
276282
elseif(OS_MACOSX)
277283
set(GS_PLATFORM "darwin")
278-
set(GS_HASHPATH "mac/clang-format.sha1")
284+
if("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "arm64")
285+
set(GS_HASHPATH "mac/clang-format.arm64.sha1")
286+
else()
287+
set(GS_HASHPATH "mac/clang-format.x64.sha1")
288+
endif()
289+
set(GS_OUTPATH "mac/clang-format")
279290
elseif(OS_LINUX)
280291
set(GS_PLATFORM "linux*")
281292
set(GS_HASHPATH "linux64/clang-format.sha1")
293+
set(GS_OUTPATH "linux64/clang-format")
282294
endif()
283295

284296
message(STATUS "Downloading clang-format from Google Storage...")
@@ -290,6 +302,7 @@ execute_process(
290302
"--no_auth"
291303
"--bucket" "chromium-clang-format"
292304
"-s" "tools/buildtools/${GS_HASHPATH}"
305+
"-o" "tools/buildtools/${GS_OUTPATH}"
293306
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
294307
RESULT_VARIABLE EXECUTE_RV
295308
)

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ The Java Chromium Embedded Framework (JCEF) is a simple framework for embedding
44

55
* Building JCEF - https://bitbucket.org/chromiumembedded/java-cef/wiki/BranchesAndBuilding
66
* Support Forum - http://magpcss.org/ceforum/viewforum.php?f=17
7+
* Issue Tracker - https://github.com/chromiumembedded/java-cef/issues
78
* Downloads - https://github.com/jcefmaven/jcefbuild
89
* Maven/Gradle Artifacts - https://github.com/jcefmaven/jcefmaven
910
* Donations - http://www.magpcss.org/ceforum/donate.php
@@ -29,7 +30,7 @@ The JCEF project is an extension of the Chromium Embedded Framework (CEF) projec
2930

3031
JCEF is still very much a work in progress. Some ways that you can help out:
3132

32-
\- Vote for issues in the [JCEF issue tracker](https://bitbucket.org/chromiumembedded/java-cef/issues?status=new&status=open) that are important to you. This helps with development prioritization.
33+
\- Vote for issues in the [JCEF issue tracker](https://github.com/chromiumembedded/java-cef/issues) that are important to you. This helps with development prioritization.
3334

3435
\- Report any bugs that you find or feature requests that are important to you. Make sure to first search for existing issues before creating new ones. Please use the [JCEF Forum](http://magpcss.org/ceforum/viewforum.php?f=17) and not the issue tracker for usage questions. Each JCEF issue should:
3536

@@ -40,7 +41,7 @@ JCEF is still very much a work in progress. Some ways that you can help out:
4041

4142
\- Write unit tests for new or existing functionality.
4243

43-
\- Pull requests and patches are welcome. View open issues in the [JCEF issue tracker](https://bitbucket.org/chromiumembedded/java-cef/issues?status=new&status=open) or search for TODO(cef) in the source code for ideas.
44+
\- Pull requests and patches are welcome. View open issues in the [JCEF issue tracker](https://github.com/chromiumembedded/java-cef/issues) or search for TODO(cef) in the source code for ideas.
4445

4546
If you would like to contribute source code changes to JCEF please follow the below guidelines:
4647

@@ -51,4 +52,4 @@ If you would like to contribute source code changes to JCEF please follow the be
5152
* Be submitted against the current [JCEF master branch](https://bitbucket.org/chromiumembedded/java-cef/src/?at=master) unless explicitly fixing a bug in a CEF release branch.
5253
* Follow the style of existing JCEF source files. In general JCEF uses the [Chromium coding style](http://www.chromium.org/developers/coding-style).
5354
* Include new or modified unit tests as appropriate to the functionality.
54-
* Not include unnecessary or unrelated changes.
55+
* Not include unnecessary or unrelated changes.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright (c) 2024 The Chromium Embedded Framework Authors. All rights
2+
// reserved. Use of this source code is governed by a BSD-style license that
3+
// can be found in the LICENSE file.
4+
5+
package org.cef;
6+
7+
/**
8+
* Browser initialization settings. Specify NULL or 0 to get the recommended
9+
* default values. The consequences of using custom values may not be well
10+
* tested. Many of these and other settings can also configured using command-
11+
* line switches.
12+
*/
13+
public class CefBrowserSettings {
14+
/**
15+
* The maximum rate in frames per second (fps) that CefRenderHandler::OnPaint
16+
* will be called for a windowless browser. The actual fps may be lower if
17+
* the browser cannot generate frames at the requested rate. The minimum
18+
* value is 1 and the maximum value is 60 (default 30). This value can also
19+
* be changed dynamically via {@code CefBrowser#setWindowlessFrameRate}
20+
*/
21+
public int windowless_frame_rate = 0;
22+
23+
public CefBrowserSettings() {}
24+
25+
@Override
26+
public CefBrowserSettings clone() {
27+
CefBrowserSettings tmp = new CefBrowserSettings();
28+
tmp.windowless_frame_rate = windowless_frame_rate;
29+
return tmp;
30+
}
31+
}

java/org/cef/CefClient.java

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@
44

55
package org.cef;
66

7-
import org.cef.browser.CefBrowser;
8-
import org.cef.browser.CefBrowserFactory;
9-
import org.cef.browser.CefFrame;
10-
import org.cef.browser.CefMessageRouter;
11-
import org.cef.browser.CefRequestContext;
7+
import org.cef.browser.*;
128
import org.cef.callback.CefAuthCallback;
139
import org.cef.callback.CefBeforeDownloadCallback;
1410
import org.cef.callback.CefCallback;
@@ -60,6 +56,7 @@
6056
import java.util.Collection;
6157
import java.util.HashMap;
6258
import java.util.Vector;
59+
import java.util.function.Consumer;
6360

6461
import javax.swing.SwingUtilities;
6562

@@ -141,7 +138,16 @@ public CefBrowser createBrowser(String url, boolean isOffscreenRendered, boolean
141138
CefRequestContext context) {
142139
if (isDisposed_)
143140
throw new IllegalStateException("Can't create browser. CefClient is disposed");
144-
return CefBrowserFactory.create(this, url, isOffscreenRendered, isTransparent, context);
141+
return CefBrowserFactory.create(
142+
this, url, isOffscreenRendered, isTransparent, context, null);
143+
}
144+
145+
public CefBrowser createBrowser(String url, boolean isOffscreenRendered, boolean isTransparent,
146+
CefRequestContext context, CefBrowserSettings settings) {
147+
if (isDisposed_)
148+
throw new IllegalStateException("Can't create browser. CefClient is disposed");
149+
return CefBrowserFactory.create(
150+
this, url, isOffscreenRendered, isTransparent, context, settings);
145151
}
146152

147153
@Override
@@ -274,11 +280,10 @@ public void removeDialogHandler() {
274280

275281
@Override
276282
public boolean onFileDialog(CefBrowser browser, FileDialogMode mode, String title,
277-
String defaultFilePath, Vector<String> acceptFilters, int selectedAcceptFilter,
278-
CefFileDialogCallback callback) {
283+
String defaultFilePath, Vector<String> acceptFilters, CefFileDialogCallback callback) {
279284
if (dialogHandler_ != null && browser != null) {
280-
return dialogHandler_.onFileDialog(browser, mode, title, defaultFilePath, acceptFilters,
281-
selectedAcceptFilter, callback);
285+
return dialogHandler_.onFileDialog(
286+
browser, mode, title, defaultFilePath, acceptFilters, callback);
282287
}
283288
return false;
284289
}
@@ -306,6 +311,12 @@ public void onTitleChange(CefBrowser browser, String title) {
306311
displayHandler_.onTitleChange(browser, title);
307312
}
308313

314+
@Override
315+
public void OnFullscreenModeChange(CefBrowser browser, boolean fullscreen) {
316+
if (displayHandler_ != null && browser != null)
317+
displayHandler_.OnFullscreenModeChange(browser, fullscreen);
318+
}
319+
309320
@Override
310321
public boolean onTooltip(CefBrowser browser, String text) {
311322
if (displayHandler_ != null && browser != null) {
@@ -754,6 +765,15 @@ public void onPaint(CefBrowser browser, boolean popup, Rectangle[] dirtyRects,
754765
realHandler.onPaint(browser, popup, dirtyRects, buffer, width, height);
755766
}
756767

768+
@Override
769+
public void addOnPaintListener(Consumer<CefPaintEvent> listener) {}
770+
771+
@Override
772+
public void setOnPaintListener(Consumer<CefPaintEvent> listener) {}
773+
774+
@Override
775+
public void removeOnPaintListener(Consumer<CefPaintEvent> listener) {}
776+
757777
@Override
758778
public boolean startDragging(CefBrowser browser, CefDragData dragData, int mask, int x, int y) {
759779
if (browser == null) return false;
@@ -820,14 +840,6 @@ public boolean getAuthCredentials(CefBrowser browser, String origin_url, boolean
820840
return false;
821841
}
822842

823-
@Override
824-
public boolean onQuotaRequest(
825-
CefBrowser browser, String origin_url, long new_size, CefCallback callback) {
826-
if (requestHandler_ != null && browser != null)
827-
return requestHandler_.onQuotaRequest(browser, origin_url, new_size, callback);
828-
return false;
829-
}
830-
831843
@Override
832844
public boolean onCertificateError(
833845
CefBrowser browser, ErrorCode cert_error, String request_url, CefCallback callback) {

java/org/cef/SystemBootstrap.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ public class SystemBootstrap {
1313
/**
1414
* Simple interface for how a library by name should be loaded.
1515
*/
16-
static public interface Loader { public void loadLibrary(String libname); }
16+
static public interface Loader {
17+
public void loadLibrary(String libname);
18+
}
1719

1820
/**
1921
* Default implementation is to call System.loadLibrary

java/org/cef/browser/CefBrowser.java

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,19 +337,29 @@ public void runFileDialog(FileDialogMode mode, String title, String defaultFileP
337337
public void stopFinding(boolean clearSelection);
338338

339339
/**
340-
* Get an instance of the dev tools to be displayed in its own window or to be
340+
* Get an instance of the DevTools to be displayed in its own window or to be
341341
* embedded within your UI. Only one instance per browser is available.
342342
*/
343343
public CefBrowser getDevTools();
344344

345345
/**
346-
* Get an instance of the dev tools to be displayed in its own window or to be
346+
* Get an instance of the DevTools to be displayed in its own window or to be
347347
* embedded within your UI. Only one instance per browser is available.
348348
*
349349
* @param inspectAt a position in the UI which should be inspected.
350350
*/
351351
public CefBrowser getDevTools(Point inspectAt);
352352

353+
/**
354+
* Get an instance of a client that can be used to leverage the DevTools
355+
* protocol. Only one instance per browser is available.
356+
*
357+
* @see {@link CefDevToolsClient}
358+
* @return DevTools client, or null if this browser is not yet created
359+
* or if it is closed or closing
360+
*/
361+
public CefDevToolsClient getDevToolsClient();
362+
353363
/**
354364
* If a misspelled word is currently selected in an editable node calling
355365
* this method will replace it with the specified |word|.
@@ -363,7 +373,7 @@ public void runFileDialog(FileDialogMode mode, String title, String defaultFileP
363373
* <p>
364374
* If executed on the AWT Event Thread, this returns an immediately resolved {@link
365375
* java.util.concurrent.CompletableFuture}. If executed from another thread, the {@link
366-
* java.util.concurrent.CompletableFuture} returned is resolved as soon as the screenshot
376+
* java.util.concurrent.CompletableFuture} returned is resolved as soon as the screenshot
367377
* has been taken (which must happen on the event thread).
368378
* <p>
369379
* The generated screenshot can either be returned as-is, containing all natively-rendered
@@ -380,4 +390,26 @@ public void runFileDialog(FileDialogMode mode, String title, String defaultFileP
380390
* @throws UnsupportedOperationException if not supported
381391
*/
382392
public CompletableFuture<BufferedImage> createScreenshot(boolean nativeResolution);
393+
394+
/**
395+
* Set the maximum rate in frames per second (fps) that {@code CefRenderHandler::onPaint}
396+
* will be called for a windowless browser. The actual fps may be
397+
* lower if the browser cannot generate frames at the requested rate. The
398+
* minimum value is 1, and the maximum value is 60 (default 30).
399+
*
400+
* @param frameRate the maximum frame rate
401+
* @throws UnsupportedOperationException if not supported
402+
*/
403+
public void setWindowlessFrameRate(int frameRate);
404+
405+
/**
406+
* Returns the maximum rate in frames per second (fps) that {@code CefRenderHandler::onPaint}
407+
* will be called for a windowless browser. The actual fps may be lower if the browser cannot
408+
* generate frames at the requested rate. The minimum value is 1, and the maximum value is 60
409+
* (default 30).
410+
*
411+
* @return the framerate, 0 if an error occurs
412+
* @throws UnsupportedOperationException if not supported
413+
*/
414+
public CompletableFuture<Integer> getWindowlessFrameRate();
383415
}

java/org/cef/browser/CefBrowserFactory.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@
44

55
package org.cef.browser;
66

7+
import org.cef.CefBrowserSettings;
78
import org.cef.CefClient;
89

910
/**
1011
* Creates a new instance of CefBrowser according the passed values
1112
*/
1213
public class CefBrowserFactory {
1314
public static CefBrowser create(CefClient client, String url, boolean isOffscreenRendered,
14-
boolean isTransparent, CefRequestContext context) {
15-
if (isOffscreenRendered) return new CefBrowserOsr(client, url, isTransparent, context);
16-
return new CefBrowserWr(client, url, context);
15+
boolean isTransparent, CefRequestContext context, CefBrowserSettings settings) {
16+
if (isOffscreenRendered)
17+
return new CefBrowserOsr(client, url, isTransparent, context, settings);
18+
return new CefBrowserWr(client, url, context, settings);
1719
}
1820
}

0 commit comments

Comments
 (0)