diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-28 20:29:37 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-28 20:29:37 +0000 |
commit | 0865c1342c3413c3b6f8d698105a9d7340d92cf2 (patch) | |
tree | f89ef79c9b6d86290fea29f9db4d88f421a00da9 /chrome/browser | |
parent | 68f3099b071756a717e850f4d3c1cb8a0ef00c6e (diff) | |
download | chromium_src-0865c1342c3413c3b6f8d698105a9d7340d92cf2.zip chromium_src-0865c1342c3413c3b6f8d698105a9d7340d92cf2.tar.gz chromium_src-0865c1342c3413c3b6f8d698105a9d7340d92cf2.tar.bz2 |
Part 2 of repairing regressions to my old clang check plugins so Nico can
deploy the clang plugins to the waterfall/trybots.
BUG=none
TEST=compiles
Review URL: http://codereview.chromium.org/6272025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73014 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
33 files changed, 207 insertions, 108 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc index 89e224c..b926132 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc +++ b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc @@ -48,7 +48,6 @@ #include "chrome/browser/autocomplete/autocomplete_popup_view_gtk.h" #include "chrome/browser/ui/gtk/gtk_theme_provider.h" #include "chrome/browser/ui/gtk/location_bar_view_gtk.h" -#include "views/controls/native/native_view_host.h" #endif namespace { diff --git a/chrome/browser/bookmarks/bookmark_utils.cc b/chrome/browser/bookmarks/bookmark_utils.cc index e26f943..13c4b8d 100644 --- a/chrome/browser/bookmarks/bookmark_utils.cc +++ b/chrome/browser/bookmarks/bookmark_utils.cc @@ -494,6 +494,10 @@ void GetMostRecentlyAddedEntries(BookmarkModel* model, } } +TitleMatch::TitleMatch() {} + +TitleMatch::~TitleMatch() {} + bool MoreRecentlyAdded(const BookmarkNode* n1, const BookmarkNode* n2) { return n1->date_added() > n2->date_added(); } diff --git a/chrome/browser/bookmarks/bookmark_utils.h b/chrome/browser/bookmarks/bookmark_utils.h index 5df225d..93607ad 100644 --- a/chrome/browser/bookmarks/bookmark_utils.h +++ b/chrome/browser/bookmarks/bookmark_utils.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -131,6 +131,9 @@ void GetMostRecentlyAddedEntries(BookmarkModel* model, // Used by GetBookmarksMatchingText to return a matching node and the location // of the match in the title. struct TitleMatch { + TitleMatch(); + ~TitleMatch(); + const BookmarkNode* node; // Location of the matching words in the title of the node. diff --git a/chrome/browser/browsing_data_local_storage_helper.cc b/chrome/browser/browsing_data_local_storage_helper.cc index f07c019..4a035d5 100644 --- a/chrome/browser/browsing_data_local_storage_helper.cc +++ b/chrome/browser/browsing_data_local_storage_helper.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -16,6 +16,29 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" #include "webkit/glue/webkit_glue.h" +BrowsingDataLocalStorageHelper::LocalStorageInfo::LocalStorageInfo() {} + +BrowsingDataLocalStorageHelper::LocalStorageInfo::LocalStorageInfo( + const std::string& protocol, + const std::string& host, + unsigned short port, + const std::string& database_identifier, + const std::string& origin, + const FilePath& file_path, + int64 size, + base::Time last_modified) + : protocol(protocol), + host(host), + port(port), + database_identifier(database_identifier), + origin(origin), + file_path(file_path), + size(size), + last_modified(last_modified) { + } + +BrowsingDataLocalStorageHelper::LocalStorageInfo::~LocalStorageInfo() {} + BrowsingDataLocalStorageHelper::BrowsingDataLocalStorageHelper( Profile* profile) : profile_(profile), diff --git a/chrome/browser/browsing_data_local_storage_helper.h b/chrome/browser/browsing_data_local_storage_helper.h index 1f61070..f363542 100644 --- a/chrome/browser/browsing_data_local_storage_helper.h +++ b/chrome/browser/browsing_data_local_storage_helper.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -30,7 +30,7 @@ class BrowsingDataLocalStorageHelper public: // Contains detailed information about local storage. struct LocalStorageInfo { - LocalStorageInfo() {} + LocalStorageInfo(); LocalStorageInfo( const std::string& protocol, const std::string& host, @@ -39,16 +39,8 @@ class BrowsingDataLocalStorageHelper const std::string& origin, const FilePath& file_path, int64 size, - base::Time last_modified) - : protocol(protocol), - host(host), - port(port), - database_identifier(database_identifier), - origin(origin), - file_path(file_path), - size(size), - last_modified(last_modified) { - } + base::Time last_modified); + ~LocalStorageInfo(); bool IsFileSchemeData() { return protocol == chrome::kFileScheme; diff --git a/chrome/browser/extensions/extension_pref_value_map.cc b/chrome/browser/extensions/extension_pref_value_map.cc index 3ae4ca9..e410a73 100644 --- a/chrome/browser/extensions/extension_pref_value_map.cc +++ b/chrome/browser/extensions/extension_pref_value_map.cc @@ -8,6 +8,17 @@ #include "base/values.h" #include "chrome/browser/prefs/pref_value_map.h" +struct ExtensionPrefValueMap::ExtensionEntry { + // Installation time of the extension. + base::Time install_time; + // Whether extension is enabled in the profile. + bool enabled; + // Regular preferences. + PrefValueMap reg_preferences; + // Incognito preferences, empty for regular ExtensionPrefStore. + PrefValueMap inc_preferences; +}; + ExtensionPrefValueMap::ExtensionPrefValueMap() { } diff --git a/chrome/browser/extensions/extension_pref_value_map.h b/chrome/browser/extensions/extension_pref_value_map.h index 63d9285..896a68c 100644 --- a/chrome/browser/extensions/extension_pref_value_map.h +++ b/chrome/browser/extensions/extension_pref_value_map.h @@ -103,16 +103,7 @@ class ExtensionPrefValueMap { bool incognito) const; private: - struct ExtensionEntry { - // Installation time of the extension. - base::Time install_time; - // Whether extension is enabled in the profile. - bool enabled; - // Regular preferences. - PrefValueMap reg_preferences; - // Incognito preferences, empty for regular ExtensionPrefStore. - PrefValueMap inc_preferences; - }; + struct ExtensionEntry; typedef std::map<std::string, ExtensionEntry*> ExtensionEntryMap; diff --git a/chrome/browser/extensions/extension_updater.cc b/chrome/browser/extensions/extension_updater.cc index 01b0e07..835d672a 100644 --- a/chrome/browser/extensions/extension_updater.cc +++ b/chrome/browser/extensions/extension_updater.cc @@ -357,6 +357,20 @@ class ExtensionUpdaterFileHandler ~ExtensionUpdaterFileHandler() {} }; +ExtensionUpdater::ExtensionFetch::ExtensionFetch() + : id(""), + url(), + package_hash(""), + version("") {} + +ExtensionUpdater::ExtensionFetch::ExtensionFetch(const std::string& i, + const GURL& u, + const std::string& h, + const std::string& v) + : id(i), url(u), package_hash(h), version(v) {} + +ExtensionUpdater::ExtensionFetch::~ExtensionFetch() {} + ExtensionUpdater::ExtensionUpdater(ExtensionUpdateService* service, PrefService* prefs, int frequency_seconds) diff --git a/chrome/browser/extensions/extension_updater.h b/chrome/browser/extensions/extension_updater.h index 3d7986c..d5ed01f 100644 --- a/chrome/browser/extensions/extension_updater.h +++ b/chrome/browser/extensions/extension_updater.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -178,14 +178,15 @@ class ExtensionUpdater // We need to keep track of some information associated with a url // when doing a fetch. struct ExtensionFetch { + ExtensionFetch(); + ExtensionFetch(const std::string& i, const GURL& u, + const std::string& h, const std::string& v); + ~ExtensionFetch(); + std::string id; GURL url; std::string package_hash; std::string version; - ExtensionFetch() : id(""), url(), package_hash(""), version("") {} - ExtensionFetch(const std::string& i, const GURL& u, - const std::string& h, const std::string& v) - : id(i), url(u), package_hash(h), version(v) {} }; // These are needed for unit testing, to help identify the correct mock diff --git a/chrome/browser/extensions/external_extension_loader.cc b/chrome/browser/extensions/external_extension_loader.cc index 48bda43..8f48d5e 100644 --- a/chrome/browser/extensions/external_extension_loader.cc +++ b/chrome/browser/extensions/external_extension_loader.cc @@ -9,6 +9,8 @@ #include "chrome/browser/browser_thread.h" #include "chrome/browser/extensions/external_extension_provider_impl.h" +ExternalExtensionLoader::ExternalExtensionLoader() : running_(false) {} + void ExternalExtensionLoader::Init( ExternalExtensionProviderImpl* owner) { CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); @@ -28,6 +30,8 @@ void ExternalExtensionLoader::OwnerShutdown() { owner_ = NULL; } +ExternalExtensionLoader::~ExternalExtensionLoader() {} + void ExternalExtensionLoader::LoadFinished() { CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); running_ = false; diff --git a/chrome/browser/extensions/external_extension_loader.h b/chrome/browser/extensions/external_extension_loader.h index f4864cb..7791664 100644 --- a/chrome/browser/extensions/external_extension_loader.h +++ b/chrome/browser/extensions/external_extension_loader.h @@ -27,7 +27,7 @@ class ExternalExtensionProviderImpl; class ExternalExtensionLoader : public base::RefCountedThreadSafe<ExternalExtensionLoader> { public: - explicit ExternalExtensionLoader() : running_(false) {} + explicit ExternalExtensionLoader(); // Specifies the provider that owns this object. void Init(ExternalExtensionProviderImpl* owner); @@ -50,7 +50,7 @@ class ExternalExtensionLoader virtual const FilePath GetBaseCrxFilePath(); protected: - virtual ~ExternalExtensionLoader() {} + virtual ~ExternalExtensionLoader(); // Notifies the provider that the list of extensions has been loaded. void LoadFinished(); diff --git a/chrome/browser/extensions/external_pref_extension_loader.cc b/chrome/browser/extensions/external_pref_extension_loader.cc index f770e7c..8d264a9 100644 --- a/chrome/browser/extensions/external_pref_extension_loader.cc +++ b/chrome/browser/extensions/external_pref_extension_loader.cc @@ -112,6 +112,8 @@ void ExternalTestingExtensionLoader::StartLoading() { LoadFinished(); } +ExternalTestingExtensionLoader::~ExternalTestingExtensionLoader() {} + const FilePath ExternalTestingExtensionLoader::GetBaseCrxFilePath() { return fake_base_path_; } diff --git a/chrome/browser/extensions/external_pref_extension_loader.h b/chrome/browser/extensions/external_pref_extension_loader.h index c6852d3..0590014 100644 --- a/chrome/browser/extensions/external_pref_extension_loader.h +++ b/chrome/browser/extensions/external_pref_extension_loader.h @@ -58,7 +58,7 @@ class ExternalTestingExtensionLoader : public ExternalExtensionLoader { private: friend class base::RefCountedThreadSafe<ExternalExtensionLoader>; - virtual ~ExternalTestingExtensionLoader() {} + virtual ~ExternalTestingExtensionLoader(); FilePath fake_base_path_; scoped_ptr<DictionaryValue> testing_prefs_; diff --git a/chrome/browser/load_from_memory_cache_details.cc b/chrome/browser/load_from_memory_cache_details.cc new file mode 100644 index 0000000..2791020 --- /dev/null +++ b/chrome/browser/load_from_memory_cache_details.cc @@ -0,0 +1,23 @@ +// Copyright (c) 2011 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/load_from_memory_cache_details.h" + +LoadFromMemoryCacheDetails::LoadFromMemoryCacheDetails( + const GURL& url, + const std::string& frame_origin, + const std::string& main_frame_origin, + int pid, + int cert_id, + int cert_status) + : url_(url), + frame_origin_(frame_origin), + main_frame_origin_(main_frame_origin), + pid_(pid), + cert_id_(cert_id), + cert_status_(cert_status) { +} + +LoadFromMemoryCacheDetails::~LoadFromMemoryCacheDetails() { +} diff --git a/chrome/browser/load_from_memory_cache_details.h b/chrome/browser/load_from_memory_cache_details.h index d46684d..d5ffd1e 100644 --- a/chrome/browser/load_from_memory_cache_details.h +++ b/chrome/browser/load_from_memory_cache_details.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -17,16 +17,8 @@ class LoadFromMemoryCacheDetails { const std::string& main_frame_origin, int pid, int cert_id, - int cert_status) - : url_(url), - frame_origin_(frame_origin), - main_frame_origin_(main_frame_origin), - pid_(pid), - cert_id_(cert_id), - cert_status_(cert_status) - { } - - ~LoadFromMemoryCacheDetails() { } + int cert_status); + ~LoadFromMemoryCacheDetails(); const GURL& url() const { return url_; } const std::string& frame_origin() const { return frame_origin_; } diff --git a/chrome/browser/net/websocket_experiment/websocket_experiment_task.cc b/chrome/browser/net/websocket_experiment/websocket_experiment_task.cc index 09cccc7..6929365 100644 --- a/chrome/browser/net/websocket_experiment/websocket_experiment_task.cc +++ b/chrome/browser/net/websocket_experiment/websocket_experiment_task.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -114,6 +114,8 @@ WebSocketExperimentTask::Config::Config() websocket_close_deadline_ms(kWebSocketCloseDeadlineSec * 1000) { } +WebSocketExperimentTask::Config::~Config() {} + WebSocketExperimentTask::WebSocketExperimentTask( const Config& config, net::CompletionCallback* callback) diff --git a/chrome/browser/net/websocket_experiment/websocket_experiment_task.h b/chrome/browser/net/websocket_experiment/websocket_experiment_task.h index b23c0a0..8996eeb 100644 --- a/chrome/browser/net/websocket_experiment/websocket_experiment_task.h +++ b/chrome/browser/net/websocket_experiment/websocket_experiment_task.h @@ -73,9 +73,11 @@ class WebSocketExperimentTask : public URLFetcher::Delegate, STATE_WEBSOCKET_CLOSE_COMPLETE, NUM_STATES, }; + class Config { public: Config(); + ~Config(); GURL url; std::string ws_protocol; @@ -95,6 +97,7 @@ class WebSocketExperimentTask : public URLFetcher::Delegate, int64 websocket_bye_deadline_ms; int64 websocket_close_deadline_ms; }; + class Context { public: Context() {} @@ -108,6 +111,7 @@ class WebSocketExperimentTask : public URLFetcher::Delegate, private: DISALLOW_COPY_AND_ASSIGN(Context); }; + class Result { public: Result() diff --git a/chrome/browser/policy/configuration_policy_provider.cc b/chrome/browser/policy/configuration_policy_provider.cc index 5282eae..82ca864 100644 --- a/chrome/browser/policy/configuration_policy_provider.cc +++ b/chrome/browser/policy/configuration_policy_provider.cc @@ -17,6 +17,10 @@ ConfigurationPolicyProvider::ConfigurationPolicyProvider( ConfigurationPolicyProvider::~ConfigurationPolicyProvider() {} +bool ConfigurationPolicyProvider::IsInitializationComplete() const { + return true; +} + void ConfigurationPolicyProvider::DecodePolicyValueTree( const DictionaryValue* policies, ConfigurationPolicyStoreInterface* store) { diff --git a/chrome/browser/policy/configuration_policy_provider.h b/chrome/browser/policy/configuration_policy_provider.h index 81c1813..af2cddf 100644 --- a/chrome/browser/policy/configuration_policy_provider.h +++ b/chrome/browser/policy/configuration_policy_provider.h @@ -55,7 +55,7 @@ class ConfigurationPolicyProvider { // Check whether this provider has completed initialization. This is used to // detect whether initialization is done in case providers implementations // need to do asynchronous operations for initialization. - virtual bool IsInitializationComplete() const { return true; } + virtual bool IsInitializationComplete() const; protected: // Decodes the value tree and writes the configuration to the given |store|. diff --git a/chrome/browser/policy/configuration_policy_provider_keeper.cc b/chrome/browser/policy/configuration_policy_provider_keeper.cc index 768bb93..9959f74 100644 --- a/chrome/browser/policy/configuration_policy_provider_keeper.cc +++ b/chrome/browser/policy/configuration_policy_provider_keeper.cc @@ -34,6 +34,8 @@ ConfigurationPolicyProviderKeeper::ConfigurationPolicyProviderKeeper( recommended_provider_(recommended_provider) { } +ConfigurationPolicyProviderKeeper::~ConfigurationPolicyProviderKeeper() {} + ConfigurationPolicyProvider* ConfigurationPolicyProviderKeeper::managed_platform_provider() const { return managed_platform_provider_.get(); diff --git a/chrome/browser/policy/configuration_policy_provider_keeper.h b/chrome/browser/policy/configuration_policy_provider_keeper.h index 6994de4..1156cb4 100644 --- a/chrome/browser/policy/configuration_policy_provider_keeper.h +++ b/chrome/browser/policy/configuration_policy_provider_keeper.h @@ -21,7 +21,7 @@ class ConfigurationPolicyProviderKeeper { ConfigurationPolicyProvider* managed_platform_provider, ConfigurationPolicyProvider* device_management_provider, ConfigurationPolicyProvider* recommended_provider); - virtual ~ConfigurationPolicyProviderKeeper() {} + virtual ~ConfigurationPolicyProviderKeeper(); ConfigurationPolicyProvider* managed_platform_provider() const; diff --git a/chrome/browser/remoting/setup_flow.h b/chrome/browser/remoting/setup_flow.h index d5d16dc..f19f4dd 100644 --- a/chrome/browser/remoting/setup_flow.h +++ b/chrome/browser/remoting/setup_flow.h @@ -121,7 +121,7 @@ class SetupFlowDoneStep : public SetupFlowStepBase { virtual void Cancel(); protected: - void DoStart(); + virtual void DoStart(); private: string16 message_; diff --git a/chrome/browser/renderer_host/download_resource_handler.h b/chrome/browser/renderer_host/download_resource_handler.h index 8301a77..f416ee2 100644 --- a/chrome/browser/renderer_host/download_resource_handler.h +++ b/chrome/browser/renderer_host/download_resource_handler.h @@ -91,8 +91,9 @@ class DownloadResourceHandler : public ResourceHandler, void StartDownloadUrlCheck(); // Called when the result of checking a download URL is known. - void OnDownloadUrlCheckResult(const GURL& url, - SafeBrowsingService::UrlCheckResult result); + virtual void OnDownloadUrlCheckResult( + const GURL& url, + SafeBrowsingService::UrlCheckResult result); // A helper function that updates UMA for download url checks. static void UpdateDownloadUrlCheckStats(SBStatsType stat_type); diff --git a/chrome/browser/speech/speech_input_bubble.cc b/chrome/browser/speech/speech_input_bubble.cc index eb5b82e..3e6cf90 100644 --- a/chrome/browser/speech/speech_input_bubble.cc +++ b/chrome/browser/speech/speech_input_bubble.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -149,3 +149,7 @@ void SpeechInputBubbleBase::SetInputVolume(float volume) { SetImage(*mic_image_.get()); } + +TabContents* SpeechInputBubbleBase::tab_contents() { + return tab_contents_; +} diff --git a/chrome/browser/speech/speech_input_bubble.h b/chrome/browser/speech/speech_input_bubble.h index 436e6bb..dd5d21b 100644 --- a/chrome/browser/speech/speech_input_bubble.h +++ b/chrome/browser/speech/speech_input_bubble.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -130,7 +130,7 @@ class SpeechInputBubbleBase : public SpeechInputBubble { virtual void SetRecognizingMode(); virtual void SetMessage(const string16& text); virtual void SetInputVolume(float volume); - virtual TabContents* tab_contents() { return tab_contents_; } + virtual TabContents* tab_contents(); protected: // Updates the platform specific UI layout for the current display mode. diff --git a/chrome/browser/sync/engine/syncer_thread2.cc b/chrome/browser/sync/engine/syncer_thread2.cc index 9ad29a2..796eab4 100644 --- a/chrome/browser/sync/engine/syncer_thread2.cc +++ b/chrome/browser/sync/engine/syncer_thread2.cc @@ -43,6 +43,12 @@ struct SyncerThread::WaitInterval { WaitInterval(Mode mode, base::TimeDelta length); }; +struct SyncerThread::SyncSessionJob { + SyncSessionJobPurpose purpose; + base::TimeTicks scheduled_start; + linked_ptr<sessions::SyncSession> session; +}; + SyncerThread::DelayProvider::DelayProvider() {} SyncerThread::DelayProvider::~DelayProvider() {} @@ -89,7 +95,7 @@ void SyncerThread::StartImpl(Mode mode) { AdjustPolling(NULL); // Will kick start poll timer if needed. } -bool SyncerThread::ShouldRunJob(SyncSessionJob::Purpose purpose, +bool SyncerThread::ShouldRunJob(SyncSessionJobPurpose purpose, const TimeTicks& scheduled_start) { DCHECK_EQ(MessageLoop::current(), thread_.message_loop()); @@ -99,9 +105,9 @@ bool SyncerThread::ShouldRunJob(SyncSessionJob::Purpose purpose, return false; DCHECK_EQ(wait_interval_->mode, WaitInterval::EXPONENTIAL_BACKOFF); - DCHECK(purpose == SyncSessionJob::POLL || - purpose == SyncSessionJob::NUDGE); - if ((purpose != SyncSessionJob::NUDGE) || wait_interval_->had_nudge) + DCHECK(purpose == POLL || + purpose == NUDGE); + if ((purpose != NUDGE) || wait_interval_->had_nudge) return false; } @@ -110,11 +116,11 @@ bool SyncerThread::ShouldRunJob(SyncSessionJob::Purpose purpose, // versa. switch (mode_) { case CONFIGURATION_MODE: - if (purpose != SyncSessionJob::CONFIGURATION) + if (purpose != CONFIGURATION) return false; break; case NORMAL_MODE: - if (purpose != SyncSessionJob::POLL && purpose != SyncSessionJob::NUDGE) + if (purpose != POLL && purpose != NUDGE) return false; break; default: @@ -126,14 +132,14 @@ bool SyncerThread::ShouldRunJob(SyncSessionJob::Purpose purpose, // only tasks that trigger exponential backoff, so this prevents them from // being starved from running (e.g. due to a very, very low poll interval, // such as 0ms). It's rare that this would ever matter in practice. - if (purpose == SyncSessionJob::POLL && (pending_nudge_.get() && + if (purpose == POLL && (pending_nudge_.get() && pending_nudge_->session->source().updates_source == GetUpdatesCallerInfo::SYNC_CYCLE_CONTINUATION)) { return false; } // Freshness condition. - if (purpose == SyncSessionJob::NUDGE && + if (purpose == NUDGE && (scheduled_start < last_sync_session_end_time_)) { return false; } @@ -199,7 +205,7 @@ void SyncerThread::ScheduleNudgeImpl(const TimeDelta& delay, NudgeSource source, const TypePayloadMap& types_with_payloads) { DCHECK_EQ(MessageLoop::current(), thread_.message_loop()); TimeTicks rough_start = TimeTicks::Now() + delay; - if (!ShouldRunJob(SyncSessionJob::NUDGE, rough_start)) + if (!ShouldRunJob(NUDGE, rough_start)) return; // Note we currently nudge for all types regardless of the ones incurring @@ -230,7 +236,7 @@ void SyncerThread::ScheduleNudgeImpl(const TimeDelta& delay, pending_nudge_.reset(); } } - ScheduleSyncSessionJob(delay, SyncSessionJob::NUDGE, session.release()); + ScheduleSyncSessionJob(delay, NUDGE, session.release()); } // Helper to extract the routing info and workers corresponding to types in @@ -289,11 +295,11 @@ void SyncerThread::ScheduleConfigImpl(const TimeDelta& delay, } void SyncerThread::ScheduleSyncSessionJob(const base::TimeDelta& delay, - SyncSessionJob::Purpose purpose, sessions::SyncSession* session) { + SyncSessionJobPurpose purpose, sessions::SyncSession* session) { DCHECK_EQ(MessageLoop::current(), thread_.message_loop()); SyncSessionJob job = {purpose, TimeTicks::Now() + delay, make_linked_ptr(session)}; - if (purpose == SyncSessionJob::NUDGE) { + if (purpose == NUDGE) { DCHECK(!pending_nudge_.get() || pending_nudge_->session.get() == session); pending_nudge_.reset(new SyncSessionJob(job)); } @@ -304,12 +310,12 @@ void SyncerThread::ScheduleSyncSessionJob(const base::TimeDelta& delay, void SyncerThread::DoSyncSessionJob(const SyncSessionJob& job) { DCHECK_EQ(MessageLoop::current(), thread_.message_loop()); - if (job.purpose == SyncSessionJob::NUDGE) { + if (job.purpose == NUDGE) { DCHECK(pending_nudge_.get()); if (pending_nudge_->session != job.session) return; // Another nudge must have been scheduled in in the meantime. pending_nudge_.reset(); - } else if (job.purpose == SyncSessionJob::CONFIGURATION) { + } else if (job.purpose == CONFIGURATION) { NOTIMPLEMENTED() << "TODO(tim): SyncShare [DOWNLOAD_UPDATES,APPLY_UPDATES]"; } @@ -378,7 +384,7 @@ void SyncerThread::ScheduleNextSync(const SyncSessionJob& old_job) { HandleConsecutiveContinuationError(old_job); } else if (IsBackingOff()) { // We weren't continuing but we're in backoff; must have been a nudge. - DCHECK_EQ(SyncSessionJob::NUDGE, old_job.purpose); + DCHECK_EQ(NUDGE, old_job.purpose); DCHECK(!wait_interval_->had_nudge); wait_interval_->had_nudge = true; wait_interval_->timer.Reset(); @@ -400,7 +406,7 @@ void SyncerThread::AdjustPolling(const SyncSessionJob* old_job) { bool rate_changed = !poll_timer_.IsRunning() || poll != poll_timer_.GetCurrentDelay(); - if (old_job && old_job->purpose != SyncSessionJob::POLL && !rate_changed) + if (old_job && old_job->purpose != POLL && !rate_changed) poll_timer_.Reset(); if (!rate_changed) @@ -422,7 +428,7 @@ void SyncerThread::HandleConsecutiveContinuationError( IsBackingOff() ? wait_interval_->length : TimeDelta::FromSeconds(1)); wait_interval_.reset(new WaitInterval(WaitInterval::EXPONENTIAL_BACKOFF, length)); - SyncSessionJob job = {SyncSessionJob::NUDGE, TimeTicks::Now() + length, + SyncSessionJob job = {NUDGE, TimeTicks::Now() + length, make_linked_ptr(s)}; pending_nudge_.reset(new SyncSessionJob(job)); wait_interval_->timer.Start(length, this, &SyncerThread::DoCanaryJob); @@ -477,7 +483,7 @@ void SyncerThread::PollTimerCallback() { sessions::MakeTypePayloadMapFromRoutingInfo(r, std::string()); SyncSourceInfo info(GetUpdatesCallerInfo::PERIODIC, types_with_payloads); SyncSession* s = new SyncSession(session_context_.get(), this, info, r, w); - ScheduleSyncSessionJob(TimeDelta::FromSeconds(0), SyncSessionJob::POLL, s); + ScheduleSyncSessionJob(TimeDelta::FromSeconds(0), POLL, s); } void SyncerThread::Unthrottle() { diff --git a/chrome/browser/sync/engine/syncer_thread2.h b/chrome/browser/sync/engine/syncer_thread2.h index b2e2395..afa1814 100644 --- a/chrome/browser/sync/engine/syncer_thread2.h +++ b/chrome/browser/sync/engine/syncer_thread2.h @@ -89,27 +89,23 @@ class SyncerThread : public sessions::SyncSession::Delegate { // State pertaining to exponential backoff or throttling periods. struct WaitInterval; - // Internal state for every sync task that is scheduled. - struct SyncSessionJob { - // An enum used to describe jobs for scheduling purposes. - enum Purpose { - // Our poll timer schedules POLL jobs periodically based on a server - // assigned poll interval. - POLL, - // A nudge task can come from a variety of components needing to force - // a sync. The source is inferable from |session.source()|. - NUDGE, - // Typically used for fetching updates for a subset of the enabled types - // during initial sync or reconfiguration. We don't run all steps of - // the sync cycle for these (e.g. CleanupDisabledTypes is skipped). - CONFIGURATION, - }; - - Purpose purpose; - base::TimeTicks scheduled_start; - linked_ptr<sessions::SyncSession> session; + // An enum used to describe jobs for scheduling purposes. + enum SyncSessionJobPurpose { + // Our poll timer schedules POLL jobs periodically based on a server + // assigned poll interval. + POLL, + // A nudge task can come from a variety of components needing to force + // a sync. The source is inferable from |session.source()|. + NUDGE, + // Typically used for fetching updates for a subset of the enabled types + // during initial sync or reconfiguration. We don't run all steps of + // the sync cycle for these (e.g. CleanupDisabledTypes is skipped). + CONFIGURATION, }; + // Internal state for every sync task that is scheduled. + struct SyncSessionJob; + // A component used to get time delays associated with exponential backoff. // Encapsulated into a class to facilitate testing. class DelayProvider { @@ -123,7 +119,7 @@ class SyncerThread : public sessions::SyncSession::Delegate { // Helper to assemble a job and post a delayed task to sync. void ScheduleSyncSessionJob(const base::TimeDelta& delay, - SyncSessionJob::Purpose purpose, + SyncSessionJobPurpose purpose, sessions::SyncSession* session); // Invoke the Syncer to perform a sync. @@ -145,7 +141,7 @@ class SyncerThread : public sessions::SyncSession::Delegate { // Determines if it is legal to run a sync job for |purpose| at // |scheduled_start|. This checks current operational mode, backoff or // throttling, freshness (so we don't make redundant syncs), and connection. - bool ShouldRunJob(SyncSessionJob::Purpose purpose, + bool ShouldRunJob(SyncSessionJobPurpose purpose, const base::TimeTicks& scheduled_start); // 'Impl' here refers to real implementation of public functions, running on diff --git a/chrome/browser/sync/glue/autofill_profile_change_processor.cc b/chrome/browser/sync/glue/autofill_profile_change_processor.cc index 812c505..8e52d65 100644 --- a/chrome/browser/sync/glue/autofill_profile_change_processor.cc +++ b/chrome/browser/sync/glue/autofill_profile_change_processor.cc @@ -1,6 +1,6 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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
+// found in the LICENSE file.
#include "chrome/browser/sync/glue/autofill_profile_change_processor.h"
@@ -44,6 +44,8 @@ AutofillProfileChangeProcessor::AutofillProfileChangeProcessor( StartObserving();
}
+AutofillProfileChangeProcessor::~AutofillProfileChangeProcessor() {}
+
AutofillProfileChangeProcessor::ScopedStopObserving::ScopedStopObserving(
AutofillProfileChangeProcessor* processor) {
processor_ = processor;
diff --git a/chrome/browser/sync/glue/autofill_profile_change_processor.h b/chrome/browser/sync/glue/autofill_profile_change_processor.h index 0b408a3..c10a15c 100644 --- a/chrome/browser/sync/glue/autofill_profile_change_processor.h +++ b/chrome/browser/sync/glue/autofill_profile_change_processor.h @@ -1,6 +1,7 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. + #ifndef CHROME_BROWSER_SYNC_GLUE_AUTOFILL_PROFILE_CHANGE_PROCESSOR_H_ #define CHROME_BROWSER_SYNC_GLUE_AUTOFILL_PROFILE_CHANGE_PROCESSOR_H_ #pragma once @@ -31,7 +32,7 @@ class AutofillProfileChangeProcessor : public ChangeProcessor, PersonalDataManager* personal_data_manager, UnrecoverableErrorHandler* error_handler); - virtual ~AutofillProfileChangeProcessor() {} + virtual ~AutofillProfileChangeProcessor(); // Virtual methods from ChangeProcessor class. virtual void ApplyChangesFromSyncModel( diff --git a/chrome/browser/sync/glue/autofill_profile_data_type_controller.cc b/chrome/browser/sync/glue/autofill_profile_data_type_controller.cc index 230b680..1b5214b 100644 --- a/chrome/browser/sync/glue/autofill_profile_data_type_controller.cc +++ b/chrome/browser/sync/glue/autofill_profile_data_type_controller.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2020 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -17,6 +17,17 @@ AutofillProfileDataTypeController::AutofillProfileDataTypeController( profile, sync_service) {} +AutofillProfileDataTypeController::~AutofillProfileDataTypeController() {} + +syncable::ModelType AutofillProfileDataTypeController::type() { + return syncable::AUTOFILL_PROFILE; +} + +const char* AutofillProfileDataTypeController::name() const { + // For logging only. + return "autofill_profile"; +} + ProfileSyncFactory::SyncComponents AutofillProfileDataTypeController::CreateSyncComponents( ProfileSyncService* profile_sync_service, diff --git a/chrome/browser/sync/glue/autofill_profile_data_type_controller.h b/chrome/browser/sync/glue/autofill_profile_data_type_controller.h index 8bb6e8e..83cafc3 100644 --- a/chrome/browser/sync/glue/autofill_profile_data_type_controller.h +++ b/chrome/browser/sync/glue/autofill_profile_data_type_controller.h @@ -1,6 +1,7 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. + #ifndef CHROME_BROWSER_SYNC_GLUE_AUTOFILL_PROFILE_DATA_TYPE_CONTROLLER_H_ #define CHROME_BROWSER_SYNC_GLUE_AUTOFILL_PROFILE_DATA_TYPE_CONTROLLER_H_ #pragma once @@ -16,16 +17,12 @@ class AutofillProfileDataTypeController : public AutofillDataTypeController { ProfileSyncFactory* profile_sync_factory, Profile* profile, ProfileSyncService* sync_service); - virtual ~AutofillProfileDataTypeController() {} + virtual ~AutofillProfileDataTypeController(); + + virtual syncable::ModelType type(); - virtual syncable::ModelType type() { - return syncable::AUTOFILL_PROFILE; - } + virtual const char* name() const; - virtual const char* name() const { - // For logging only. - return "autofill_profile"; - } protected: virtual ProfileSyncFactory::SyncComponents CreateSyncComponents( ProfileSyncService* profile_sync_service, diff --git a/chrome/browser/sync/sync_setup_flow.cc b/chrome/browser/sync/sync_setup_flow.cc index 3bd4056..e0d54dc 100644 --- a/chrome/browser/sync/sync_setup_flow.cc +++ b/chrome/browser/sync/sync_setup_flow.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -38,6 +38,13 @@ static const wchar_t* kPassphraseIFrameXPath = L"//iframe[@id='passphrase']"; static const wchar_t* kDoneIframeXPath = L"//iframe[@id='done']"; +SyncConfiguration::SyncConfiguration() + : sync_everything(false), + use_secondary_passphrase(false) { +} + +SyncConfiguration::~SyncConfiguration() {} + void FlowHandler::RegisterMessages() { dom_ui_->RegisterMessageCallback("SubmitAuth", NewCallback(this, &FlowHandler::HandleSubmitAuth)); diff --git a/chrome/browser/sync/sync_setup_flow.h b/chrome/browser/sync/sync_setup_flow.h index 6582572..0e759df 100644 --- a/chrome/browser/sync/sync_setup_flow.h +++ b/chrome/browser/sync/sync_setup_flow.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -26,6 +26,9 @@ class SyncSetupFlowContainer; // This can be stored or passed around when the configuration is managed // by multiple stages of the wizard. struct SyncConfiguration { + SyncConfiguration(); + ~SyncConfiguration(); + bool sync_everything; syncable::ModelTypeSet data_types; bool use_secondary_passphrase; |