Skip to content
This repository was archived by the owner on Sep 2, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion appshell/appshell_node_process_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include "appshell_node_process.h"
#include "appshell_node_process_internal.h"

#include "util.h"
#include "config.h"

// NOTE ON THREAD SAFETY: This code is not thread-safe. All of the methods
Expand Down
8 changes: 4 additions & 4 deletions appshell/cef_registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#endif

#include "config.h"
#include "util.h"
#include "include/base/cef_logging.h"

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

Expand All @@ -49,7 +49,7 @@ void EnsureTrailingSeparator(LPWSTR pRet)
void GetKey(LPCWSTR pBase, LPCWSTR pGroup, LPCWSTR pApp, LPCWSTR pFolder, LPWSTR pRet)
{
// Check for required params
ASSERT(pBase && pApp && pRet);
DCHECK(pBase && pApp && pRet);
if (!pBase || !pApp || !pRet)
return;

Expand Down Expand Up @@ -94,8 +94,8 @@ bool GetRegistryInt(LPCWSTR pFolder, LPCWSTR pEntry, int* pDefault, int& ret)
if (ERROR_SUCCESS == RegQueryValueEx(hKey, pEntry, NULL, &dwType, (LPBYTE)&dwValue, &dwCount))
{
result = true;
ASSERT(dwType == REG_DWORD);
ASSERT(dwCount == sizeof(dwValue));
DCHECK(dwType == REG_DWORD);
DCHECK(dwCount == sizeof(dwValue));
ret = (int)dwValue;
}
RegCloseKey(hKey);
Expand Down
6 changes: 3 additions & 3 deletions appshell/cefclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
#include "include/cef_frame.h"
#include "include/cef_runnable.h"
#include "include/cef_web_plugin.h"
#include "include/base/cef_logging.h"
#include "client_handler.h"
#include "appshell/common/client_switches.h"
#include "util.h"
#include "config.h"

CefRefPtr<ClientHandler> g_handler;
Expand Down Expand Up @@ -49,8 +49,8 @@ CefRefPtr<CefCommandLine> AppGetCommandLine() {

// Returns the application settings based on command line arguments.
void AppGetSettings(CefSettings& settings, CefRefPtr<ClientApp> app) {
ASSERT(app.get());
ASSERT(g_command_line.get());
DCHECK(app.get());
DCHECK(g_command_line.get());
if (!g_command_line.get())
return;

Expand Down
8 changes: 4 additions & 4 deletions appshell/client_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "include/cef_process_message.h"
#include "include/cef_task.h"
#include "include/cef_v8.h"
#include "util.h" // NOLINT(build/include)
#include "include/base/cef_logging.h"
#include "config.h"

namespace {
Expand Down Expand Up @@ -40,7 +40,7 @@ void SetListValue(CefRefPtr<CefListValue> list, int index,

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

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

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

int arg_length = source->GetSize();
if (arg_length == 0)
Expand Down Expand Up @@ -299,7 +299,7 @@ bool ClientApp::OnProcessMessageReceived(
CefRefPtr<CefBrowser> browser,
CefProcessId source_process,
CefRefPtr<CefProcessMessage> message) {
ASSERT(source_process == PID_BROWSER);
DCHECK(source_process == PID_BROWSER);

bool handled = false;

Expand Down
17 changes: 9 additions & 8 deletions appshell/client_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "include/cef_browser.h"
#include "include/cef_frame.h"
#include "include/wrapper/cef_stream_resource_handler.h"
#include "include/wrapper/cef_helpers.h"
#include "cefclient.h"
#include "resource_util.h"
#include "appshell/appshell_extensions.h"
Expand Down Expand Up @@ -148,7 +149,7 @@ bool ClientHandler::OnBeforePopup(CefRefPtr<CefBrowser> browser,
}

void ClientHandler::OnAfterCreated(CefRefPtr<CefBrowser> browser) {
REQUIRE_UI_THREAD();
CEF_REQUIRE_UI_THREAD();

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

void ClientHandler::OnBeforeClose(CefRefPtr<CefBrowser> browser) {
REQUIRE_UI_THREAD();
CEF_REQUIRE_UI_THREAD();

if (CanCloseBrowser(browser)) {
if (m_BrowserId == browser->GetIdentifier()) {
Expand All @@ -190,7 +191,7 @@ std::vector<CefString> gDroppedFiles;
bool ClientHandler::OnDragEnter(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefDragData> dragData,
DragOperationsMask mask) {
REQUIRE_UI_THREAD();
CEF_REQUIRE_UI_THREAD();

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

void ClientHandler::OnLoadStart(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame) {
REQUIRE_UI_THREAD();
CEF_REQUIRE_UI_THREAD();

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

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

// Display a load error message.
std::stringstream ss;
Expand Down Expand Up @@ -268,7 +269,7 @@ void ClientHandler::OnLoadingStateChange(CefRefPtr<CefBrowser> browser,
bool isLoading,
bool canGoBack,
bool canGoForward) {
REQUIRE_UI_THREAD();
CEF_REQUIRE_UI_THREAD();
SetLoading(isLoading);
SetNavState(canGoBack, canGoForward);
}
Expand All @@ -282,7 +283,7 @@ bool ClientHandler::OnConsoleMessage(CefRefPtr<CefBrowser> browser,
// in xcode, or console window in dev tools)

/*
REQUIRE_UI_THREAD();
CEF_REQUIRE_UI_THREAD();

bool first_message;
std::string logFile;
Expand Down
1 change: 0 additions & 1 deletion appshell/client_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <string>
#include "include/base/cef_lock.h"
#include "include/cef_client.h"
#include "util.h"
#include "command_callbacks.h"

#include <algorithm>
Expand Down
5 changes: 3 additions & 2 deletions appshell/client_handler_gtk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "client_handler.h"
#include "include/cef_browser.h"
#include "include/cef_frame.h"
#include "include/wrapper/cef_helpers.h"

// The global ClientHandler reference.
extern CefRefPtr<ClientHandler> g_handler;
Expand All @@ -16,7 +17,7 @@ void ClientHandler::OnAddressChange(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
const CefString& url) {
#ifdef SHOW_TOOLBAR_UI
REQUIRE_UI_THREAD();
CEF_REQUIRE_UI_THREAD();

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

void ClientHandler::OnTitleChange(CefRefPtr<CefBrowser> browser,
const CefString& title) {
REQUIRE_UI_THREAD();
CEF_REQUIRE_UI_THREAD();

GtkWidget* window = gtk_widget_get_ancestor(
GTK_WIDGET(browser->GetHost()->GetWindowHandle()),
Expand Down
5 changes: 3 additions & 2 deletions appshell/client_handler_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "client_handler.h"
#include "include/cef_browser.h"
#include "include/cef_frame.h"
#include "include/wrapper/cef_helpers.h"
#include "cefclient.h"
#include "native_menu_model.h"

Expand Down Expand Up @@ -36,7 +37,7 @@
void ClientHandler::OnAddressChange(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
const CefString& url) {
REQUIRE_UI_THREAD();
CEF_REQUIRE_UI_THREAD();

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

void ClientHandler::OnTitleChange(CefRefPtr<CefBrowser> browser,
const CefString& title) {
REQUIRE_UI_THREAD();
CEF_REQUIRE_UI_THREAD();

// Set the frame window title bar
NSView* view = (NSView*)browser->GetHost()->GetWindowHandle();
Expand Down
5 changes: 3 additions & 2 deletions appshell/client_handler_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <string>
#include "include/cef_browser.h"
#include "include/cef_frame.h"
#include "include/wrapper/cef_helpers.h"
#include "resource.h"
#include "native_menu_model.h"

Expand All @@ -24,12 +25,12 @@ extern HACCEL hAccelTable;
void ClientHandler::OnAddressChange(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
const CefString& url) {
REQUIRE_UI_THREAD();
CEF_REQUIRE_UI_THREAD();
}

void ClientHandler::OnTitleChange(CefRefPtr<CefBrowser> browser,
const CefString& title) {
REQUIRE_UI_THREAD();
CEF_REQUIRE_UI_THREAD();

// Set the frame window title bar
CefWindowHandle hwnd = browser->GetHost()->GetWindowHandle();
Expand Down
18 changes: 18 additions & 0 deletions appshell/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,24 @@

#pragma once

// Taken from cef_build.h
// Including directly cef_build.h causes some problems on Windows.
#if defined(_WIN32)
#ifndef OS_WIN
#define OS_WIN 1
#endif
#elif defined(__APPLE__)
#ifndef OS_MACOSX
#define OS_MACOSX 1
#endif
#elif defined(__linux__)
#ifndef OS_LINUX
#define OS_LINUX 1
#endif
#else
#error Please add support for your platform in config.h
#endif

// Application name used in native code. This name is *not* used in resources.

#ifdef OS_WIN
Expand Down
1 change: 0 additions & 1 deletion appshell/resource_util_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <stdio.h>
#include <string>
#include "include/cef_stream.h"
#include "util.h"

bool GetResourceDir(std::string& dir) {
char buff[1024];
Expand Down
8 changes: 4 additions & 4 deletions appshell/resource_util_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <stdio.h>
#include "resource_util.h"
#include "include/cef_stream.h"
#include "util.h"
#include "include/base/cef_logging.h"

namespace {

Expand All @@ -19,15 +19,15 @@ bool AmIBundled() {
FSRef fsref;
OSStatus pbErr;
if ((pbErr = GetProcessBundleLocation(&psn, &fsref)) != noErr) {
ASSERT(false);
DCHECK(false);
return false;
}

FSCatalogInfo info;
OSErr fsErr;
if ((fsErr = FSGetCatalogInfo(&fsref, kFSCatInfoNodeFlags, &info,
NULL, NULL, NULL)) != noErr) {
ASSERT(false);
DCHECK(false);
return false;
}

Expand All @@ -52,7 +52,7 @@ bool GetResourceDir(std::string& dir) {
return true;
} else {
// TODO: Provide unbundled path
ASSERT(false);
DCHECK(false);
return false;
}
}
Expand Down
6 changes: 3 additions & 3 deletions appshell/resource_util_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "resource_util.h"
#include "include/cef_stream.h"
#include "include/wrapper/cef_byte_read_handler.h"
#include "util.h"
#include "include/base/cef_logging.h"

#if defined(OS_WIN)

Expand Down Expand Up @@ -35,7 +35,7 @@ CefRefPtr<CefStreamReader> GetBinaryResourceReader(int binaryId) {
new CefByteReadHandler(pBytes, dwSize, NULL));
}

ASSERT(FALSE); // The resource should be found.
DCHECK(FALSE); // The resource should be found.
return NULL;
}

Expand All @@ -57,7 +57,7 @@ CefRefPtr<CefStreamReader> GetBinaryResourceReader(const char* resource_name) {
return GetBinaryResourceReader(resource_map[i].id);
}

ASSERT(FALSE); // The resource should be found.
DCHECK(FALSE); // The resource should be found.
return NULL;
}

Expand Down
37 changes: 0 additions & 37 deletions appshell/util.h

This file was deleted.

Loading