Skip to content
This repository was archived by the owner on Sep 2, 2021. It is now read-only.

Commit 498db40

Browse files
committed
Replaced util macros in favour of cef_helpers|cef_logging ones
1 parent b68893f commit 498db40

15 files changed

+38
-74
lines changed

appshell/appshell_node_process_mac.mm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include "appshell_node_process.h"
2828
#include "appshell_node_process_internal.h"
2929

30-
#include "util.h"
3130
#include "config.h"
3231

3332
// NOTE ON THREAD SAFETY: This code is not thread-safe. All of the methods

appshell/cef_registry.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#endif
2727

2828
#include "config.h"
29-
#include "util.h"
29+
#include "include/base/cef_logging.h"
3030

3131
static const wchar_t g_szSoftwareFolder[] = L"Software";
3232

@@ -49,7 +49,7 @@ void EnsureTrailingSeparator(LPWSTR pRet)
4949
void GetKey(LPCWSTR pBase, LPCWSTR pGroup, LPCWSTR pApp, LPCWSTR pFolder, LPWSTR pRet)
5050
{
5151
// Check for required params
52-
ASSERT(pBase && pApp && pRet);
52+
DCHECK(pBase && pApp && pRet);
5353
if (!pBase || !pApp || !pRet)
5454
return;
5555

@@ -94,8 +94,8 @@ bool GetRegistryInt(LPCWSTR pFolder, LPCWSTR pEntry, int* pDefault, int& ret)
9494
if (ERROR_SUCCESS == RegQueryValueEx(hKey, pEntry, NULL, &dwType, (LPBYTE)&dwValue, &dwCount))
9595
{
9696
result = true;
97-
ASSERT(dwType == REG_DWORD);
98-
ASSERT(dwCount == sizeof(dwValue));
97+
DCHECK(dwType == REG_DWORD);
98+
DCHECK(dwCount == sizeof(dwValue));
9999
ret = (int)dwValue;
100100
}
101101
RegCloseKey(hKey);

appshell/cefclient.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
#include "include/cef_frame.h"
1414
#include "include/cef_runnable.h"
1515
#include "include/cef_web_plugin.h"
16+
#include "include/base/cef_logging.h"
1617
#include "client_handler.h"
1718
#include "appshell/common/client_switches.h"
18-
#include "util.h"
1919
#include "config.h"
2020

2121
CefRefPtr<ClientHandler> g_handler;
@@ -49,8 +49,8 @@ CefRefPtr<CefCommandLine> AppGetCommandLine() {
4949

5050
// Returns the application settings based on command line arguments.
5151
void AppGetSettings(CefSettings& settings, CefRefPtr<ClientApp> app) {
52-
ASSERT(app.get());
53-
ASSERT(g_command_line.get());
52+
DCHECK(app.get());
53+
DCHECK(g_command_line.get());
5454
if (!g_command_line.get())
5555
return;
5656

appshell/client_app.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include "include/cef_process_message.h"
1212
#include "include/cef_task.h"
1313
#include "include/cef_v8.h"
14-
#include "util.h" // NOLINT(build/include)
14+
#include "include/base/cef_logging.h"
1515
#include "config.h"
1616

1717
namespace {
@@ -40,7 +40,7 @@ void SetListValue(CefRefPtr<CefListValue> list, int index,
4040

4141
// Transfer a V8 array to a List.
4242
void SetList(CefRefPtr<CefV8Value> source, CefRefPtr<CefListValue> target) {
43-
ASSERT(source->IsArray());
43+
DCHECK(source->IsArray());
4444

4545
int arg_length = source->GetArrayLength();
4646
if (arg_length == 0)
@@ -121,7 +121,7 @@ void SetListValue(CefRefPtr<CefV8Value> list, int index,
121121

122122
// Transfer a List to a V8 array.
123123
void SetList(CefRefPtr<CefListValue> source, CefRefPtr<CefV8Value> target) {
124-
ASSERT(target->IsArray());
124+
DCHECK(target->IsArray());
125125

126126
int arg_length = source->GetSize();
127127
if (arg_length == 0)
@@ -299,7 +299,7 @@ bool ClientApp::OnProcessMessageReceived(
299299
CefRefPtr<CefBrowser> browser,
300300
CefProcessId source_process,
301301
CefRefPtr<CefProcessMessage> message) {
302-
ASSERT(source_process == PID_BROWSER);
302+
DCHECK(source_process == PID_BROWSER);
303303

304304
bool handled = false;
305305

appshell/client_handler.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "include/cef_browser.h"
1010
#include "include/cef_frame.h"
1111
#include "include/wrapper/cef_stream_resource_handler.h"
12+
#include "include/wrapper/cef_helpers.h"
1213
#include "cefclient.h"
1314
#include "resource_util.h"
1415
#include "appshell/appshell_extensions.h"
@@ -148,7 +149,7 @@ bool ClientHandler::OnBeforePopup(CefRefPtr<CefBrowser> browser,
148149
}
149150

150151
void ClientHandler::OnAfterCreated(CefRefPtr<CefBrowser> browser) {
151-
REQUIRE_UI_THREAD();
152+
CEF_REQUIRE_UI_THREAD();
152153

153154
AutoLock lock_scope(this);
154155
if (!m_Browser.get()) {
@@ -164,7 +165,7 @@ void ClientHandler::OnAfterCreated(CefRefPtr<CefBrowser> browser) {
164165
}
165166

166167
void ClientHandler::OnBeforeClose(CefRefPtr<CefBrowser> browser) {
167-
REQUIRE_UI_THREAD();
168+
CEF_REQUIRE_UI_THREAD();
168169

169170
if (CanCloseBrowser(browser)) {
170171
if (m_BrowserId == browser->GetIdentifier()) {
@@ -190,7 +191,7 @@ std::vector<CefString> gDroppedFiles;
190191
bool ClientHandler::OnDragEnter(CefRefPtr<CefBrowser> browser,
191192
CefRefPtr<CefDragData> dragData,
192193
DragOperationsMask mask) {
193-
REQUIRE_UI_THREAD();
194+
CEF_REQUIRE_UI_THREAD();
194195

195196
if (dragData->IsFile()) {
196197
gDroppedFiles.clear();
@@ -202,7 +203,7 @@ bool ClientHandler::OnDragEnter(CefRefPtr<CefBrowser> browser,
202203

203204
void ClientHandler::OnLoadStart(CefRefPtr<CefBrowser> browser,
204205
CefRefPtr<CefFrame> frame) {
205-
REQUIRE_UI_THREAD();
206+
CEF_REQUIRE_UI_THREAD();
206207

207208
if (m_BrowserId == browser->GetIdentifier() && frame->IsMain()) {
208209
// We've just started loading a page
@@ -213,7 +214,7 @@ void ClientHandler::OnLoadStart(CefRefPtr<CefBrowser> browser,
213214
void ClientHandler::OnLoadEnd(CefRefPtr<CefBrowser> browser,
214215
CefRefPtr<CefFrame> frame,
215216
int httpStatusCode) {
216-
REQUIRE_UI_THREAD();
217+
CEF_REQUIRE_UI_THREAD();
217218

218219
if (m_BrowserId == browser->GetIdentifier() && frame->IsMain()) {
219220
// We've just finished loading a page
@@ -226,7 +227,7 @@ void ClientHandler::OnLoadError(CefRefPtr<CefBrowser> browser,
226227
ErrorCode errorCode,
227228
const CefString& errorText,
228229
const CefString& failedUrl) {
229-
REQUIRE_UI_THREAD();
230+
CEF_REQUIRE_UI_THREAD();
230231

231232
// Display a load error message.
232233
std::stringstream ss;
@@ -268,7 +269,7 @@ void ClientHandler::OnLoadingStateChange(CefRefPtr<CefBrowser> browser,
268269
bool isLoading,
269270
bool canGoBack,
270271
bool canGoForward) {
271-
REQUIRE_UI_THREAD();
272+
CEF_REQUIRE_UI_THREAD();
272273
SetLoading(isLoading);
273274
SetNavState(canGoBack, canGoForward);
274275
}
@@ -282,7 +283,7 @@ bool ClientHandler::OnConsoleMessage(CefRefPtr<CefBrowser> browser,
282283
// in xcode, or console window in dev tools)
283284

284285
/*
285-
REQUIRE_UI_THREAD();
286+
CEF_REQUIRE_UI_THREAD();
286287
287288
bool first_message;
288289
std::string logFile;

appshell/client_handler.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include <string>
1212
#include "include/base/cef_lock.h"
1313
#include "include/cef_client.h"
14-
#include "util.h"
1514
#include "command_callbacks.h"
1615

1716
#include <algorithm>

appshell/client_handler_gtk.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "client_handler.h"
99
#include "include/cef_browser.h"
1010
#include "include/cef_frame.h"
11+
#include "include/wrapper/cef_helpers.h"
1112

1213
// The global ClientHandler reference.
1314
extern CefRefPtr<ClientHandler> g_handler;
@@ -16,7 +17,7 @@ void ClientHandler::OnAddressChange(CefRefPtr<CefBrowser> browser,
1617
CefRefPtr<CefFrame> frame,
1718
const CefString& url) {
1819
#ifdef SHOW_TOOLBAR_UI
19-
REQUIRE_UI_THREAD();
20+
CEF_REQUIRE_UI_THREAD();
2021

2122
if (m_BrowserId == browser->GetIdentifier() && frame->IsMain()) {
2223
// Set the edit window text
@@ -28,7 +29,7 @@ void ClientHandler::OnAddressChange(CefRefPtr<CefBrowser> browser,
2829

2930
void ClientHandler::OnTitleChange(CefRefPtr<CefBrowser> browser,
3031
const CefString& title) {
31-
REQUIRE_UI_THREAD();
32+
CEF_REQUIRE_UI_THREAD();
3233

3334
GtkWidget* window = gtk_widget_get_ancestor(
3435
GTK_WIDGET(browser->GetHost()->GetWindowHandle()),

appshell/client_handler_mac.mm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "client_handler.h"
99
#include "include/cef_browser.h"
1010
#include "include/cef_frame.h"
11+
#include "include/wrapper/cef_helpers.h"
1112
#include "cefclient.h"
1213
#include "native_menu_model.h"
1314

@@ -36,7 +37,7 @@
3637
void ClientHandler::OnAddressChange(CefRefPtr<CefBrowser> browser,
3738
CefRefPtr<CefFrame> frame,
3839
const CefString& url) {
39-
REQUIRE_UI_THREAD();
40+
CEF_REQUIRE_UI_THREAD();
4041

4142
if (m_BrowserId == browser->GetIdentifier() && frame->IsMain()) {
4243
// Set the edit window text
@@ -49,7 +50,7 @@
4950

5051
void ClientHandler::OnTitleChange(CefRefPtr<CefBrowser> browser,
5152
const CefString& title) {
52-
REQUIRE_UI_THREAD();
53+
CEF_REQUIRE_UI_THREAD();
5354

5455
// Set the frame window title bar
5556
NSView* view = (NSView*)browser->GetHost()->GetWindowHandle();

appshell/client_handler_win.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <string>
88
#include "include/cef_browser.h"
99
#include "include/cef_frame.h"
10+
#include "include/wrapper/cef_helpers.h"
1011
#include "resource.h"
1112
#include "native_menu_model.h"
1213

@@ -24,12 +25,12 @@ extern HACCEL hAccelTable;
2425
void ClientHandler::OnAddressChange(CefRefPtr<CefBrowser> browser,
2526
CefRefPtr<CefFrame> frame,
2627
const CefString& url) {
27-
REQUIRE_UI_THREAD();
28+
CEF_REQUIRE_UI_THREAD();
2829
}
2930

3031
void ClientHandler::OnTitleChange(CefRefPtr<CefBrowser> browser,
3132
const CefString& title) {
32-
REQUIRE_UI_THREAD();
33+
CEF_REQUIRE_UI_THREAD();
3334

3435
// Set the frame window title bar
3536
CefWindowHandle hwnd = browser->GetHost()->GetWindowHandle();

appshell/config.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424
#pragma once
2525

26+
#include "include/cef_task.h"
27+
2628
// Application name used in native code. This name is *not* used in resources.
2729

2830
#ifdef OS_WIN

0 commit comments

Comments
 (0)