From 3b2be7001c7e8d87bddc1ff5655473007ec4ea3b Mon Sep 17 00:00:00 2001 From: Gautam Jha Date: Mon, 24 Sep 2018 17:17:38 +0530 Subject: [PATCH 1/9] CEF 3202 Mac --- Gruntfile.js | 6 +++--- appshell.gyp | 5 ++++- appshell/appshell_extension_handler.h | 2 +- appshell/client_app.h | 6 +++--- appshell/client_app_delegates.cpp | 2 +- appshell/client_handler.cpp | 2 -- appshell/client_handler.h | 6 ++---- appshell/command_callbacks.h | 2 +- appshell_paths.gypi | 4 ++-- common.gypi | 2 ++ package.json | 2 +- tasks/setup.js | 6 +++--- 12 files changed, 23 insertions(+), 22 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 2603d6977..e9867bab7 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -27,7 +27,7 @@ module.exports = function (grunt) { var common = require("./tasks/common")(grunt), platform = common.platform(), staging, - cef_version = "3.2623.1397"; + cef_version = "3.3202.1694.gf061c23"; if (platform === "mac") { staging = "installer/mac/staging/<%= build.name %>.app/Contents"; @@ -323,7 +323,7 @@ module.exports = function (grunt) { } }, "cef": { - "url" : "http://s3.amazonaws.com/files.brackets.io/cef", + "url" : "http://localhost:8000", "version" : cef_version }, "node": { @@ -346,4 +346,4 @@ module.exports = function (grunt) { grunt.loadNpmTasks("grunt-curl"); grunt.registerTask("default", ["setup", "build"]); -}; \ No newline at end of file +}; diff --git a/appshell.gyp b/appshell.gyp index 366557118..37a7fab2c 100755 --- a/appshell.gyp +++ b/appshell.gyp @@ -51,6 +51,7 @@ ], 'defines': [ 'USING_CEF_SHARED', + 'WRAPING_CEF_SHARED', ], 'include_dirs': [ '.', @@ -444,6 +445,7 @@ 'msvs_guid': 'A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9', 'defines': [ 'USING_CEF_SHARED', + 'WRAPPING_CEF_SHARED', ], 'configurations': { 'Common_Base': { @@ -521,6 +523,7 @@ ], 'defines': [ 'USING_CEF_SHARED', + 'WRAPING_CEF_SHARED', ], 'include_dirs': [ '.', @@ -628,4 +631,4 @@ }, }], ], -} \ No newline at end of file +} diff --git a/appshell/appshell_extension_handler.h b/appshell/appshell_extension_handler.h index 588f42bbf..48138d3bf 100644 --- a/appshell/appshell_extension_handler.h +++ b/appshell/appshell_extension_handler.h @@ -157,7 +157,7 @@ class AppShellExtensionHandler : public CefV8Handler { CefRefPtr object, const CefV8ValueList& arguments, CefRefPtr& retval, - CefString& exception) { + CefString& exception) OVERRIDE { // The only messages that are handled here is getElapsedMilliseconds(), // GetCurrentLanguage(), GetApplicationSupportDirectory(), and GetRemoteDebuggingPort(). diff --git a/appshell/client_app.h b/appshell/client_app.h index f1a64940c..7e16eb5c7 100644 --- a/appshell/client_app.h +++ b/appshell/client_app.h @@ -20,7 +20,7 @@ class ClientApp : public CefApp, // Interface for renderer delegates. All RenderDelegates must be returned via // CreateRenderDelegates. Do not perform work in the RenderDelegate // constructor. See CefRenderProcessHandler for documentation. - class RenderDelegate : public virtual CefBase { + class RenderDelegate : public virtual CefBaseRefCounted { public: virtual void OnRenderThreadCreated(CefRefPtr app, CefRefPtr extra_info) {} @@ -93,11 +93,11 @@ class ClientApp : public CefApp, static void CreateRenderDelegates(RenderDelegateSet& delegates); // Registers custom schemes. Implemented in client_app_delegates. - static void RegisterCustomSchemes(CefRefPtr registrar); + static void RegisterCustomSchemes(CefRawPtr registrar); // CefApp methods. virtual void OnRegisterCustomSchemes( - CefRefPtr registrar) OVERRIDE { + CefRawPtr registrar) OVERRIDE { RegisterCustomSchemes(registrar); } virtual CefRefPtr GetRenderProcessHandler() diff --git a/appshell/client_app_delegates.cpp b/appshell/client_app_delegates.cpp index f8345d852..a093b358c 100644 --- a/appshell/client_app_delegates.cpp +++ b/appshell/client_app_delegates.cpp @@ -9,5 +9,5 @@ void ClientApp::CreateRenderDelegates(RenderDelegateSet& delegates) { } // static -void ClientApp::RegisterCustomSchemes(CefRefPtr registrar) { +void ClientApp::RegisterCustomSchemes(CefRawPtr registrar) { } diff --git a/appshell/client_handler.cpp b/appshell/client_handler.cpp index 83d3d8f6f..b4a32c777 100644 --- a/appshell/client_handler.cpp +++ b/appshell/client_handler.cpp @@ -205,9 +205,7 @@ bool ClientHandler::OnDragEnter(CefRefPtr browser, void ClientHandler::OnLoadStart(CefRefPtr browser, CefRefPtr frame - #ifdef OS_LINUX ,TransitionType transition_type - #endif ) { CEF_REQUIRE_UI_THREAD(); diff --git a/appshell/client_handler.h b/appshell/client_handler.h index 7c67a3598..0395e2d25 100644 --- a/appshell/client_handler.h +++ b/appshell/client_handler.h @@ -37,7 +37,7 @@ class ClientHandler : public CefClient, public: // Interface for process message delegates. Do not perform work in the // RenderDelegate constructor. - class ProcessMessageDelegate : public virtual CefBase { + class ProcessMessageDelegate : public virtual CefBaseRefCounted { public: // Called when a process message is received. Return true if the message was // handled and should not be passed on to other handlers. @@ -57,7 +57,7 @@ class ClientHandler : public CefClient, // Interface for request handler delegates. Do not perform work in the // RequestDelegate constructor. - class RequestDelegate : public virtual CefBase { + class RequestDelegate : public virtual CefBaseRefCounted { public: // Called to retrieve a resource handler. virtual CefRefPtr GetResourceHandler( @@ -135,9 +135,7 @@ virtual bool OnBeforePopup(CefRefPtr browser, // CefLoadHandler methods virtual void OnLoadStart(CefRefPtr browser, CefRefPtr frame - #ifdef OS_LINUX ,TransitionType transition_type - #endif ) OVERRIDE; virtual void OnLoadEnd(CefRefPtr browser, CefRefPtr frame, diff --git a/appshell/command_callbacks.h b/appshell/command_callbacks.h index 709797c48..8ff25fe51 100644 --- a/appshell/command_callbacks.h +++ b/appshell/command_callbacks.h @@ -53,7 +53,7 @@ const ExtensionString EDIT_SELECT_ALL = "edit.selectAll"; #endif // Base CommandCallback class -class CommandCallback : public CefBase { +class CommandCallback : public CefBaseRefCounted { public: // Called when the command is complete. When handled=true, the command diff --git a/appshell_paths.gypi b/appshell_paths.gypi index 3b14692a1..a9af24301 100755 --- a/appshell_paths.gypi +++ b/appshell_paths.gypi @@ -120,8 +120,8 @@ 'libcef_dll/base/cef_thread_checker_impl.cc', 'libcef_dll/base/cef_thread_collision_warner.cc', 'libcef_dll/base/cef_weak_ptr.cc', - 'libcef_dll/cpptoc/base_cpptoc.cc', - 'libcef_dll/cpptoc/base_cpptoc.h', + 'libcef_dll/cpptoc/base_ref_counted_cpptoc.cc', + 'libcef_dll/cpptoc/base_ref_counted_cpptoc.h', 'libcef_dll/cpptoc/cpptoc.h', 'libcef_dll/ctocpp/ctocpp.h', 'libcef_dll/transfer_util.cc', diff --git a/common.gypi b/common.gypi index 8289d37fe..d84667a39 100644 --- a/common.gypi +++ b/common.gypi @@ -2266,6 +2266,7 @@ # Note: this is *required* to make some plugins work. '-fvisibility=hidden', '-pipe', + '-Wno-undefined-var-template', ], 'cflags_cc': [ '-fno-rtti', @@ -3119,6 +3120,7 @@ # Don't warn about the "struct foo f = {0};" initialization # pattern. '-Wno-missing-field-initializers', + '-Wno-undefined-var-template', ], 'conditions': [ ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'}, diff --git a/package.json b/package.json index e8dbf740e..12068a7d2 100644 --- a/package.json +++ b/package.json @@ -28,4 +28,4 @@ "install": "", "postinstall": "bash -c 'mv .appshell.gyp appshell.gyp;'" } -} \ No newline at end of file +} diff --git a/tasks/setup.js b/tasks/setup.js index 381fe2fbc..464bd71fc 100644 --- a/tasks/setup.js +++ b/tasks/setup.js @@ -384,10 +384,10 @@ module.exports = function (grunt) { var memo = path.resolve(process.cwd(), "deps/cef/" + zipName + ".txt"), permissionsPromise; - if (platform === "mac") { + /*if (platform === "mac") { // FIXME figure out how to use fs.chmod to only do additive mode u+x permissionsPromise = exec("chmod u+x deps/cef/tools/*"); - } else { + } else */{ permissionsPromise = q.resolve(); } @@ -688,4 +688,4 @@ module.exports = function (grunt) { } else { grunt.registerTask("setup", ["cef", "node", "node-check", "icu", "create-project"]); } -}; \ No newline at end of file +}; From e0eadaa81e686f52d29f6c3ce6370932619e601c Mon Sep 17 00:00:00 2001 From: Gautam Jha Date: Mon, 24 Sep 2018 23:28:07 +0530 Subject: [PATCH 2/9] CEF 3202 --- appshell.gyp | 32 +++--- appshell/cefclient_mac.mm | 1 - common.gypi | 220 +++++++++++++++++++------------------- 3 files changed, 126 insertions(+), 127 deletions(-) diff --git a/appshell.gyp b/appshell.gyp index 37a7fab2c..0bc4706bd 100755 --- a/appshell.gyp +++ b/appshell.gyp @@ -305,22 +305,22 @@ '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_FOLDER_PATH}/Brackets-node', ], }, - { - # This postbuid step is responsible for creating the following - # helpers: - # - # <(appname) Helper EH.app and <(appname) Helper NP.app are created - # from <(appname) Helper.app. - # - # The EH helper is marked for an executable heap. The NP helper - # is marked for no PIE (ASLR). - 'postbuild_name': 'Make More Helpers', - 'action': [ - 'tools/make_more_helpers.sh', - 'Frameworks', - '<(appname)', - ], - }, +# { +# # This postbuid step is responsible for creating the following +# # helpers: +# # +# # <(appname) Helper EH.app and <(appname) Helper NP.app are created +# # from <(appname) Helper.app. +# # +# # The EH helper is marked for an executable heap. The NP helper +# # is marked for no PIE (ASLR). +# 'postbuild_name': 'Make More Helpers', +# 'action': [ +# 'tools/make_more_helpers.sh', +# 'Frameworks', +# '<(appname)', +# ], +# }, ], 'link_settings': { 'libraries': [ diff --git a/appshell/cefclient_mac.mm b/appshell/cefclient_mac.mm index d588bbd30..09eb5e61a 100644 --- a/appshell/cefclient_mac.mm +++ b/appshell/cefclient_mac.mm @@ -13,7 +13,6 @@ #import "include/cef_application_mac.h" #include "include/cef_browser.h" #include "include/cef_frame.h" -#include "include/cef_runnable.h" #include "client_handler.h" #include "appshell/browser/resource_util.h" #include "config.h" diff --git a/common.gypi b/common.gypi index d84667a39..69b294238 100644 --- a/common.gypi +++ b/common.gypi @@ -3241,116 +3241,116 @@ '-fno-strict-aliasing', # See http://crbug.com/32204 ], }, - 'target_conditions': [ - ['_type=="executable"', { - 'postbuilds': [ - { - # Arranges for data (heap) pages to be protected against - # code execution when running on Mac OS X 10.7 ("Lion"), and - # ensures that the position-independent executable (PIE) bit - # is set for ASLR when running on Mac OS X 10.5 ("Leopard"). - 'variables': { - # Define change_mach_o_flags in a variable ending in _path - # so that GYP understands it's a path and performs proper - # relativization during dict merging. - 'change_mach_o_flags_path': - 'mac/change_mach_o_flags_from_xcode.sh', - 'change_mach_o_flags_options%': [ - ], - 'target_conditions': [ - ['mac_pie==0 or release_valgrind_build==1', { - # Don't enable PIE if it's unwanted. It's unwanted if - # the target specifies mac_pie=0 or if building for - # Valgrind, because Valgrind doesn't understand slide. - # See the similar mac_pie/release_valgrind_build check - # below. - 'change_mach_o_flags_options': [ - '--no-pie', - ], - }], - ], - }, - 'postbuild_name': 'Change Mach-O Flags', - 'action': [ - '<(change_mach_o_flags_path)', - '>@(change_mach_o_flags_options)', - ], - }, - ], - 'conditions': [ - ['asan==1', { - 'variables': { - 'asan_saves_file': 'asan.saves', - }, - 'xcode_settings': { - 'CHROMIUM_STRIP_SAVE_FILE': '<(asan_saves_file)', - }, - }], - ], - 'target_conditions': [ - ['mac_pie==1 and release_valgrind_build==0', { - # Turn on position-independence (ASLR) for executables. When - # PIE is on for the Chrome executables, the framework will - # also be subject to ASLR. - # Don't do this when building for Valgrind, because Valgrind - # doesn't understand slide. TODO: Make Valgrind on Mac OS X - # understand slide, and get rid of the Valgrind check. - 'xcode_settings': { - 'OTHER_LDFLAGS': [ - '-Wl,-pie', # Position-independent executable (MH_PIE) - ], - }, - }], - ], - }], - ['(_type=="executable" or _type=="shared_library" or \ - _type=="loadable_module") and mac_strip!=0', { - 'target_conditions': [ - ['mac_real_dsym == 1', { - # To get a real .dSYM bundle produced by dsymutil, set the - # debug information format to dwarf-with-dsym. Since - # strip_from_xcode will not be used, set Xcode to do the - # stripping as well. - 'configurations': { - 'Release_Base': { - 'xcode_settings': { - 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym', - 'DEPLOYMENT_POSTPROCESSING': 'YES', - 'STRIP_INSTALLED_PRODUCT': 'YES', - 'target_conditions': [ - ['_type=="shared_library" or _type=="loadable_module"', { - # The Xcode default is to strip debugging symbols - # only (-S). Local symbols should be stripped as - # well, which will be handled by -x. Xcode will - # continue to insert -S when stripping even when - # additional flags are added with STRIPFLAGS. - 'STRIPFLAGS': '-x', - }], # _type=="shared_library" or _type=="loadable_module"' - ], # target_conditions - }, # xcode_settings - }, # configuration "Release" - }, # configurations - }, { # mac_real_dsym != 1 - # To get a fast fake .dSYM bundle, use a post-build step to - # produce the .dSYM and strip the executable. strip_from_xcode - # only operates in the Release configuration. - 'postbuilds': [ - { - 'variables': { - # Define strip_from_xcode in a variable ending in _path - # so that gyp understands it's a path and performs proper - # relativization during dict merging. - 'strip_from_xcode_path': 'mac/strip_from_xcode' - }, - 'postbuild_name': 'Strip If Needed', - 'action': ['scripts/strip_from_xcode.sh'] - }, - ], # postbuilds - }], # mac_real_dsym - ], # target_conditions - }], # (_type=="executable" or _type=="shared_library" or - # _type=="loadable_module") and mac_strip!=0 - ], # target_conditions +# 'target_conditions': [ +# ['_type=="executable"', { +# 'postbuilds': [ +# { +# # Arranges for data (heap) pages to be protected against +# # code execution when running on Mac OS X 10.7 ("Lion"), and +# # ensures that the position-independent executable (PIE) bit +# # is set for ASLR when running on Mac OS X 10.5 ("Leopard"). +# 'variables': { +# # Define change_mach_o_flags in a variable ending in _path +# # so that GYP understands it's a path and performs proper +# # relativization during dict merging. +# 'change_mach_o_flags_path': +# 'mac/change_mach_o_flags_from_xcode.sh', +# 'change_mach_o_flags_options%': [ +# ], +# 'target_conditions': [ +# ['mac_pie==0 or release_valgrind_build==1', { +# # Don't enable PIE if it's unwanted. It's unwanted if +# # the target specifies mac_pie=0 or if building for +# # Valgrind, because Valgrind doesn't understand slide. +# # See the similar mac_pie/release_valgrind_build check +# # below. +# 'change_mach_o_flags_options': [ +# '--no-pie', +# ], +# }], +# ], +# }, +# 'postbuild_name': 'Change Mach-O Flags', +# 'action': [ +# '<(change_mach_o_flags_path)', +# '>@(change_mach_o_flags_options)', +# ], +# }, +# ], +# 'conditions': [ +# ['asan==1', { +# 'variables': { +# 'asan_saves_file': 'asan.saves', +# }, +# 'xcode_settings': { +# 'CHROMIUM_STRIP_SAVE_FILE': '<(asan_saves_file)', +# }, +# }], +# ], +# 'target_conditions': [ +# ['mac_pie==1 and release_valgrind_build==0', { +# # Turn on position-independence (ASLR) for executables. When +# # PIE is on for the Chrome executables, the framework will +# # also be subject to ASLR. +# # Don't do this when building for Valgrind, because Valgrind +# # doesn't understand slide. TODO: Make Valgrind on Mac OS X +# # understand slide, and get rid of the Valgrind check. +# 'xcode_settings': { +# 'OTHER_LDFLAGS': [ +# '-Wl,-pie', # Position-independent executable (MH_PIE) +# ], +# }, +# }], +# ], +# }], +# ['(_type=="executable" or _type=="shared_library" or \ +# _type=="loadable_module") and mac_strip!=0', { +# 'target_conditions': [ +# ['mac_real_dsym == 1', { +# # To get a real .dSYM bundle produced by dsymutil, set the +# # debug information format to dwarf-with-dsym. Since +# # strip_from_xcode will not be used, set Xcode to do the +# # stripping as well. +# 'configurations': { +# 'Release_Base': { +# 'xcode_settings': { +# 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym', +# 'DEPLOYMENT_POSTPROCESSING': 'YES', +# 'STRIP_INSTALLED_PRODUCT': 'YES', +# 'target_conditions': [ +# ['_type=="shared_library" or _type=="loadable_module"', { +# # The Xcode default is to strip debugging symbols +# # only (-S). Local symbols should be stripped as +# # well, which will be handled by -x. Xcode will +# # continue to insert -S when stripping even when +# # additional flags are added with STRIPFLAGS. +# 'STRIPFLAGS': '-x', +# }], # _type=="shared_library" or _type=="loadable_module"' +# ], # target_conditions +# }, # xcode_settings +# }, # configuration "Release" +# }, # configurations +# }, { # mac_real_dsym != 1 +# # To get a fast fake .dSYM bundle, use a post-build step to +# # produce the .dSYM and strip the executable. strip_from_xcode +# # only operates in the Release configuration. +# 'postbuilds': [ +# { +# 'variables': { +# # Define strip_from_xcode in a variable ending in _path +# # so that gyp understands it's a path and performs proper +# # relativization during dict merging. +# 'strip_from_xcode_path': 'mac/strip_from_xcode' +# }, +# 'postbuild_name': 'Strip If Needed', +# 'action': ['scripts/strip_from_xcode.sh'] +# }, +# ], # postbuilds +# }], # mac_real_dsym +# ], # target_conditions +# }], # (_type=="executable" or _type=="shared_library" or +# # _type=="loadable_module") and mac_strip!=0 +# ], # target_conditions }, # target_defaults }], # OS=="mac" ['OS=="ios"', { From c66d3b93b2173058ccc65e1552f7b0ba00cb2957 Mon Sep 17 00:00:00 2001 From: Gautam Jha Date: Fri, 28 Sep 2018 09:43:50 +0530 Subject: [PATCH 3/9] Complted Windows 32 build using Visual Studio 15 --- appshell/cefclient_win.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/appshell/cefclient_win.cpp b/appshell/cefclient_win.cpp index a53ceb07a..0de65aded 100644 --- a/appshell/cefclient_win.cpp +++ b/appshell/cefclient_win.cpp @@ -13,7 +13,6 @@ #include "include/cef_version.h" #include "include/cef_browser.h" #include "include/cef_frame.h" -#include "include/cef_runnable.h" #include "client_handler.h" #include "config.h" #include "appshell/browser/resource.h" From b4a6c89bd5f3a63e57263c7fa9e512725f4999d0 Mon Sep 17 00:00:00 2001 From: Gautam Jha Date: Wed, 3 Oct 2018 16:09:26 +0530 Subject: [PATCH 4/9] Updated CEF version to 3.3497.1836.gb472a8d --- Gruntfile.js | 2 +- appshell/client_handler.cpp | 59 ------------------------------------- appshell/client_handler.h | 15 ---------- appshell_paths.gypi | 30 ++++++++++++------- 4 files changed, 20 insertions(+), 86 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index def55fa10..9bb6b84da 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -27,7 +27,7 @@ module.exports = function (grunt) { var common = require("./tasks/common")(grunt), platform = common.platform(), staging, - cef_version = "3.3202.1694.gf061c23"; + cef_version = "3.3497.1836.gb472a8d"; if (platform === "mac") { staging = "installer/mac/staging/<%= build.name %>.app/Contents"; diff --git a/appshell/client_handler.cpp b/appshell/client_handler.cpp index b4a32c777..075e24810 100644 --- a/appshell/client_handler.cpp +++ b/appshell/client_handler.cpp @@ -278,65 +278,6 @@ void ClientHandler::OnLoadingStateChange(CefRefPtr browser, SetNavState(canGoBack, canGoForward); } -bool ClientHandler::OnConsoleMessage(CefRefPtr browser, - const CefString& message, - const CefString& source, - int line) { - // Don't write the message to a console.log file. Instead, we'll just - // return false here so the message gets written to the console (output window - // in xcode, or console window in dev tools) - -/* - CEF_REQUIRE_UI_THREAD(); - - bool first_message; - std::string logFile; - - { - AutoLock lock_scope(this); - - first_message = m_LogFile.empty(); - if (first_message) { - std::stringstream ss; - ss << AppGetWorkingDirectory(); -#if defined(OS_WIN) - ss << "\\"; -#else - ss << "/"; -#endif - ss << "console.log"; - m_LogFile = ss.str(); - } - logFile = m_LogFile; - } - - FILE* file = fopen(logFile.c_str(), "a"); - if (file) { - std::stringstream ss; - ss << "Message: " << std::string(message) << "\r\nSource: " << - std::string(source) << "\r\nLine: " << line << - "\r\n-----------------------\r\n"; - fputs(ss.str().c_str(), file); - fclose(file); - - if (first_message) - SendNotification(NOTIFY_CONSOLE_MESSAGE); - } -*/ - return false; -} - -bool ClientHandler::OnRequestGeolocationPermission( - CefRefPtr browser, - const CefString& requesting_url, - int request_id, - CefRefPtr callback) { - // Allow geolocation access from all websites. - // TODO: What does ref app do? - callback->Continue(true); - return true; -} - void ClientHandler::OnBeforeContextMenu( CefRefPtr browser, CefRefPtr frame, diff --git a/appshell/client_handler.h b/appshell/client_handler.h index 0395e2d25..774885b7f 100644 --- a/appshell/client_handler.h +++ b/appshell/client_handler.h @@ -31,7 +31,6 @@ class ClientHandler : public CefClient, public CefRequestHandler, public CefDisplayHandler, public CefKeyboardHandler, - public CefGeolocationHandler, public CefContextMenuHandler { public: @@ -94,9 +93,6 @@ class ClientHandler : public CefClient, virtual CefRefPtr GetDisplayHandler() OVERRIDE { return this; } - virtual CefRefPtr GetGeolocationHandler() OVERRIDE { - return this; - } virtual CefRefPtr GetContextMenuHandler() OVERRIDE { return this; } @@ -162,17 +158,6 @@ virtual bool OnBeforePopup(CefRefPtr browser, const CefString& url) OVERRIDE; virtual void OnTitleChange(CefRefPtr browser, const CefString& title) OVERRIDE; - virtual bool OnConsoleMessage(CefRefPtr browser, - const CefString& message, - const CefString& source, - int line) OVERRIDE; - - // CefGeolocationHandler methods - virtual bool OnRequestGeolocationPermission( - CefRefPtr browser, - const CefString& requesting_url, - int request_id, - CefRefPtr callback) OVERRIDE; // CefContextMenuHandler methods virtual void OnBeforeContextMenu(CefRefPtr browser, diff --git a/appshell_paths.gypi b/appshell_paths.gypi index a9af24301..0790a3384 100755 --- a/appshell_paths.gypi +++ b/appshell_paths.gypi @@ -30,7 +30,6 @@ 'include/base/cef_string16.h', 'include/base/cef_template_util.h', 'include/base/cef_thread_checker.h', - 'include/base/cef_thread_collision_warner.h', 'include/base/cef_trace_event.h', 'include/base/cef_tuple.h', 'include/base/cef_weak_ptr.h', @@ -40,9 +39,6 @@ 'include/base/internal/cef_raw_scoped_refptr_mismatch_checker.h', 'include/base/internal/cef_thread_checker_impl.h', 'include/cef_base.h', - 'include/cef_pack_resources.h', - 'include/cef_pack_strings.h', - 'include/cef_runnable.h', 'include/cef_version.h', 'include/internal/cef_export.h', 'include/internal/cef_logging_internal.h', @@ -70,6 +66,7 @@ 'include/wrapper/cef_helpers.h', 'include/wrapper/cef_message_router.h', 'include/wrapper/cef_resource_manager.h', + 'include/wrapper/cef_scoped_temp_dir.h', 'include/wrapper/cef_stream_resource_handler.h', 'include/wrapper/cef_xml_object.h', 'include/wrapper/cef_zip_archive.h', @@ -90,17 +87,23 @@ ], 'includes_linux': [ 'include/base/internal/cef_atomicops_atomicword_compat.h', + 'include/base/internal/cef_atomicops_arm_gcc.h', 'include/base/internal/cef_atomicops_x86_gcc.h', 'include/internal/cef_linux.h', 'include/internal/cef_types_linux.h', ], 'libcef_sources_common': [ - 'libcef_dll/cpptoc/cpptoc.h', - 'libcef_dll/ctocpp/base_ctocpp.cc', - 'libcef_dll/ctocpp/base_ctocpp.h', - 'libcef_dll/ctocpp/ctocpp.h', + 'libcef_dll/cpptoc/cpptoc_ref_counted.h', + 'libcef_dll/cpptoc/cpptoc_scoped.h', + 'libcef_dll/ctocpp/base_ref_counted_ctocpp.cc', + 'libcef_dll/ctocpp/base_ref_counted_ctocpp.h', + 'libcef_dll/ctocpp/base_scoped_ctocpp.cc', + 'libcef_dll/ctocpp/base_scoped_ctocpp.h', + 'libcef_dll/ctocpp/ctocpp_ref_counted.h', + 'libcef_dll/ctocpp/ctocpp_scoped.h', 'libcef_dll/libcef_dll.cc', 'libcef_dll/libcef_dll2.cc', + 'libcef_dll/ptr_util.h', 'libcef_dll/resource.h', 'libcef_dll/transfer_util.cc', 'libcef_dll/transfer_util.h', @@ -118,12 +121,16 @@ 'libcef_dll/base/cef_ref_counted.cc', 'libcef_dll/base/cef_string16.cc', 'libcef_dll/base/cef_thread_checker_impl.cc', - 'libcef_dll/base/cef_thread_collision_warner.cc', 'libcef_dll/base/cef_weak_ptr.cc', 'libcef_dll/cpptoc/base_ref_counted_cpptoc.cc', 'libcef_dll/cpptoc/base_ref_counted_cpptoc.h', - 'libcef_dll/cpptoc/cpptoc.h', - 'libcef_dll/ctocpp/ctocpp.h', + 'libcef_dll/cpptoc/base_scoped_cpptoc.cc', + 'libcef_dll/cpptoc/base_scoped_cpptoc.h', + 'libcef_dll/cpptoc/cpptoc_ref_counted.h', + 'libcef_dll/cpptoc/cpptoc_scoped.h', + 'libcef_dll/ctocpp/ctocpp_ref_counted.h', + 'libcef_dll/ctocpp/ctocpp_scoped.h', + 'libcef_dll/ptr_util.h', 'libcef_dll/transfer_util.cc', 'libcef_dll/transfer_util.h', 'libcef_dll/wrapper_types.h', @@ -132,6 +139,7 @@ 'libcef_dll/wrapper/cef_closure_task.cc', 'libcef_dll/wrapper/cef_message_router.cc', 'libcef_dll/wrapper/cef_resource_manager.cc', + 'libcef_dll/wrapper/cef_scoped_temp_dir.cc', 'libcef_dll/wrapper/cef_stream_resource_handler.cc', 'libcef_dll/wrapper/cef_xml_object.cc', 'libcef_dll/wrapper/cef_zip_archive.cc', From 7b48ac6a3ff945832e2f2d1694499239385c57b3 Mon Sep 17 00:00:00 2001 From: Gautam Jha Date: Tue, 16 Oct 2018 11:27:17 +0530 Subject: [PATCH 5/9] updated CEF to 3.3538.1841.gdcdb070 --- Gruntfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index 9bb6b84da..3e43c13c7 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -27,7 +27,7 @@ module.exports = function (grunt) { var common = require("./tasks/common")(grunt), platform = common.platform(), staging, - cef_version = "3.3497.1836.gb472a8d"; + cef_version = "3.3538.1841.gdcdb070"; if (platform === "mac") { staging = "installer/mac/staging/<%= build.name %>.app/Contents"; From ca5bb96bb057e65dd3ee88b596916c85a0a9d490 Mon Sep 17 00:00:00 2001 From: Gautam Jha Date: Wed, 17 Oct 2018 15:24:10 +0530 Subject: [PATCH 6/9] Updating gyp configs according to cef/cef_paths2.gypi in CEF-3.3538.1846.g678fa78 --- Gruntfile.js | 2 +- appshell.gyp | 1 + appshell_paths.gypi | 12 +++++++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 3e43c13c7..0f9d75bb7 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -27,7 +27,7 @@ module.exports = function (grunt) { var common = require("./tasks/common")(grunt), platform = common.platform(), staging, - cef_version = "3.3538.1841.gdcdb070"; + cef_version = "3.3538.1846.g678fa78"; if (platform === "mac") { staging = "installer/mac/staging/<%= build.name %>.app/Contents"; diff --git a/appshell.gyp b/appshell.gyp index 0bc4706bd..0aa2915ba 100755 --- a/appshell.gyp +++ b/appshell.gyp @@ -461,6 +461,7 @@ '<@(includes_common)', '<@(includes_capi)', '<@(includes_wrapper)', + '<@(libcef_dll_wrapper_sources_base)', '<@(libcef_dll_wrapper_sources_common)', ], 'xcode_settings': { diff --git a/appshell_paths.gypi b/appshell_paths.gypi index 0790a3384..66db1e3f2 100755 --- a/appshell_paths.gypi +++ b/appshell_paths.gypi @@ -71,6 +71,9 @@ 'include/wrapper/cef_xml_object.h', 'include/wrapper/cef_zip_archive.h', ], + 'includes_wrapper_mac': [ + 'include/wrapper/cef_library_loader.h', + ], 'includes_win': [ 'include/base/internal/cef_atomicops_x86_msvc.h', 'include/base/internal/cef_bind_internal_win.h', @@ -82,6 +85,7 @@ 'include/base/internal/cef_atomicops_atomicword_compat.h', 'include/base/internal/cef_atomicops_mac.h', 'include/cef_application_mac.h', + 'include/cef_sandbox_mac.h', 'include/internal/cef_mac.h', 'include/internal/cef_types_mac.h', ], @@ -110,7 +114,7 @@ 'libcef_dll/wrapper_types.h', '<@(autogen_library_side)', ], - 'libcef_dll_wrapper_sources_common': [ + 'libcef_dll_wrapper_sources_base': [ 'libcef_dll/base/cef_atomicops_x86_gcc.cc', 'libcef_dll/base/cef_bind_helpers.cc', 'libcef_dll/base/cef_callback_helpers.cc', @@ -122,6 +126,8 @@ 'libcef_dll/base/cef_string16.cc', 'libcef_dll/base/cef_thread_checker_impl.cc', 'libcef_dll/base/cef_weak_ptr.cc', + ], + 'libcef_dll_wrapper_sources_common': [ 'libcef_dll/cpptoc/base_ref_counted_cpptoc.cc', 'libcef_dll/cpptoc/base_ref_counted_cpptoc.h', 'libcef_dll/cpptoc/base_scoped_cpptoc.cc', @@ -147,6 +153,10 @@ 'libcef_dll/wrapper/libcef_dll_wrapper2.cc', '<@(autogen_client_side)', ], + 'libcef_dll_wrapper_sources_mac': [ + 'libcef_dll/wrapper/cef_library_loader_mac.mm', + 'libcef_dll/wrapper/libcef_dll_dylib.cc', + ], 'appshell_sources_browser': [ 'appshell/browser/client_types.h', 'appshell/browser/resource.h', From 797959050e2c51145117ed93ea8c5c97d24c1e7f Mon Sep 17 00:00:00 2001 From: Gautam Jha Date: Fri, 19 Oct 2018 17:14:36 +0530 Subject: [PATCH 7/9] fixing compiler warnings and linking errors --- appshell.gyp | 30 +---------- appshell/cefclient_mac.mm | 7 +-- appshell/update.cpp | 2 +- common.gypi | 110 -------------------------------------- 4 files changed, 7 insertions(+), 142 deletions(-) diff --git a/appshell.gyp b/appshell.gyp index 0aa2915ba..bb0576bd3 100755 --- a/appshell.gyp +++ b/appshell.gyp @@ -275,16 +275,6 @@ '${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Contents/Frameworks/' ], }, - { - 'postbuild_name': 'Fix Framework Link', - 'action': [ - 'install_name_tool', - '-change', - '@executable_path/<(framework_name)', - '@executable_path/../Frameworks/<(framework_name).framework/<(framework_name)', - '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}' - ], - }, { # Copy the entire "node-core" directory into the same location as the "www" # directory will end up. Note that the ".." in the path is necessary because @@ -305,22 +295,6 @@ '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_FOLDER_PATH}/Brackets-node', ], }, -# { -# # This postbuid step is responsible for creating the following -# # helpers: -# # -# # <(appname) Helper EH.app and <(appname) Helper NP.app are created -# # from <(appname) Helper.app. -# # -# # The EH helper is marked for an executable heap. The NP helper -# # is marked for no PIE (ASLR). -# 'postbuild_name': 'Make More Helpers', -# 'action': [ -# 'tools/make_more_helpers.sh', -# 'Frameworks', -# '<(appname)', -# ], -# }, ], 'link_settings': { 'libraries': [ @@ -574,11 +548,11 @@ # (DYLIB_INSTALL_NAME_BASE) relative to the main executable # (chrome). A different relative path needs to be used in # appshell_helper_app. - 'postbuild_name': 'Fix Framework Link', + 'postbuild_name': 'Fix Framework Link for Brackets Helper', 'action': [ 'install_name_tool', '-change', - '@executable_path/<(framework_name)', + '@executable_path/../Frameworks/<(framework_name).framework/<(framework_name)', '@executable_path/../../../../Frameworks/<(framework_name).framework/<(framework_name)', '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}' ], diff --git a/appshell/cefclient_mac.mm b/appshell/cefclient_mac.mm index 09eb5e61a..9901ada0a 100644 --- a/appshell/cefclient_mac.mm +++ b/appshell/cefclient_mac.mm @@ -554,7 +554,7 @@ - (void)cleanup:(id)window { // BOBNOTE: Consider moving the AppDelegate interface into its own .h file // Receives notifications from the application. Will delete itself when done. -@interface ClientAppDelegate : NSObject +@interface ClientAppDelegate : NSObject { ClientWindowDelegate *delegate; ClientMenuDelegate *menuDelegate; @@ -680,7 +680,7 @@ - (void)createApp:(id)object { CefWindowInfo window_info; CefBrowserSettings settings; - settings.web_security = STATE_DISABLED; + settings.universal_access_from_file_urls = STATE_ENABLED; // Necessary to enable document.executeCommand("paste") settings.javascript_access_clipboard = STATE_ENABLED; @@ -827,11 +827,12 @@ int main(int argc, char* argv[]) { // Initialize the ClientApplication instance. [ClientApplication sharedApplication]; - NSObject* delegate = [[ClientAppDelegate alloc] init]; + NSObject* delegate = [[ClientAppDelegate alloc] init]; [NSApp setDelegate:delegate]; // Parse command line arguments. CefRefPtr cmdLine = CefCommandLine::CreateCommandLine(); + cmdLine->AppendSwitch(client::switches::kUniversalAccessFromFileUrlsAllowed); cmdLine->InitFromArgv(argc, argv); CefSettings settings; diff --git a/appshell/update.cpp b/appshell/update.cpp index e3fc06acd..41f401a49 100644 --- a/appshell/update.cpp +++ b/appshell/update.cpp @@ -62,4 +62,4 @@ int32 ParseCommandLineParamsJSON(CefString &updateArgs, CefRefPtr@(change_mach_o_flags_options)', -# ], -# }, -# ], -# 'conditions': [ -# ['asan==1', { -# 'variables': { -# 'asan_saves_file': 'asan.saves', -# }, -# 'xcode_settings': { -# 'CHROMIUM_STRIP_SAVE_FILE': '<(asan_saves_file)', -# }, -# }], -# ], -# 'target_conditions': [ -# ['mac_pie==1 and release_valgrind_build==0', { -# # Turn on position-independence (ASLR) for executables. When -# # PIE is on for the Chrome executables, the framework will -# # also be subject to ASLR. -# # Don't do this when building for Valgrind, because Valgrind -# # doesn't understand slide. TODO: Make Valgrind on Mac OS X -# # understand slide, and get rid of the Valgrind check. -# 'xcode_settings': { -# 'OTHER_LDFLAGS': [ -# '-Wl,-pie', # Position-independent executable (MH_PIE) -# ], -# }, -# }], -# ], -# }], -# ['(_type=="executable" or _type=="shared_library" or \ -# _type=="loadable_module") and mac_strip!=0', { -# 'target_conditions': [ -# ['mac_real_dsym == 1', { -# # To get a real .dSYM bundle produced by dsymutil, set the -# # debug information format to dwarf-with-dsym. Since -# # strip_from_xcode will not be used, set Xcode to do the -# # stripping as well. -# 'configurations': { -# 'Release_Base': { -# 'xcode_settings': { -# 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym', -# 'DEPLOYMENT_POSTPROCESSING': 'YES', -# 'STRIP_INSTALLED_PRODUCT': 'YES', -# 'target_conditions': [ -# ['_type=="shared_library" or _type=="loadable_module"', { -# # The Xcode default is to strip debugging symbols -# # only (-S). Local symbols should be stripped as -# # well, which will be handled by -x. Xcode will -# # continue to insert -S when stripping even when -# # additional flags are added with STRIPFLAGS. -# 'STRIPFLAGS': '-x', -# }], # _type=="shared_library" or _type=="loadable_module"' -# ], # target_conditions -# }, # xcode_settings -# }, # configuration "Release" -# }, # configurations -# }, { # mac_real_dsym != 1 -# # To get a fast fake .dSYM bundle, use a post-build step to -# # produce the .dSYM and strip the executable. strip_from_xcode -# # only operates in the Release configuration. -# 'postbuilds': [ -# { -# 'variables': { -# # Define strip_from_xcode in a variable ending in _path -# # so that gyp understands it's a path and performs proper -# # relativization during dict merging. -# 'strip_from_xcode_path': 'mac/strip_from_xcode' -# }, -# 'postbuild_name': 'Strip If Needed', -# 'action': ['scripts/strip_from_xcode.sh'] -# }, -# ], # postbuilds -# }], # mac_real_dsym -# ], # target_conditions -# }], # (_type=="executable" or _type=="shared_library" or -# # _type=="loadable_module") and mac_strip!=0 -# ], # target_conditions }, # target_defaults }], # OS=="mac" ['OS=="ios"', { From e487e3a9fe2c8e2803772e38932722d0f7d82c72 Mon Sep 17 00:00:00 2001 From: Gautam Jha Date: Mon, 22 Oct 2018 19:17:30 +0530 Subject: [PATCH 8/9] Disabled web-security to enable file:/// resource servicing, those were blocked by chromium for being cross origin. For file:// resource, hostnames are considered different despite pointing to same host --- appshell/cefclient_mac.mm | 2 -- appshell/client_app.h | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/appshell/cefclient_mac.mm b/appshell/cefclient_mac.mm index 9901ada0a..9a0539734 100644 --- a/appshell/cefclient_mac.mm +++ b/appshell/cefclient_mac.mm @@ -680,8 +680,6 @@ - (void)createApp:(id)object { CefWindowInfo window_info; CefBrowserSettings settings; - settings.universal_access_from_file_urls = STATE_ENABLED; - // Necessary to enable document.executeCommand("paste") settings.javascript_access_clipboard = STATE_ENABLED; settings.javascript_dom_paste = STATE_ENABLED; diff --git a/appshell/client_app.h b/appshell/client_app.h index 7e16eb5c7..fad4a128f 100644 --- a/appshell/client_app.h +++ b/appshell/client_app.h @@ -121,6 +121,10 @@ class ClientApp : public CefApp, CefRefPtr browser, CefProcessId source_process, CefRefPtr message) OVERRIDE; + virtual void OnBeforeCommandLineProcessing(const CefString& process_type,CefRefPtr command_line) override + { + command_line->AppendSwitch("--disable-web-security"); + } // Set of supported RenderDelegates. RenderDelegateSet render_delegates_; From fede2cc467a8cf648a481a46c4257001bb343fda Mon Sep 17 00:00:00 2001 From: Gautam Jha Date: Mon, 22 Oct 2018 19:28:43 +0530 Subject: [PATCH 9/9] Corrected CEF url --- Gruntfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index 0f9d75bb7..260030e1f 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -323,7 +323,7 @@ module.exports = function (grunt) { } }, "cef": { - "url" : "http://localhost:8000", + "url" : "http://s3.amazonaws.com/files.brackets.io/cef", "version" : cef_version }, "node": {