summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornick@chromium.org <nick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-06 15:48:28 +0000
committernick@chromium.org <nick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-06 15:48:28 +0000
commit1e35f758e84d9b20e3d145fd979b76e6835398a8 (patch)
tree5bf78781852b73ee2183429889e83b03ab5cdf12
parent5108697f046f171e31ff8f156b9179ccb388f9ad (diff)
downloadchromium_src-1e35f758e84d9b20e3d145fd979b76e6835398a8.zip
chromium_src-1e35f758e84d9b20e3d145fd979b76e6835398a8.tar.gz
chromium_src-1e35f758e84d9b20e3d145fd979b76e6835398a8.tar.bz2
Change the Windows build to statically link the sync library.
Update installer files so that they don't reference syncapi.dll. Add a reference to iphlpapi, and make it and pthreads lazy-loaded. BUG=23609 TEST=interactive testing of two sync clients with notifications. Review URL: http://codereview.chromium.org/242118 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28112 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/app/chrome.dll.deps3
-rw-r--r--chrome/browser/sync/engine/syncapi.cc27
-rw-r--r--chrome/browser/sync/engine/syncapi.h14
-rwxr-xr-xchrome/chrome.gyp29
-rw-r--r--chrome/installer/mini_installer/chrome.release3
-rw-r--r--chrome/tools/build/win/FILES1
6 files changed, 13 insertions, 64 deletions
diff --git a/chrome/app/chrome.dll.deps b/chrome/app/chrome.dll.deps
index ebbd9bb..8e1b24a 100644
--- a/chrome/app/chrome.dll.deps
+++ b/chrome/app/chrome.dll.deps
@@ -33,5 +33,6 @@ delay_loaded = [
'avcodec-52.dll',
'avformat-52.dll',
'avutil-50.dll',
- 'syncapi.dll',
+ 'pthreads.dll',
+ 'IPHLPAPI.dll',
]
diff --git a/chrome/browser/sync/engine/syncapi.cc b/chrome/browser/sync/engine/syncapi.cc
index eb54d93..5a72fd4 100644
--- a/chrome/browser/sync/engine/syncapi.cc
+++ b/chrome/browser/sync/engine/syncapi.cc
@@ -16,7 +16,6 @@
#include <string>
#include <vector>
-#include "base/at_exit.h"
#include "base/basictypes.h"
#include "base/command_line.h"
#include "base/scoped_ptr.h"
@@ -45,6 +44,10 @@
#include "chrome/browser/sync/util/user_settings.h"
#include "googleurl/src/gurl.h"
+#if defined(OS_WIN)
+#pragma comment(lib, "iphlpapi.lib")
+#endif
+
using browser_sync::AllStatus;
using browser_sync::AllStatusEvent;
using browser_sync::AuthWatcher;
@@ -69,16 +72,6 @@ static const int kServerReachablePollingIntervalMsec = 60000 * 60;
static const int kThreadExitTimeoutMsec = 60000;
static const int kSSLPort = 443;
-// We shouldn't call InitLogFiles more than once since that will cause a crash.
-// So we use a global state variable to avoid that. This doesn't work in case
-// of multiple threads, and if some other part also tries to call InitLogFiles
-// apart from this file. But this is okay for now since this is the only place
-// we call InitLogFiles.
-namespace {
-static bool g_log_files_initialized = false;
-static base::AtExitManager g_at_exit_manager; // Necessary for NewCallback.
-} // namespace
-
struct ThreadParams {
browser_sync::ServerConnectionManager* conn_mgr;
#if defined(OS_WIN)
@@ -992,16 +985,6 @@ bool SyncManager::SyncInternal::Init(
bool attempt_last_user_authentication,
const char* user_agent) {
- if (!g_log_files_initialized) {
- // TODO(timsteele): Call InitLogFiles() or equivalent.
- g_log_files_initialized = true;
- }
-
- // TODO(timsteele): We need to do this for syncapi.dll, but should remove
- // once we link statically. On windows this will set up the correct command
- // line, on posix it will be create an empty command line.
- CommandLine::Init(0, NULL);
-
// Set up UserSettings, creating the db if necessary. We need this to
// instantiate a URLFactory to give to the Syncer.
PathString settings_db_file = AppendSlash(database_location) +
@@ -1229,8 +1212,6 @@ void SyncManager::SyncInternal::Shutdown() {
LOG_IF(ERROR, WAIT_TIMEOUT == wait_result) << "Thread exit timeout expired";
CloseHandle(address_watch_params_.exit_flag);
#endif
-
- CommandLine::Terminate();
}
// Listen to model changes, filter out ones initiated by the sync API, and
diff --git a/chrome/browser/sync/engine/syncapi.h b/chrome/browser/sync/engine/syncapi.h
index d8e2601b..474a7a5 100644
--- a/chrome/browser/sync/engine/syncapi.h
+++ b/chrome/browser/sync/engine/syncapi.h
@@ -48,18 +48,10 @@ typedef uint16 sync_char16;
#endif
// The MSVC compiler for Windows requires that any classes exported by, or
-// imported from, a dynamic library be decorated with the following fanciness.
-#if defined(OS_WIN)
-#if COMPILING_SYNCAPI_LIBRARY
-#define SYNC_EXPORT __declspec(dllexport)
-#elif COMPILING_SYNCAPI_STUB
-#define SYNC_EXPORT
-#else
-#define SYNC_EXPORT __declspec(dllimport)
-#endif
-#else
+// imported from, a dynamic library be marked with an appropriate
+// __declspec() decoration. However, we currently use static linkage
+// on all platforms.
#define SYNC_EXPORT
-#endif // OS_WIN
// Forward declarations of internal class types so that sync API objects
// may have opaque pointers to these types.
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp
index 4070f28..fcdca5c 100755
--- a/chrome/chrome.gyp
+++ b/chrome/chrome.gyp
@@ -4684,7 +4684,7 @@
'type': 'none',
}, {
# Build sync.
- 'type': 'shared_library',
+ 'type': '<(library)',
'sources': [
'browser/sync/engine/syncapi.cc',
],
@@ -4693,7 +4693,6 @@
'<(protoc_out_dir)',
],
'defines' : [
- 'COMPILING_SYNCAPI_LIBRARY',
'_CRT_SECURE_NO_WARNINGS',
'_USE_32BIT_TIME_T',
],
@@ -4711,31 +4710,9 @@
],
'conditions': [
['OS=="win"', {
- 'msvs_settings': {
- 'VCLinkerTool': {
- 'ImportLibrary': '$(OutDir)\\lib\\syncapi.lib',
- 'ProgramDatabaseFile': '$(OutDir)\\syncapi_dll.pdb',
- },
- },
- 'link_settings': {
- 'libraries': [
- '-lcrypt32.lib',
- '-liphlpapi.lib',
- '-lsecur32.lib',
- ]
- },
'dependencies': [
'../third_party/pthreads-win32/pthreads.gyp:pthreads',
],
- 'direct_dependent_settings': {
- 'msvs_settings': {
- 'VCLinkerTool': {
- 'DelayLoadDLLs': [
- 'syncapi.dll',
- ],
- },
- },
- },
}],
['OS=="linux"', {
'defines': [
@@ -4956,6 +4933,8 @@
'psapi.dll',
'urlmon.dll',
'imm32.dll',
+ 'iphlpapi.dll',
+ 'pthreads.dll',
],
'ImportLibrary': '$(OutDir)\\lib\\chrome_dll.lib',
'ProgramDatabaseFile': '$(OutDir)\\chrome_dll.pdb',
@@ -6607,7 +6586,6 @@
'<(protoc_out_dir)',
],
'defines' : [
- 'COMPILING_SYNCAPI_LIBRARY',
'SYNC_ENGINE_VERSION_STRING="Unknown"',
'_CRT_SECURE_NO_WARNINGS',
'_USE_32BIT_TIME_T',
@@ -6776,7 +6754,6 @@
'<(protoc_out_dir)',
],
'defines' : [
- 'COMPILING_SYNCAPI_LIBRARY',
'SYNC_ENGINE_VERSION_STRING="Unknown"',
'_CRT_SECURE_NO_WARNINGS',
'_USE_32BIT_TIME_T',
diff --git a/chrome/installer/mini_installer/chrome.release b/chrome/installer/mini_installer/chrome.release
index ac300d9..7acbb0f 100644
--- a/chrome/installer/mini_installer/chrome.release
+++ b/chrome/installer/mini_installer/chrome.release
@@ -42,8 +42,7 @@ servers\*.dll: %(VersionDir)s\
servers\*.exe: %(VersionDir)s\
Extensions\*.*: %(VersionDir)s\Extensions\
av*.dll: %(VersionDir)s\
-syncapi.dll: %(VersionDir)s\
+pthreads.dll: %(VersionDir)s\
[GOOGLE_CHROME]
rlz.dll: %(VersionDir)s\
-pthreads.dll: %(VersionDir)s\
diff --git a/chrome/tools/build/win/FILES b/chrome/tools/build/win/FILES
index faa9cd2..8f2ff0c 100644
--- a/chrome/tools/build/win/FILES
+++ b/chrome/tools/build/win/FILES
@@ -61,5 +61,4 @@ themes/default.dll
resources
rlz.dll
wow_helper.exe
-syncapi.dll
pthreads.dll