summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-13 22:25:24 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-13 22:25:24 +0000
commitbac3d04d6bdabbb68e1b6701dc93853070ac4f5c (patch)
tree2749fac74e644dd89c558a0fb13c5e6ed3fb4a48 /chrome
parent08b4a2ab859622cff114da4a1f97621f1e067886 (diff)
downloadchromium_src-bac3d04d6bdabbb68e1b6701dc93853070ac4f5c.zip
chromium_src-bac3d04d6bdabbb68e1b6701dc93853070ac4f5c.tar.gz
chromium_src-bac3d04d6bdabbb68e1b6701dc93853070ac4f5c.tar.bz2
Patched in 265058 (which was uploaded under akalin@gmail.com). Original
description: Numerous fixes to get parts of Chrome Sync to compile on OS X. Fixes include: - Added missing definitions for some static const class variables. - Added some missing dependencies. - Marked some Windows-only dependencies as such. - Added stub files for some platform-specific classes. BUG=none TEST=Put through trybots. Review URL: http://codereview.chromium.org/266065 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28900 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/sync/engine/syncer_thread.cc4
-rw-r--r--chrome/browser/sync/engine/syncer_thread.h6
-rw-r--r--chrome/browser/sync/glue/bookmark_model_worker.cc1
-rw-r--r--chrome/browser/sync/glue/bookmark_model_worker.h3
-rw-r--r--chrome/browser/sync/glue/change_processor.h4
-rw-r--r--chrome/browser/sync/glue/model_associator.h3
-rw-r--r--chrome/browser/sync/glue/sync_backend_host.cc6
-rw-r--r--chrome/browser/sync/notifier/base/mac/network_status_detector_task_mac.cc16
-rw-r--r--chrome/browser/sync/notifier/base/mac/time_mac.cc8
-rw-r--r--chrome/browser/sync/profile_sync_service.h6
-rw-r--r--chrome/browser/sync/util/character_set_converters_posix.cc (renamed from chrome/browser/sync/util/character_set_converters_linux.cc)1
-rw-r--r--chrome/browser/sync/util/path_helpers_linux.cc27
-rw-r--r--chrome/browser/sync/util/path_helpers_mac.cc17
-rw-r--r--chrome/browser/sync/util/path_helpers_posix.cc27
-rwxr-xr-xchrome/chrome.gyp16
15 files changed, 103 insertions, 42 deletions
diff --git a/chrome/browser/sync/engine/syncer_thread.cc b/chrome/browser/sync/engine/syncer_thread.cc
index 478e0f7..e509a83 100644
--- a/chrome/browser/sync/engine/syncer_thread.cc
+++ b/chrome/browser/sync/engine/syncer_thread.cc
@@ -109,6 +109,10 @@ int UserIdleTime() {
namespace browser_sync {
+const int SyncerThread::kDefaultShortPollIntervalSeconds = 60;
+const int SyncerThread::kDefaultLongPollIntervalSeconds = 3600;
+const int SyncerThread::kDefaultMaxPollIntervalMs = 30 * 60 * 1000;
+
SyncerThread* SyncerThreadFactory::Create(
ClientCommandChannel* command_channel,
syncable::DirectoryManager* mgr,
diff --git a/chrome/browser/sync/engine/syncer_thread.h b/chrome/browser/sync/engine/syncer_thread.h
index e699b49..d6fc63a 100644
--- a/chrome/browser/sync/engine/syncer_thread.h
+++ b/chrome/browser/sync/engine/syncer_thread.h
@@ -82,12 +82,12 @@ public:
};
// Server can overwrite these values via client commands.
// Standard short poll. This is used when XMPP is off.
- static const int kDefaultShortPollIntervalSeconds = 60;
+ static const int kDefaultShortPollIntervalSeconds;
// Long poll is used when XMPP is on.
- static const int kDefaultLongPollIntervalSeconds = 3600;
+ static const int kDefaultLongPollIntervalSeconds;
// 30 minutes by default. If exponential backoff kicks in, this is the
// longest possible poll interval.
- static const int kDefaultMaxPollIntervalMs = 30 * 60 * 1000;
+ static const int kDefaultMaxPollIntervalMs;
virtual ~SyncerThread();
diff --git a/chrome/browser/sync/glue/bookmark_model_worker.cc b/chrome/browser/sync/glue/bookmark_model_worker.cc
index b2a4589..fa30466 100644
--- a/chrome/browser/sync/glue/bookmark_model_worker.cc
+++ b/chrome/browser/sync/glue/bookmark_model_worker.cc
@@ -112,3 +112,4 @@ void BookmarkModelWorker::CallDoWorkAndSignalTask::Run() {
} // namespace browser_sync
#endif // CHROME_PERSONALIZATION
+
diff --git a/chrome/browser/sync/glue/bookmark_model_worker.h b/chrome/browser/sync/glue/bookmark_model_worker.h
index 9cd67c6..7ac61e8 100644
--- a/chrome/browser/sync/glue/bookmark_model_worker.h
+++ b/chrome/browser/sync/glue/bookmark_model_worker.h
@@ -131,4 +131,5 @@ class BookmarkModelWorker
#endif // CHROME_BROWSER_SYNC_GLUE_BOOKMARK_MODEL_WORKER_H_
-#endif // CHROME_PERSONALIZATION \ No newline at end of file
+#endif // CHROME_PERSONALIZATION
+
diff --git a/chrome/browser/sync/glue/change_processor.h b/chrome/browser/sync/glue/change_processor.h
index e9b15d4..c5c43f7 100644
--- a/chrome/browser/sync/glue/change_processor.h
+++ b/chrome/browser/sync/glue/change_processor.h
@@ -26,8 +26,8 @@ class ChangeProcessor : public BookmarkModelObserver,
public ChangeProcessingInterface {
public:
ChangeProcessor(UnrecoverableErrorHandler* error_handler)
- : error_handler_(error_handler), model_associator_(NULL),
- share_handle_(NULL), running_(false), bookmark_model_(NULL) {}
+ : running_(false), error_handler_(error_handler),
+ bookmark_model_(NULL), share_handle_(NULL), model_associator_(NULL) {}
virtual ~ChangeProcessor() { Stop(); }
// Call when the processor should accept changes from either provided model
diff --git a/chrome/browser/sync/glue/model_associator.h b/chrome/browser/sync/glue/model_associator.h
index a3b6e766e..6c3776e 100644
--- a/chrome/browser/sync/glue/model_associator.h
+++ b/chrome/browser/sync/glue/model_associator.h
@@ -140,4 +140,5 @@ class ModelAssociator
} // namespace browser_sync
#endif // CHROME_BROWSER_SYNC_GLUE_MODEL_ASSOCATOR_H_
-#endif // CHROME_PERSONALIZATION \ No newline at end of file
+#endif // CHROME_PERSONALIZATION
+
diff --git a/chrome/browser/sync/glue/sync_backend_host.cc b/chrome/browser/sync/glue/sync_backend_host.cc
index 93c7a9d..a875229 100644
--- a/chrome/browser/sync/glue/sync_backend_host.cc
+++ b/chrome/browser/sync/glue/sync_backend_host.cc
@@ -137,8 +137,8 @@ void SyncBackendHost::Core::SetBaseRequestContext(
SyncBackendHost::Core::Core(SyncBackendHost* backend)
: host_(backend),
- syncapi_(new sync_api::SyncManager()),
- base_request_context_(NULL) {
+ base_request_context_(NULL),
+ syncapi_(new sync_api::SyncManager()) {
}
SyncBackendHost::Core::~Core() {
@@ -192,7 +192,7 @@ void SyncBackendHost::Core::DoInitialize(
#if defined (OS_WIN)
path_str = host_->sync_data_folder_path().value();
#elif (defined(OS_LINUX) || defined(OS_MACOSX))
- path_str = UTF8ToUTF16(sync_data_folder_path().value());
+ path_str = UTF8ToUTF16(host_->sync_data_folder_path().value());
#endif
success = syncapi_->Init(path_str.c_str(),
(service_url.host() + service_url.path()).c_str(),
diff --git a/chrome/browser/sync/notifier/base/mac/network_status_detector_task_mac.cc b/chrome/browser/sync/notifier/base/mac/network_status_detector_task_mac.cc
new file mode 100644
index 0000000..527df79
--- /dev/null
+++ b/chrome/browser/sync/notifier/base/mac/network_status_detector_task_mac.cc
@@ -0,0 +1,16 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/sync/notifier/base/network_status_detector_task.h"
+
+namespace notifier {
+
+NetworkStatusDetectorTask* NetworkStatusDetectorTask::Create(
+ talk_base::Task* parent) {
+ // TODO(sync): No implementation for OS X.
+ return NULL;
+}
+
+} // namespace notifier
+
diff --git a/chrome/browser/sync/notifier/base/mac/time_mac.cc b/chrome/browser/sync/notifier/base/mac/time_mac.cc
new file mode 100644
index 0000000..93fca5d
--- /dev/null
+++ b/chrome/browser/sync/notifier/base/mac/time_mac.cc
@@ -0,0 +1,8 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// Time functions
+
+#include "chrome/browser/sync/notifier/base/posix/time_posix.cc"
+
diff --git a/chrome/browser/sync/profile_sync_service.h b/chrome/browser/sync/profile_sync_service.h
index 042c963..011f55f 100644
--- a/chrome/browser/sync/profile_sync_service.h
+++ b/chrome/browser/sync/profile_sync_service.h
@@ -108,9 +108,9 @@ class ProfileSyncService : public NotificationObserver,
void SetSyncSetupCompleted();
// NotificationObserver implementation.
- virtual void ProfileSyncService::Observe(NotificationType type,
- const NotificationSource& source,
- const NotificationDetails& details);
+ virtual void Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details);
// SyncFrontend implementation.
virtual void OnBackendInitialized();
diff --git a/chrome/browser/sync/util/character_set_converters_linux.cc b/chrome/browser/sync/util/character_set_converters_posix.cc
index 3cbcca8..d038f1f 100644
--- a/chrome/browser/sync/util/character_set_converters_linux.cc
+++ b/chrome/browser/sync/util/character_set_converters_posix.cc
@@ -58,3 +58,4 @@ void TrimPathStringToValidCharacter(PathString* string) {
}
} // namespace browser_sync
+
diff --git a/chrome/browser/sync/util/path_helpers_linux.cc b/chrome/browser/sync/util/path_helpers_linux.cc
index 851e868..157fa48 100644
--- a/chrome/browser/sync/util/path_helpers_linux.cc
+++ b/chrome/browser/sync/util/path_helpers_linux.cc
@@ -2,42 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <sys/types.h>
-
-#include <string.h>
-
-#include "base/logging.h"
#include "base/port.h"
-#include "chrome/browser/sync/util/character_set_converters.h"
#include "chrome/browser/sync/util/path_helpers.h"
#ifndef OS_LINUX
#error Compile this file on Linux only.
#endif
-string LastPathSegment(const string& path) {
- string str(path);
- string::size_type final_slash = str.find_last_of('/');
- if (string::npos != final_slash && final_slash == str.length() - 1
- && str.length() > 1) {
- str.erase(final_slash);
- final_slash = str.find_last_of('/');
- }
- if (string::npos == final_slash)
- return str;
- str.erase(0, final_slash + 1);
- return str;
-}
-
PathString GetFullPath(const PathString& path) {
// TODO(sync): Not sure what the base of the relative path should be on
// linux.
return path;
}
-
-PathString AppendSlash(const PathString& path) {
- if ((!path.empty()) && (*path.rbegin() != '/')) {
- return path + '/';
- }
- return path;
-}
diff --git a/chrome/browser/sync/util/path_helpers_mac.cc b/chrome/browser/sync/util/path_helpers_mac.cc
new file mode 100644
index 0000000..3b1c84a
--- /dev/null
+++ b/chrome/browser/sync/util/path_helpers_mac.cc
@@ -0,0 +1,17 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/port.h"
+#include "chrome/browser/sync/util/path_helpers.h"
+
+#ifndef OS_MACOSX
+#error Compile this file on Mac only.
+#endif
+
+PathString GetFullPath(const PathString& path) {
+ // TODO(sync): Not sure what the base of the relative path should be on
+ // OS X.
+ return path;
+}
+
diff --git a/chrome/browser/sync/util/path_helpers_posix.cc b/chrome/browser/sync/util/path_helpers_posix.cc
index 9da1adb..f613f44 100644
--- a/chrome/browser/sync/util/path_helpers_posix.cc
+++ b/chrome/browser/sync/util/path_helpers_posix.cc
@@ -2,10 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <sys/types.h>
+
#include <algorithm>
#include <pwd.h>
#include <string.h>
+#include "base/logging.h"
+#include "base/port.h"
+#include "chrome/browser/sync/util/character_set_converters.h"
#include "chrome/browser/sync/util/path_helpers.h"
#if ((!defined(OS_LINUX)) && (!defined(OS_MACOSX)))
@@ -94,3 +99,25 @@ PathString MakePathComponentOSLegal(const PathString& component) {
std::replace(new_name.begin(), new_name.end(), '/', ':');
return new_name;
}
+
+string LastPathSegment(const string& path) {
+ string str(path);
+ string::size_type final_slash = str.find_last_of('/');
+ if (string::npos != final_slash && final_slash == str.length() - 1
+ && str.length() > 1) {
+ str.erase(final_slash);
+ final_slash = str.find_last_of('/');
+ }
+ if (string::npos == final_slash)
+ return str;
+ str.erase(0, final_slash + 1);
+ return str;
+}
+
+PathString AppendSlash(const PathString& path) {
+ if ((!path.empty()) && (*path.rbegin() != '/')) {
+ return path + '/';
+ }
+ return path;
+}
+
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp
index 9afbdcf..7d9b46d 100755
--- a/chrome/chrome.gyp
+++ b/chrome/chrome.gyp
@@ -4688,6 +4688,7 @@
'browser/views/bookmark_editor_view_unittest.cc',
'browser/views/find_bar_host_unittest.cc',
'browser/views/keyword_editor_view_unittest.cc',
+ 'browser/views/sync/sync_setup_wizard_unittest.cc',
'common/chrome_plugin_unittest.cc',
'common/net/url_util_unittest.cc',
'test/browser_with_test_window_test.cc',
@@ -5761,6 +5762,7 @@
'chrome_resources',
'chrome_strings',
'debugger',
+ 'syncapi',
'test_support_common',
'../app/app.gyp:app_base',
'../base/base.gyp:test_support_base',
@@ -6437,6 +6439,8 @@
'browser/sync/notifier/base/fastalloc.h',
'browser/sync/notifier/base/linux/network_status_detector_task_linux.cc',
'browser/sync/notifier/base/linux/time_linux.cc',
+ 'browser/sync/notifier/base/mac/network_status_detector_task_mac.cc',
+ 'browser/sync/notifier/base/mac/time_mac.cc',
'browser/sync/notifier/base/nethelpers.cc',
'browser/sync/notifier/base/nethelpers.h',
'browser/sync/notifier/base/network_status_detector_task.cc',
@@ -6570,7 +6574,6 @@
'dependencies': [
'../testing/gtest.gyp:gtest',
'../third_party/libjingle/libjingle.gyp:libjingle',
- '../third_party/tcmalloc/tcmalloc.gyp:tcmalloc',
'notifier',
'sync',
'sync_proto',
@@ -6578,6 +6581,9 @@
],
'conditions': [
['OS=="win"', {
+ 'dependencies': [
+ '../third_party/tcmalloc/tcmalloc.gyp:tcmalloc',
+ ],
'link_settings': {
'libraries': [
'-lcrypt32.lib',
@@ -6687,7 +6693,7 @@
'browser/sync/syncable/syncable_id.h',
'browser/sync/util/character_set_converters.cc',
'browser/sync/util/character_set_converters.h',
- 'browser/sync/util/character_set_converters_linux.cc',
+ 'browser/sync/util/character_set_converters_posix.cc',
'browser/sync/util/character_set_converters_win.cc',
'browser/sync/util/closure.h',
'browser/sync/util/compat_file.h',
@@ -6708,6 +6714,7 @@
'browser/sync/util/highres_timer_win.h',
'browser/sync/util/path_helpers.h',
'browser/sync/util/path_helpers_linux.cc',
+ 'browser/sync/util/path_helpers_mac.cc',
'browser/sync/util/path_helpers_posix.cc',
'browser/sync/util/query_helpers.cc',
'browser/sync/util/query_helpers.h',
@@ -6732,6 +6739,11 @@
'../third_party/libjingle/libjingle.gyp:libjingle',
'sync_proto',
],
+ 'link_settings': {
+ 'libraries': [
+ '$(SDKROOT)/System/Library/Frameworks/IOKit.framework',
+ ],
+ },
'conditions': [
['OS=="win"', {
'sources' : [