summaryrefslogtreecommitdiffstats
path: root/chrome/browser
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 /chrome/browser
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
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/sync/engine/syncapi.cc27
-rw-r--r--chrome/browser/sync/engine/syncapi.h14
2 files changed, 7 insertions, 34 deletions
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.