summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/app/framework.order2
-rw-r--r--chrome/app_shim/app_mode_loader_mac.mm8
-rw-r--r--chrome/app_shim/chrome_main_app_mode_mac.mm12
-rw-r--r--chrome/browser/apps/shortcut_manager.cc4
-rw-r--r--chrome/browser/ui/app_list/app_list_service_mac.mm2
5 files changed, 19 insertions, 9 deletions
diff --git a/chrome/app/framework.order b/chrome/app/framework.order
index c30922a..062dba8 100644
--- a/chrome/app/framework.order
+++ b/chrome/app/framework.order
@@ -25,7 +25,7 @@ __ZdlPvS_
___asan_default_options
# Entry point from the app mode loader.
-_ChromeAppModeStart
+_ChromeAppModeStart_v4
# _ChromeMain must be listed last. That's the whole point of this file.
_ChromeMain
diff --git a/chrome/app_shim/app_mode_loader_mac.mm b/chrome/app_shim/app_mode_loader_mac.mm
index 16e7f7e..1d55ffc 100644
--- a/chrome/app_shim/app_mode_loader_mac.mm
+++ b/chrome/app_shim/app_mode_loader_mac.mm
@@ -31,6 +31,12 @@ namespace {
typedef int (*StartFun)(const app_mode::ChromeAppModeInfo*);
+// The name of the entry point in the Framework. This name is dynamically
+// queried at shim launch to allow the shim to connect and run.
+// The function is versioned in case we need to obsolete and rebuild the shim
+// before it loads, e.g. see https://crbug.com/561205.
+const char kStartFunName[] = "ChromeAppModeStart_v4";
+
int LoadFrameworkAndStart(app_mode::ChromeAppModeInfo* info) {
using base::SysNSStringToUTF8;
using base::SysNSStringToUTF16;
@@ -138,7 +144,7 @@ int LoadFrameworkAndStart(app_mode::ChromeAppModeInfo* info) {
void* cr_dylib = dlopen(framework_shlib_path.value().c_str(), RTLD_LAZY);
if (cr_dylib) {
// Find the entry point.
- ChromeAppModeStart = (StartFun)dlsym(cr_dylib, "ChromeAppModeStart");
+ ChromeAppModeStart = (StartFun)dlsym(cr_dylib, kStartFunName);
if (!ChromeAppModeStart)
LOG(ERROR) << "Couldn't get entry point: " << dlerror();
} else {
diff --git a/chrome/app_shim/chrome_main_app_mode_mac.mm b/chrome/app_shim/chrome_main_app_mode_mac.mm
index 60b60a39..f2d24c7 100644
--- a/chrome/app_shim/chrome_main_app_mode_mac.mm
+++ b/chrome/app_shim/chrome_main_app_mode_mac.mm
@@ -565,13 +565,19 @@ void AppShimController::SendSetAppHidden(bool hidden) {
extern "C" {
// |ChromeAppModeStart()| is the point of entry into the framework from the app
-// mode loader.
+// mode loader. There are cases where the Chromium framework may have changed in
+// a way that is incompatible with an older shim (e.g. change to libc++ library
+// linking). The function name is versioned to provide a way to force shim
+// upgrades if they are launched before an updated version of Chromium can
+// upgrade them; the old shim will not be able to dyload the new
+// ChromeAppModeStart, so it will fall back to the upgrade path. See
+// https://crbug.com/561205.
__attribute__((visibility("default")))
-int ChromeAppModeStart(const app_mode::ChromeAppModeInfo* info);
+int ChromeAppModeStart_v4(const app_mode::ChromeAppModeInfo* info);
} // extern "C"
-int ChromeAppModeStart(const app_mode::ChromeAppModeInfo* info) {
+int ChromeAppModeStart_v4(const app_mode::ChromeAppModeInfo* info) {
base::CommandLine::Init(info->argc, info->argv);
base::mac::ScopedNSAutoreleasePool scoped_pool;
diff --git a/chrome/browser/apps/shortcut_manager.cc b/chrome/browser/apps/shortcut_manager.cc
index a82467c..412b6c8 100644
--- a/chrome/browser/apps/shortcut_manager.cc
+++ b/chrome/browser/apps/shortcut_manager.cc
@@ -37,9 +37,7 @@ namespace {
// need to be recreated. This might happen when we change various aspects of app
// shortcuts like command-line flags or associated icons, binaries, etc.
#if defined(OS_MACOSX)
-// This was changed to 3 at r316520, but reverted again. Next time we need to
-// trigger a recreate, increment this to 4.
-const int kCurrentAppShortcutsVersion = 2;
+const int kCurrentAppShortcutsVersion = 4;
#else
const int kCurrentAppShortcutsVersion = 0;
#endif
diff --git a/chrome/browser/ui/app_list/app_list_service_mac.mm b/chrome/browser/ui/app_list/app_list_service_mac.mm
index b5c6d95..be61096 100644
--- a/chrome/browser/ui/app_list/app_list_service_mac.mm
+++ b/chrome/browser/ui/app_list/app_list_service_mac.mm
@@ -79,7 +79,7 @@ class ImageSkia;
namespace {
// Version of the app list shortcut version installed.
-const int kShortcutVersion = 2;
+const int kShortcutVersion = 4;
// Duration of show and hide animations.
const NSTimeInterval kAnimationDuration = 0.2;