diff options
78 files changed, 621 insertions, 209 deletions
diff --git a/base/field_trial.cc b/base/field_trial.cc index 3575001..a3e6ac6 100644 --- a/base/field_trial.cc +++ b/base/field_trial.cc @@ -64,6 +64,8 @@ std::string FieldTrial::MakeName(const std::string& name_prefix, return big_string.append(FieldTrialList::FindFullName(trial_name)); } +FieldTrial::~FieldTrial() {} + //------------------------------------------------------------------------------ // FieldTrialList methods and members. diff --git a/base/field_trial.h b/base/field_trial.h index b1f0a07..deee838 100644 --- a/base/field_trial.h +++ b/base/field_trial.h @@ -119,7 +119,7 @@ class FieldTrial : public base::RefCounted<FieldTrial> { private: friend class base::RefCounted<FieldTrial>; - ~FieldTrial() {} + virtual ~FieldTrial(); // The name of the field trial, as can be found via the FieldTrialList. // This is empty of the trial is not in the experiment. diff --git a/base/global_descriptors_posix.cc b/base/global_descriptors_posix.cc index 869d196..8c853a0 100644 --- a/base/global_descriptors_posix.cc +++ b/base/global_descriptors_posix.cc @@ -11,6 +11,10 @@ namespace base { +GlobalDescriptors::GlobalDescriptors() {} + +GlobalDescriptors::~GlobalDescriptors() {} + int GlobalDescriptors::MaybeGet(Key key) const { for (Mapping::const_iterator i = descriptors_.begin(); i != descriptors_.end(); ++i) { diff --git a/base/global_descriptors_posix.h b/base/global_descriptors_posix.h index c37dae6..8ea743e 100644 --- a/base/global_descriptors_posix.h +++ b/base/global_descriptors_posix.h @@ -56,7 +56,8 @@ class GlobalDescriptors { } private: - GlobalDescriptors() { } + GlobalDescriptors(); + ~GlobalDescriptors(); friend struct DefaultSingletonTraits<GlobalDescriptors>; Mapping descriptors_; diff --git a/chrome/browser/debugger/devtools_remote_message.cc b/chrome/browser/debugger/devtools_remote_message.cc index eb63009..6d82a28 100644 --- a/chrome/browser/debugger/devtools_remote_message.cc +++ b/chrome/browser/debugger/devtools_remote_message.cc @@ -17,6 +17,16 @@ DevToolsRemoteMessageBuilder& DevToolsRemoteMessageBuilder::instance() { return instance_; } +DevToolsRemoteMessage::DevToolsRemoteMessage() {} + +DevToolsRemoteMessage::DevToolsRemoteMessage(const HeaderMap& headers, + const std::string& content) + : header_map_(headers), + content_(content) { +} + +DevToolsRemoteMessage::~DevToolsRemoteMessage() {} + const std::string DevToolsRemoteMessage::GetHeader( const std::string& header_name, const std::string& default_value) const { diff --git a/chrome/browser/debugger/devtools_remote_message.h b/chrome/browser/debugger/devtools_remote_message.h index bea9ae5..e836164 100644 --- a/chrome/browser/debugger/devtools_remote_message.h +++ b/chrome/browser/debugger/devtools_remote_message.h @@ -35,11 +35,9 @@ class DevToolsRemoteMessage { static const char kEmptyValue[]; // Constructs an empty message with no content or headers. - DevToolsRemoteMessage() {} - DevToolsRemoteMessage(const HeaderMap& headers, const std::string& content) - : header_map_(headers), - content_(content) {} - virtual ~DevToolsRemoteMessage() {} + DevToolsRemoteMessage(); + DevToolsRemoteMessage(const HeaderMap& headers, const std::string& content); + virtual ~DevToolsRemoteMessage(); const HeaderMap& headers() const { return header_map_; diff --git a/chrome/browser/debugger/inspectable_tab_proxy.cc b/chrome/browser/debugger/inspectable_tab_proxy.cc index 96d4e3e..ce8fd7f 100644 --- a/chrome/browser/debugger/inspectable_tab_proxy.cc +++ b/chrome/browser/debugger/inspectable_tab_proxy.cc @@ -15,6 +15,18 @@ #include "chrome/browser/tabs/tab_strip_model.h" #include "chrome/common/devtools_messages.h" +DevToolsClientHostImpl::DevToolsClientHostImpl( + int32 id, + DebuggerRemoteService* service, + InspectableTabProxy::IdToClientHostMap* map) + : id_(id), + service_(service), + map_(map) {} + +DevToolsClientHostImpl::~DevToolsClientHostImpl() { + map_->erase(this->id_); +} + // The debugged tab has closed. void DevToolsClientHostImpl::InspectedTabClosing() { TabClosed(); @@ -49,6 +61,10 @@ void DevToolsClientHostImpl::TabClosed() { service_->TabClosed(id_); } +InspectableTabProxy::InspectableTabProxy() {} + +InspectableTabProxy::~InspectableTabProxy() {} + const InspectableTabProxy::ControllersMap& InspectableTabProxy::controllers_map() { controllers_map_.clear(); diff --git a/chrome/browser/debugger/inspectable_tab_proxy.h b/chrome/browser/debugger/inspectable_tab_proxy.h index af08232..8d02727 100644 --- a/chrome/browser/debugger/inspectable_tab_proxy.h +++ b/chrome/browser/debugger/inspectable_tab_proxy.h @@ -26,8 +26,8 @@ class InspectableTabProxy { typedef base::hash_map<int32, NavigationController*> ControllersMap; typedef base::hash_map<int32, DevToolsClientHostImpl*> IdToClientHostMap; - InspectableTabProxy() {} - virtual ~InspectableTabProxy() {} + InspectableTabProxy(); + virtual ~InspectableTabProxy(); // Returns a map of NavigationControllerKeys to NavigationControllers // for all Browser instances. Clients should not keep the result around @@ -64,13 +64,9 @@ class DevToolsClientHostImpl : public DevToolsClientHost { DevToolsClientHostImpl( int32 id, DebuggerRemoteService* service, - InspectableTabProxy::IdToClientHostMap* map) - : id_(id), - service_(service), - map_(map) {} - ~DevToolsClientHostImpl() { - map_->erase(this->id_); - } + InspectableTabProxy::IdToClientHostMap* map); + ~DevToolsClientHostImpl(); + DebuggerRemoteService* debugger_remote_service() { return service_; } diff --git a/chrome/browser/sync/engine/model_safe_worker.cc b/chrome/browser/sync/engine/model_safe_worker.cc index 3f3ddb4..c488e3b 100644 --- a/chrome/browser/sync/engine/model_safe_worker.cc +++ b/chrome/browser/sync/engine/model_safe_worker.cc @@ -38,4 +38,21 @@ std::string ModelSafeGroupToString(ModelSafeGroup group) { } } +ModelSafeWorker::ModelSafeWorker() {} + +ModelSafeWorker::~ModelSafeWorker() {} + +void ModelSafeWorker::DoWorkAndWaitUntilDone(Callback0::Type* work) { + work->Run(); // For GROUP_PASSIVE, we do the work on the current thread. +} + +ModelSafeGroup ModelSafeWorker::GetModelSafeGroup() { + return GROUP_PASSIVE; +} + +bool ModelSafeWorker::CurrentThreadIsWorkThread() { + // The passive group is not the work thread for any browser model. + return false; +} + } // namespace browser_sync diff --git a/chrome/browser/sync/engine/model_safe_worker.h b/chrome/browser/sync/engine/model_safe_worker.h index 4164ff5..9f31c67 100644 --- a/chrome/browser/sync/engine/model_safe_worker.h +++ b/chrome/browser/sync/engine/model_safe_worker.h @@ -41,28 +41,21 @@ std::string ModelSafeGroupToString(ModelSafeGroup group); // syncable::Directory due to a race. class ModelSafeWorker : public base::RefCountedThreadSafe<ModelSafeWorker> { public: - ModelSafeWorker() { } - virtual ~ModelSafeWorker() { } + ModelSafeWorker(); + virtual ~ModelSafeWorker(); // Any time the Syncer performs model modifications (e.g employing a // WriteTransaction), it should be done by this method to ensure it is done // from a model-safe thread. - virtual void DoWorkAndWaitUntilDone(Callback0::Type* work) { - work->Run(); // For GROUP_PASSIVE, we do the work on the current thread. - } + virtual void DoWorkAndWaitUntilDone(Callback0::Type* work); - virtual ModelSafeGroup GetModelSafeGroup() { - return GROUP_PASSIVE; - } + virtual ModelSafeGroup GetModelSafeGroup(); // Check the current thread and see if it's the thread associated with // this worker. If this returns true, then it should be safe to operate // on models that are in this worker's group. If this returns false, // such work should not be attempted. - virtual bool CurrentThreadIsWorkThread() { - // The passive group is not the work thread for any browser model. - return false; - } + virtual bool CurrentThreadIsWorkThread(); private: friend class base::RefCountedThreadSafe<ModelSafeWorker>; diff --git a/chrome/browser/sync/engine/syncapi.cc b/chrome/browser/sync/engine/syncapi.cc index 4728534..f91d0f8 100644 --- a/chrome/browser/sync/engine/syncapi.cc +++ b/chrome/browser/sync/engine/syncapi.cc @@ -24,6 +24,7 @@ #include "base/task.h" #include "base/utf_string_conversions.h" #include "chrome/browser/browser_process.h" +#include "chrome/browser/chrome_thread.h" #include "chrome/browser/sync/sync_constants.h" #include "chrome/browser/sync/engine/all_status.h" #include "chrome/browser/sync/engine/change_reorder_buffer.h" diff --git a/chrome/browser/sync/sessions/ordered_commit_set.cc b/chrome/browser/sync/sessions/ordered_commit_set.cc index 104bafb..d700494 100644 --- a/chrome/browser/sync/sessions/ordered_commit_set.cc +++ b/chrome/browser/sync/sessions/ordered_commit_set.cc @@ -11,6 +11,13 @@ namespace browser_sync { namespace sessions { +OrderedCommitSet::OrderedCommitSet( + const browser_sync::ModelSafeRoutingInfo& routes) + : routes_(routes) { +} + +OrderedCommitSet::~OrderedCommitSet() {} + void OrderedCommitSet::AddCommitItem(const int64 metahandle, const syncable::Id& commit_id, syncable::ModelType type) { diff --git a/chrome/browser/sync/sessions/ordered_commit_set.h b/chrome/browser/sync/sessions/ordered_commit_set.h index 50f3e97..bce2246 100644 --- a/chrome/browser/sync/sessions/ordered_commit_set.h +++ b/chrome/browser/sync/sessions/ordered_commit_set.h @@ -30,10 +30,8 @@ class OrderedCommitSet { typedef std::vector<size_t> Projection; // TODO(chron): Reserve space according to batch size? - explicit OrderedCommitSet(const browser_sync::ModelSafeRoutingInfo& routes) - : routes_(routes) {} - - ~OrderedCommitSet() {} + explicit OrderedCommitSet(const browser_sync::ModelSafeRoutingInfo& routes); + ~OrderedCommitSet(); bool HaveCommitItem(const int64 metahandle) const { return inserted_metahandles_.count(metahandle) > 0; diff --git a/chrome/browser/sync/sessions/session_state.cc b/chrome/browser/sync/sessions/session_state.cc index f28a7dc..644d2f6 100644 --- a/chrome/browser/sync/sessions/session_state.cc +++ b/chrome/browser/sync/sessions/session_state.cc @@ -13,6 +13,39 @@ using std::vector; namespace browser_sync { namespace sessions { +SyncSessionSnapshot::SyncSessionSnapshot( + const SyncerStatus& syncer_status, + const ErrorCounters& errors, + int64 num_server_changes_remaining, + int64 max_local_timestamp, + bool is_share_usable, + const syncable::ModelTypeBitSet& initial_sync_ended, + bool more_to_sync, + bool is_silenced, + int64 unsynced_count, + int num_conflicting_updates, + bool did_commit_items) + : syncer_status(syncer_status), + errors(errors), + num_server_changes_remaining(num_server_changes_remaining), + max_local_timestamp(max_local_timestamp), + is_share_usable(is_share_usable), + initial_sync_ended(initial_sync_ended), + has_more_to_sync(more_to_sync), + is_silenced(is_silenced), + unsynced_count(unsynced_count), + num_conflicting_updates(num_conflicting_updates), + did_commit_items(did_commit_items) { +} + +SyncSessionSnapshot::~SyncSessionSnapshot() {} + +ConflictProgress::ConflictProgress(bool* dirty_flag) : dirty_(dirty_flag) {} + +ConflictProgress::~ConflictProgress() { + CleanupSets(); +} + IdToConflictSetMap::const_iterator ConflictProgress::IdToConflictSetFind( const syncable::Id& the_id) const { return id_to_conflict_set_.find(the_id); @@ -131,6 +164,10 @@ void ConflictProgress::CleanupSets() { id_to_conflict_set_.clear(); } +UpdateProgress::UpdateProgress() {} + +UpdateProgress::~UpdateProgress() {} + void UpdateProgress::AddVerifyResult(const VerifyResult& verify_result, const sync_pb::SyncEntity& entity) { verified_updates_.push_back(std::make_pair(verify_result, entity)); @@ -184,5 +221,29 @@ bool UpdateProgress::HasConflictingUpdates() const { return false; } +AllModelTypeState::AllModelTypeState(bool* dirty_flag) + : unsynced_handles(dirty_flag), + syncer_status(dirty_flag), + error_counters(dirty_flag), + num_server_changes_remaining(dirty_flag, 0), + commit_set(ModelSafeRoutingInfo()) { +} + +AllModelTypeState::~AllModelTypeState() {} + +PerModelSafeGroupState::PerModelSafeGroupState(bool* dirty_flag) + : conflict_progress(dirty_flag) { +} + +PerModelSafeGroupState::~PerModelSafeGroupState() { +} + +PerModelTypeState::PerModelTypeState(bool* dirty_flag) + : current_download_timestamp(dirty_flag, 0) { +} + +PerModelTypeState::~PerModelTypeState() { +} + } // namespace sessions } // namespace browser_sync diff --git a/chrome/browser/sync/sessions/session_state.h b/chrome/browser/sync/sessions/session_state.h index 3f1e721..c345fb4 100644 --- a/chrome/browser/sync/sessions/session_state.h +++ b/chrome/browser/sync/sessions/session_state.h @@ -80,18 +80,9 @@ struct SyncSessionSnapshot { bool is_silenced, int64 unsynced_count, int num_conflicting_updates, - bool did_commit_items) - : syncer_status(syncer_status), - errors(errors), - num_server_changes_remaining(num_server_changes_remaining), - max_local_timestamp(max_local_timestamp), - is_share_usable(is_share_usable), - initial_sync_ended(initial_sync_ended), - has_more_to_sync(more_to_sync), - is_silenced(is_silenced), - unsynced_count(unsynced_count), - num_conflicting_updates(num_conflicting_updates), - did_commit_items(did_commit_items) {} + bool did_commit_items); + ~SyncSessionSnapshot(); + const SyncerStatus syncer_status; const ErrorCounters errors; const int64 num_server_changes_remaining; @@ -108,8 +99,8 @@ struct SyncSessionSnapshot { // Tracks progress of conflicts and their resolution using conflict sets. class ConflictProgress { public: - explicit ConflictProgress(bool* dirty_flag) : dirty_(dirty_flag) {} - ~ConflictProgress() { CleanupSets(); } + explicit ConflictProgress(bool* dirty_flag); + ~ConflictProgress(); // Various iterators, size, and retrieval functions for conflict sets. IdToConflictSetMap::const_iterator IdToConflictSetBegin() const; IdToConflictSetMap::const_iterator IdToConflictSetEnd() const; @@ -150,6 +141,9 @@ typedef std::pair<UpdateAttemptResponse, syncable::Id> AppliedUpdate; // Tracks update application and verification. class UpdateProgress { public: + UpdateProgress(); + ~UpdateProgress(); + void AddVerifyResult(const VerifyResult& verify_result, const sync_pb::SyncEntity& entity); @@ -232,12 +226,9 @@ class DirtyOnWrite { // scope control (such as OrderedCommitSet), but the top level entity is still // a singleton with respect to model types. struct AllModelTypeState { - explicit AllModelTypeState(bool* dirty_flag) - : unsynced_handles(dirty_flag), - syncer_status(dirty_flag), - error_counters(dirty_flag), - num_server_changes_remaining(dirty_flag, 0), - commit_set(ModelSafeRoutingInfo()) {} + explicit AllModelTypeState(bool* dirty_flag); + ~AllModelTypeState(); + // Commits for all model types are bundled together into a single message. ClientToServerMessage commit_message; ClientToServerResponse commit_response; @@ -256,16 +247,18 @@ struct AllModelTypeState { // Grouping of all state that applies to a single ModelSafeGroup. struct PerModelSafeGroupState { - explicit PerModelSafeGroupState(bool* dirty_flag) - : conflict_progress(dirty_flag) {} + explicit PerModelSafeGroupState(bool* dirty_flag); + ~PerModelSafeGroupState(); + UpdateProgress update_progress; ConflictProgress conflict_progress; }; // Grouping of all state that applies to a single ModelType. struct PerModelTypeState { - explicit PerModelTypeState(bool* dirty_flag) - : current_download_timestamp(dirty_flag, 0) {} + explicit PerModelTypeState(bool* dirty_flag); + ~PerModelTypeState(); + DirtyOnWrite<int64> current_download_timestamp; }; diff --git a/chrome/browser/sync/sessions/status_controller.cc b/chrome/browser/sync/sessions/status_controller.cc index 21159d8..f7e159c 100644 --- a/chrome/browser/sync/sessions/status_controller.cc +++ b/chrome/browser/sync/sessions/status_controller.cc @@ -23,6 +23,8 @@ StatusController::StatusController(const ModelSafeRoutingInfo& routes) routing_info_(routes) { } +StatusController::~StatusController() {} + bool StatusController::TestAndClearIsDirty() { bool is_dirty = is_dirty_; is_dirty_ = false; diff --git a/chrome/browser/sync/sessions/status_controller.h b/chrome/browser/sync/sessions/status_controller.h index f367b50..d038ed5 100644 --- a/chrome/browser/sync/sessions/status_controller.h +++ b/chrome/browser/sync/sessions/status_controller.h @@ -45,6 +45,7 @@ namespace sessions { class StatusController { public: explicit StatusController(const ModelSafeRoutingInfo& routes); + ~StatusController(); // Returns true if some portion of the session state has changed (is dirty) // since it was created or was last reset. diff --git a/chrome/browser/sync/sessions/sync_session.cc b/chrome/browser/sync/sessions/sync_session.cc index 8e5064c..a861b2c 100644 --- a/chrome/browser/sync/sessions/sync_session.cc +++ b/chrome/browser/sync/sessions/sync_session.cc @@ -22,6 +22,8 @@ SyncSession::SyncSession(SyncSessionContext* context, Delegate* delegate) status_controller_.reset(new StatusController(routing_info_)); } +SyncSession::~SyncSession() {} + SyncSessionSnapshot SyncSession::TakeSnapshot() const { syncable::ScopedDirLookup dir(context_->directory_manager(), context_->account_name()); diff --git a/chrome/browser/sync/sessions/sync_session.h b/chrome/browser/sync/sessions/sync_session.h index d3320ca..568c1f4 100644 --- a/chrome/browser/sync/sessions/sync_session.h +++ b/chrome/browser/sync/sessions/sync_session.h @@ -77,6 +77,7 @@ class SyncSession { // Creates a new SyncSession with mandatory context and delegate. SyncSession(SyncSessionContext* context, Delegate* delegate); + ~SyncSession(); // Builds a thread-safe and read-only copy of the current session state. SyncSessionSnapshot TakeSnapshot() const; diff --git a/chrome/browser/sync/sessions/sync_session_context.cc b/chrome/browser/sync/sessions/sync_session_context.cc new file mode 100644 index 0000000..7b69568 --- /dev/null +++ b/chrome/browser/sync/sessions/sync_session_context.cc @@ -0,0 +1,41 @@ +// Copyright (c) 2010 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/sessions/sync_session_context.h" + +#include "chrome/browser/chrome_thread.h" +#include "chrome/browser/sync/util/extensions_activity_monitor.h" +#include "chrome/browser/sync/sessions/session_state.h" + +namespace browser_sync { +namespace sessions { + +SyncSessionContext::SyncSessionContext( + ServerConnectionManager* connection_manager, + syncable::DirectoryManager* directory_manager, + ModelSafeWorkerRegistrar* model_safe_worker_registrar) + : resolver_(NULL), + syncer_event_channel_(NULL), + connection_manager_(connection_manager), + directory_manager_(directory_manager), + registrar_(model_safe_worker_registrar), + extensions_activity_monitor_(new ExtensionsActivityMonitor()), + notifications_enabled_(false) { +} + +SyncSessionContext::~SyncSessionContext() { + // In unittests, there may be no UI thread, so the above will fail. + if (!ChromeThread::DeleteSoon(ChromeThread::UI, FROM_HERE, + extensions_activity_monitor_)) { + delete extensions_activity_monitor_; + } +} + +void SyncSessionContext::set_last_snapshot( + const SyncSessionSnapshot& snapshot) { + previous_session_snapshot_.reset(new SyncSessionSnapshot(snapshot)); +} + +} // namespace sessions +} // namespace browser_sync diff --git a/chrome/browser/sync/sessions/sync_session_context.h b/chrome/browser/sync/sessions/sync_session_context.h index 4c6b63f..b782876 100644 --- a/chrome/browser/sync/sessions/sync_session_context.h +++ b/chrome/browser/sync/sessions/sync_session_context.h @@ -20,10 +20,10 @@ #pragma once #include <string> -#include "chrome/browser/chrome_thread.h" + +#include "base/scoped_ptr.h" #include "chrome/browser/sync/engine/model_safe_worker.h" #include "chrome/browser/sync/engine/syncer_types.h" -#include "chrome/browser/sync/util/extensions_activity_monitor.h" namespace syncable { class DirectoryManager; @@ -32,34 +32,21 @@ class DirectoryManager; namespace browser_sync { class ConflictResolver; +class ExtensionsActivityMonitor; class ModelSafeWorkerRegistrar; class ServerConnectionManager; namespace sessions { class ScopedSessionContextConflictResolver; class ScopedSessionContextSyncerEventChannel; +struct SyncSessionSnapshot; class SyncSessionContext { public: SyncSessionContext(ServerConnectionManager* connection_manager, syncable::DirectoryManager* directory_manager, - ModelSafeWorkerRegistrar* model_safe_worker_registrar) - : resolver_(NULL), - syncer_event_channel_(NULL), - connection_manager_(connection_manager), - directory_manager_(directory_manager), - registrar_(model_safe_worker_registrar), - extensions_activity_monitor_(new ExtensionsActivityMonitor()), - notifications_enabled_(false) { - } - - ~SyncSessionContext() { - // In unittests, there may be no UI thread, so the above will fail. - if (!ChromeThread::DeleteSoon(ChromeThread::UI, FROM_HERE, - extensions_activity_monitor_)) { - delete extensions_activity_monitor_; - } - } + ModelSafeWorkerRegistrar* model_safe_worker_registrar); + ~SyncSessionContext(); ConflictResolver* resolver() { return resolver_; } ServerConnectionManager* connection_manager() { @@ -103,9 +90,7 @@ class SyncSessionContext { return previous_session_snapshot_.get(); } - void set_last_snapshot(const SyncSessionSnapshot& snapshot) { - previous_session_snapshot_.reset(new SyncSessionSnapshot(snapshot)); - } + void set_last_snapshot(const SyncSessionSnapshot& snapshot); private: // Rather than force clients to set and null-out various context members, we diff --git a/chrome/browser/sync/syncable/syncable.cc b/chrome/browser/sync/syncable/syncable.cc index d1fd9d6..2d51526 100644 --- a/chrome/browser/sync/syncable/syncable.cc +++ b/chrome/browser/sync/syncable/syncable.cc @@ -154,6 +154,13 @@ bool LessPathNames::operator() (const string& a, const string& b) const { } /////////////////////////////////////////////////////////////////////////// +// EntryKernel + +EntryKernel::EntryKernel() : dirty_(false) {} + +EntryKernel::~EntryKernel() {} + +/////////////////////////////////////////////////////////////////////////// // Directory static const DirectoryChangeEvent kShutdownChangesEvent = @@ -164,6 +171,21 @@ void Directory::init_kernel(const std::string& name) { kernel_ = new Kernel(FilePath(), name, KernelLoadInfo()); } +Directory::PersistedKernelInfo::PersistedKernelInfo() + : next_id(0) { + for (int i = 0; i < MODEL_TYPE_COUNT; ++i) { + last_download_timestamp[i] = 0; + } +} + +Directory::PersistedKernelInfo::~PersistedKernelInfo() {} + +Directory::SaveChangesSnapshot::SaveChangesSnapshot() + : kernel_info_status(KERNEL_SHARE_INFO_INVALID) { +} + +Directory::SaveChangesSnapshot::~SaveChangesSnapshot() {} + Directory::Kernel::Kernel(const FilePath& db_path, const string& name, const KernelLoadInfo& info) diff --git a/chrome/browser/sync/syncable/syncable.h b/chrome/browser/sync/syncable/syncable.h index 7cdae1c..a3c2212 100644 --- a/chrome/browser/sync/syncable/syncable.h +++ b/chrome/browser/sync/syncable/syncable.h @@ -228,7 +228,8 @@ struct EntryKernel { std::bitset<BIT_TEMPS_COUNT> bit_temps; public: - EntryKernel() : dirty_(false) {} + EntryKernel(); + ~EntryKernel(); // Set the dirty bit, and optionally add this entry's metahandle to // a provided index on dirty bits in |dirty_index|. Parameter may be null, @@ -659,6 +660,9 @@ class Directory { // Various data that the Directory::Kernel we are backing (persisting data // for) needs saved across runs of the application. struct PersistedKernelInfo { + PersistedKernelInfo(); + ~PersistedKernelInfo(); + // Last sync timestamp fetched from the server. int64 last_download_timestamp[MODEL_TYPE_COUNT]; // true iff we ever reached the end of the changelog. @@ -668,11 +672,6 @@ class Directory { std::string store_birthday; // The next local ID that has not been used with this cache-GUID. int64 next_id; - PersistedKernelInfo() : next_id(0) { - for (int i = 0; i < MODEL_TYPE_COUNT; ++i) { - last_download_timestamp[i] = 0; - } - } }; // What the Directory needs on initialization to create itself and its Kernel. @@ -697,12 +696,13 @@ class Directory { // constructed and forms a consistent snapshot of what needs to be sent to // the backing store. struct SaveChangesSnapshot { + SaveChangesSnapshot(); + ~SaveChangesSnapshot(); + KernelShareInfoStatus kernel_info_status; PersistedKernelInfo kernel_info; OriginalEntries dirty_metas; MetahandleSet metahandles_to_purge; - SaveChangesSnapshot() : kernel_info_status(KERNEL_SHARE_INFO_INVALID) { - } }; Directory(); diff --git a/chrome/browser/sync/util/crypto_helpers.cc b/chrome/browser/sync/util/crypto_helpers.cc index b01e01f..9315d8b 100644 --- a/chrome/browser/sync/util/crypto_helpers.cc +++ b/chrome/browser/sync/util/crypto_helpers.cc @@ -21,6 +21,8 @@ MD5Calculator::MD5Calculator() { MD5Init(&context_); } +MD5Calculator::~MD5Calculator() {} + void MD5Calculator::AddData(const unsigned char* data, int length) { CHECK(bin_digest_.empty()); MD5Update(&context_, data, length); @@ -34,7 +36,7 @@ void MD5Calculator::CalcDigest() { } } -vector<uint8> MD5Calculator::GetDigest() { +const vector<uint8>& MD5Calculator::GetDigest() { CalcDigest(); return bin_digest_; } diff --git a/chrome/browser/sync/util/crypto_helpers.h b/chrome/browser/sync/util/crypto_helpers.h index 5660447..34b36f4 100644 --- a/chrome/browser/sync/util/crypto_helpers.h +++ b/chrome/browser/sync/util/crypto_helpers.h @@ -22,13 +22,13 @@ class MD5Calculator { void CalcDigest(); public: MD5Calculator(); - ~MD5Calculator() {} + ~MD5Calculator(); void AddData(const uint8* data, int length); void AddData(const char* data, int length) { AddData(reinterpret_cast<const uint8*>(data), length); } std::string GetHexDigest(); - std::vector<uint8> GetDigest(); + const std::vector<uint8>& GetDigest(); private: DISALLOW_COPY_AND_ASSIGN(MD5Calculator); }; diff --git a/chrome/browser/sync/util/cryptographer.cc b/chrome/browser/sync/util/cryptographer.cc index 2a3701e..747b094 100644 --- a/chrome/browser/sync/util/cryptographer.cc +++ b/chrome/browser/sync/util/cryptographer.cc @@ -19,6 +19,8 @@ const char kNigoriKeyName[] = "nigori-key"; Cryptographer::Cryptographer() : default_nigori_(NULL) { } +Cryptographer::~Cryptographer() {} + void Cryptographer::Bootstrap(const std::string& restored_bootstrap_token) { if (is_ready()) { NOTREACHED(); diff --git a/chrome/browser/sync/util/cryptographer.h b/chrome/browser/sync/util/cryptographer.h index 230ed94..ada084cc 100644 --- a/chrome/browser/sync/util/cryptographer.h +++ b/chrome/browser/sync/util/cryptographer.h @@ -43,6 +43,7 @@ struct KeyParams { class Cryptographer { public: Cryptographer(); + ~Cryptographer(); // |restored_bootstrap_token| can be provided via this method to bootstrap // Cryptographer instance into the ready state (is_ready will be true). diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index ca49e30..3872e85 100644 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -976,6 +976,7 @@ 'browser/sync/sessions/status_controller.h', 'browser/sync/sessions/sync_session.cc', 'browser/sync/sessions/sync_session.h', + 'browser/sync/sessions/sync_session_context.cc', 'browser/sync/sessions/sync_session_context.h', 'browser/sync/syncable/blob.h', 'browser/sync/syncable/dir_open_result.h', diff --git a/chrome/chrome_common.gypi b/chrome/chrome_common.gypi index e4bc767..ad9b994 100644 --- a/chrome/chrome_common.gypi +++ b/chrome/chrome_common.gypi @@ -104,6 +104,7 @@ 'common/property_bag.cc', 'common/property_bag.h', 'common/ref_counted_util.h', + 'common/resource_response.cc', 'common/resource_response.h', 'common/result_codes.h', 'common/sandbox_init_wrapper.h', @@ -275,6 +276,7 @@ 'common/render_messages_params.cc', 'common/render_messages_params.h', 'common/render_messages_internal.h', + 'common/renderer_preferences.cc', 'common/renderer_preferences.h', 'common/resource_dispatcher.cc', 'common/resource_dispatcher.h', diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc index c7f6f3f..cc6b8585 100644 --- a/chrome/common/extensions/extension.cc +++ b/chrome/common/extensions/extension.cc @@ -2163,8 +2163,7 @@ ExtensionInfo::ExtensionInfo(const DictionaryValue* manifest, static_cast<DictionaryValue*>(manifest->DeepCopy())); } -ExtensionInfo::~ExtensionInfo() { -} +ExtensionInfo::~ExtensionInfo() {} UninstalledExtensionInfo::UninstalledExtensionInfo( const Extension& extension) @@ -2174,3 +2173,5 @@ UninstalledExtensionInfo::UninstalledExtensionInfo( is_app(extension.is_app()), converted_from_user_script(extension.converted_from_user_script()), update_url(extension.update_url()) {} + +UninstalledExtensionInfo::~UninstalledExtensionInfo() {} diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h index 630f1af..e012ad6 100644 --- a/chrome/common/extensions/extension.h +++ b/chrome/common/extensions/extension.h @@ -697,6 +697,7 @@ struct ExtensionInfo { // notification. struct UninstalledExtensionInfo { explicit UninstalledExtensionInfo(const Extension& extension); + ~UninstalledExtensionInfo(); std::string extension_id; std::set<std::string> extension_api_permissions; diff --git a/chrome/common/extensions/extension_icon_set.cc b/chrome/common/extensions/extension_icon_set.cc index 3eedce0..1f1dd21 100644 --- a/chrome/common/extensions/extension_icon_set.cc +++ b/chrome/common/extensions/extension_icon_set.cc @@ -6,6 +6,10 @@ #include "base/logging.h" +ExtensionIconSet::ExtensionIconSet() {} + +ExtensionIconSet::~ExtensionIconSet() {} + void ExtensionIconSet::Clear() { map_.clear(); } diff --git a/chrome/common/extensions/extension_icon_set.h b/chrome/common/extensions/extension_icon_set.h index d1dc9f3..7fe80c5 100644 --- a/chrome/common/extensions/extension_icon_set.h +++ b/chrome/common/extensions/extension_icon_set.h @@ -12,6 +12,9 @@ // Represents the set of icons for an extension. class ExtensionIconSet { public: + ExtensionIconSet(); + ~ExtensionIconSet(); + // Access to the underlying map from icon size->path. typedef std::map<int, std::string> IconMap; const IconMap& map() const { return map_; } diff --git a/chrome/common/extensions/url_pattern.h b/chrome/common/extensions/url_pattern.h index 0067678..832673c 100644 --- a/chrome/common/extensions/url_pattern.h +++ b/chrome/common/extensions/url_pattern.h @@ -184,9 +184,8 @@ class URLPattern { }; // Used for origin comparisons in a std::set. - class EffectiveHostCompareFunctor : - public std::binary_function<URLPattern, URLPattern, bool> { - public: + class EffectiveHostCompareFunctor { + public: bool operator()(const URLPattern& a, const URLPattern& b) const { return EffectiveHostCompare(a, b); }; diff --git a/chrome/common/indexed_db_key.cc b/chrome/common/indexed_db_key.cc index 315e5b2..9f7d153 100644 --- a/chrome/common/indexed_db_key.cc +++ b/chrome/common/indexed_db_key.cc @@ -18,6 +18,9 @@ IndexedDBKey::IndexedDBKey(const WebIDBKey& key) { Set(key); } +IndexedDBKey::~IndexedDBKey() { +} + void IndexedDBKey::SetNull() { type_ = WebIDBKey::NullType; } diff --git a/chrome/common/indexed_db_key.h b/chrome/common/indexed_db_key.h index 41fb10b..29c1792 100644 --- a/chrome/common/indexed_db_key.h +++ b/chrome/common/indexed_db_key.h @@ -14,6 +14,7 @@ class IndexedDBKey { public: IndexedDBKey(); // Defaults to WebKit::WebIDBKey::InvalidType. explicit IndexedDBKey(const WebKit::WebIDBKey& key); + ~IndexedDBKey(); void SetNull(); void SetInvalid(); diff --git a/chrome/common/render_messages_params.cc b/chrome/common/render_messages_params.cc index ac81931..1414b8a 100644 --- a/chrome/common/render_messages_params.cc +++ b/chrome/common/render_messages_params.cc @@ -188,6 +188,41 @@ ViewHostMsg_IDBDatabaseCreateObjectStore_Params:: ~ViewHostMsg_IDBDatabaseCreateObjectStore_Params() { } +ViewHostMsg_IDBIndexOpenCursor_Params::ViewHostMsg_IDBIndexOpenCursor_Params() + : response_id_(0), + key_flags_(0), + direction_(0), + idb_index_id_(0), + transaction_id_(0) { +} + +ViewHostMsg_IDBIndexOpenCursor_Params:: + ~ViewHostMsg_IDBIndexOpenCursor_Params() { +} + + +ViewHostMsg_IDBObjectStorePut_Params::ViewHostMsg_IDBObjectStorePut_Params() + : idb_object_store_id_(0), + response_id_(0), + add_only_(false), + transaction_id_(0) { +} + +ViewHostMsg_IDBObjectStorePut_Params::~ViewHostMsg_IDBObjectStorePut_Params() { +} + +ViewHostMsg_IDBObjectStoreCreateIndex_Params:: +ViewHostMsg_IDBObjectStoreCreateIndex_Params() + : response_id_(0), + unique_(false), + idb_object_store_id_(0) { +} + +ViewHostMsg_IDBObjectStoreCreateIndex_Params:: +~ViewHostMsg_IDBObjectStoreCreateIndex_Params() { +} + + ViewHostMsg_IDBObjectStoreOpenCursor_Params:: ViewHostMsg_IDBObjectStoreOpenCursor_Params() : response_id_(0), diff --git a/chrome/common/render_messages_params.h b/chrome/common/render_messages_params.h index 0359b1e..1c49b66 100644 --- a/chrome/common/render_messages_params.h +++ b/chrome/common/render_messages_params.h @@ -654,6 +654,9 @@ struct ViewHostMsg_IDBDatabaseCreateObjectStore_Params { // Used to open both cursors and object cursors in IndexedDB. struct ViewHostMsg_IDBIndexOpenCursor_Params { + ViewHostMsg_IDBIndexOpenCursor_Params(); + ~ViewHostMsg_IDBIndexOpenCursor_Params(); + // The response should have this id. int32 response_id_; @@ -678,6 +681,9 @@ struct ViewHostMsg_IDBIndexOpenCursor_Params { // Used to set a value in an object store. struct ViewHostMsg_IDBObjectStorePut_Params { + ViewHostMsg_IDBObjectStorePut_Params(); + ~ViewHostMsg_IDBObjectStorePut_Params(); + // The object store's id. int32 idb_object_store_id_; @@ -699,6 +705,9 @@ struct ViewHostMsg_IDBObjectStorePut_Params { // Used to create an index. struct ViewHostMsg_IDBObjectStoreCreateIndex_Params { + ViewHostMsg_IDBObjectStoreCreateIndex_Params(); + ~ViewHostMsg_IDBObjectStoreCreateIndex_Params(); + // The response should have this id. int32 response_id_; diff --git a/chrome/common/renderer_preferences.cc b/chrome/common/renderer_preferences.cc new file mode 100644 index 0000000..4c29dd8 --- /dev/null +++ b/chrome/common/renderer_preferences.cc @@ -0,0 +1,23 @@ +// Copyright (c) 2010 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/common/renderer_preferences.h" + +RendererPreferences::RendererPreferences() + : can_accept_load_drops(true), + should_antialias_text(true), + hinting(RENDERER_PREFERENCES_HINTING_SYSTEM_DEFAULT), + subpixel_rendering( + RENDERER_PREFERENCES_SUBPIXEL_RENDERING_SYSTEM_DEFAULT), + focus_ring_color(0), + thumb_active_color(0), + thumb_inactive_color(0), + track_color(0), + active_selection_bg_color(0), + active_selection_fg_color(0), + inactive_selection_bg_color(0), + inactive_selection_fg_color(0), + browser_handles_top_level_requests(false), + caret_blink_interval(0) { +} diff --git a/chrome/common/renderer_preferences.h b/chrome/common/renderer_preferences.h index dd57866..0bb72ef 100644 --- a/chrome/common/renderer_preferences.h +++ b/chrome/common/renderer_preferences.h @@ -33,6 +33,8 @@ enum RendererPreferencesSubpixelRenderingEnum { }; struct RendererPreferences { + RendererPreferences(); + // Whether the renderer's current browser context accept drops from the OS // that result in navigations away from the current page. bool can_accept_load_drops; @@ -71,24 +73,6 @@ struct RendererPreferences { // Currently only changed from default on Linux. Uses |gtk-cursor-blink| // from GtkSettings. double caret_blink_interval; - - RendererPreferences() - : can_accept_load_drops(true), - should_antialias_text(true), - hinting(RENDERER_PREFERENCES_HINTING_SYSTEM_DEFAULT), - subpixel_rendering( - RENDERER_PREFERENCES_SUBPIXEL_RENDERING_SYSTEM_DEFAULT), - focus_ring_color(0), - thumb_active_color(0), - thumb_inactive_color(0), - track_color(0), - active_selection_bg_color(0), - active_selection_fg_color(0), - inactive_selection_bg_color(0), - inactive_selection_fg_color(0), - browser_handles_top_level_requests(false), - caret_blink_interval(0) { - } }; #endif // CHROME_COMMON_RENDERER_PREFERENCES_H_ diff --git a/chrome/common/resource_response.cc b/chrome/common/resource_response.cc new file mode 100644 index 0000000..ad8f184 --- /dev/null +++ b/chrome/common/resource_response.cc @@ -0,0 +1,19 @@ +// Copyright (c) 2010 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/common/resource_response.h" + +ResourceResponseHead::ResourceResponseHead() + : replace_extension_localization_templates(false) { +} + +ResourceResponseHead::~ResourceResponseHead() {} + +SyncLoadResult::SyncLoadResult() {} + +SyncLoadResult::~SyncLoadResult() {} + +ResourceResponse::ResourceResponse() {} + +ResourceResponse::~ResourceResponse() {} diff --git a/chrome/common/resource_response.h b/chrome/common/resource_response.h index 368e410d..0700a8c 100644 --- a/chrome/common/resource_response.h +++ b/chrome/common/resource_response.h @@ -18,7 +18,8 @@ // Parameters for a resource response header. struct ResourceResponseHead : webkit_glue::ResourceLoaderBridge::ResponseInfo { - ResourceResponseHead() : replace_extension_localization_templates(false) {} + ResourceResponseHead(); + ~ResourceResponseHead(); // The response status. URLRequestStatus status; @@ -31,6 +32,9 @@ struct ResourceResponseHead // Parameters for a synchronous resource response. struct SyncLoadResult : ResourceResponseHead { + SyncLoadResult(); + ~SyncLoadResult(); + // The final URL after any redirects. GURL final_url; @@ -42,10 +46,11 @@ struct SyncLoadResult : ResourceResponseHead { struct ResourceResponse : public base::RefCounted<ResourceResponse> { ResourceResponseHead response_head; + ResourceResponse(); private: friend class base::RefCounted<ResourceResponse>; - ~ResourceResponse() {} + virtual ~ResourceResponse(); }; #endif // CHROME_COMMON_RESOURCE_RESPONSE_H_ diff --git a/chrome/common/webmessageportchannel_impl.h b/chrome/common/webmessageportchannel_impl.h index 24e7ddc..313fd23 100644 --- a/chrome/common/webmessageportchannel_impl.h +++ b/chrome/common/webmessageportchannel_impl.h @@ -32,7 +32,7 @@ class WebMessagePortChannelImpl private: friend class base::RefCountedThreadSafe<WebMessagePortChannelImpl>; - ~WebMessagePortChannelImpl(); + virtual ~WebMessagePortChannelImpl(); // WebMessagePortChannel implementation. virtual void setClient(WebKit::WebMessagePortChannelClient* client); diff --git a/chrome/worker/worker_webkitclient_impl.cc b/chrome/worker/worker_webkitclient_impl.cc index 048bda0..1645fa8 100644 --- a/chrome/worker/worker_webkitclient_impl.cc +++ b/chrome/worker/worker_webkitclient_impl.cc @@ -6,6 +6,7 @@ #include "base/logging.h" #include "chrome/common/database_util.h" +#include "chrome/common/file_system/webfilesystem_impl.h" #include "chrome/common/render_messages.h" #include "chrome/common/render_messages_params.h" #include "chrome/common/webblobregistry_impl.h" @@ -27,6 +28,12 @@ using WebKit::WebStorageNamespace; using WebKit::WebString; using WebKit::WebURL; +WorkerWebKitClientImpl::WorkerWebKitClientImpl() { +} + +WorkerWebKitClientImpl::~WorkerWebKitClientImpl() { +} + WebClipboard* WorkerWebKitClientImpl::clipboard() { NOTREACHED(); return NULL; @@ -149,8 +156,8 @@ WebMimeRegistry::SupportsType WorkerWebKitClientImpl::supportsImageMIMEType( return WebMimeRegistry::IsSupported; } -WebMimeRegistry::SupportsType WorkerWebKitClientImpl::supportsJavaScriptMIMEType( - const WebString&) { +WebMimeRegistry::SupportsType +WorkerWebKitClientImpl::supportsJavaScriptMIMEType(const WebString&) { NOTREACHED(); return WebMimeRegistry::IsSupported; } diff --git a/chrome/worker/worker_webkitclient_impl.h b/chrome/worker/worker_webkitclient_impl.h index 16845ab..e5b3ec6 100644 --- a/chrome/worker/worker_webkitclient_impl.h +++ b/chrome/worker/worker_webkitclient_impl.h @@ -7,14 +7,18 @@ #pragma once #include "base/scoped_ptr.h" -#include "chrome/common/file_system/webfilesystem_impl.h" #include "third_party/WebKit/WebKit/chromium/public/WebMimeRegistry.h" #include "webkit/glue/webfileutilities_impl.h" #include "webkit/glue/webkitclient_impl.h" +class WebFileSystemImpl; + class WorkerWebKitClientImpl : public webkit_glue::WebKitClientImpl, public WebKit::WebMimeRegistry { public: + WorkerWebKitClientImpl(); + virtual ~WorkerWebKitClientImpl(); + // WebKitClient methods: virtual WebKit::WebClipboard* clipboard(); virtual WebKit::WebMimeRegistry* mimeRegistry(); diff --git a/jingle/notifier/communicator/connection_settings.cc b/jingle/notifier/communicator/connection_settings.cc index a16ce39..1648c4e 100644 --- a/jingle/notifier/communicator/connection_settings.cc +++ b/jingle/notifier/communicator/connection_settings.cc @@ -21,6 +21,10 @@ class RandomGenerator { } }; +ConnectionSettings::ConnectionSettings() : protocol_(cricket::PROTO_TCP) {} + +ConnectionSettings::~ConnectionSettings() {} + void ConnectionSettings::FillXmppClientSettings( buzz::XmppClientSettings* xcs) const { DCHECK(xcs); @@ -30,6 +34,10 @@ void ConnectionSettings::FillXmppClientSettings( xcs->set_use_proxy_auth(false); } +ConnectionSettingsList::ConnectionSettingsList() {} + +ConnectionSettingsList::~ConnectionSettingsList() {} + void ConnectionSettingsList::AddPermutations(const std::string& hostname, const std::vector<uint32>& iplist, int16 port, diff --git a/jingle/notifier/communicator/connection_settings.h b/jingle/notifier/communicator/connection_settings.h index 9f7e4b1..b26f559 100644 --- a/jingle/notifier/communicator/connection_settings.h +++ b/jingle/notifier/communicator/connection_settings.h @@ -15,7 +15,8 @@ namespace notifier { class ConnectionSettings { public: - ConnectionSettings() : protocol_(cricket::PROTO_TCP) {} + ConnectionSettings(); + ~ConnectionSettings(); cricket::ProtocolType protocol() { return protocol_; } const talk_base::SocketAddress& server() const { return server_; } @@ -33,7 +34,8 @@ class ConnectionSettings { class ConnectionSettingsList { public: - ConnectionSettingsList() {} + ConnectionSettingsList(); + ~ConnectionSettingsList(); int GetCount() { return list_.size(); } ConnectionSettings* GetSettings(size_t index) { return &list_[index]; } diff --git a/net/base/capturing_net_log.cc b/net/base/capturing_net_log.cc index 08f3b8d..c488e06 100644 --- a/net/base/capturing_net_log.cc +++ b/net/base/capturing_net_log.cc @@ -6,10 +6,23 @@ namespace net { +CapturingNetLog::Entry::Entry(EventType type, + const base::TimeTicks& time, + Source source, + EventPhase phase, + EventParameters* extra_parameters) + : type(type), time(time), source(source), phase(phase), + extra_parameters(extra_parameters) { +} + +CapturingNetLog::Entry::~Entry() {} + CapturingNetLog::CapturingNetLog(size_t max_num_entries) : next_id_(0), max_num_entries_(max_num_entries) { } +CapturingNetLog::~CapturingNetLog() {} + void CapturingNetLog::AddEntry(EventType type, const base::TimeTicks& time, const Source& source, @@ -28,6 +41,16 @@ void CapturingNetLog::Clear() { entries_.clear(); } +CapturingBoundNetLog::CapturingBoundNetLog(const NetLog::Source& source, + CapturingNetLog* net_log) + : source_(source), capturing_net_log_(net_log) { +} + +CapturingBoundNetLog::CapturingBoundNetLog(size_t max_num_entries) + : capturing_net_log_(new CapturingNetLog(max_num_entries)) {} + +CapturingBoundNetLog::~CapturingBoundNetLog() {} + void CapturingBoundNetLog::Clear() { capturing_net_log_->Clear(); } diff --git a/net/base/capturing_net_log.h b/net/base/capturing_net_log.h index 9669445..6e0f620 100644 --- a/net/base/capturing_net_log.h +++ b/net/base/capturing_net_log.h @@ -25,10 +25,8 @@ class CapturingNetLog : public NetLog { const base::TimeTicks& time, Source source, EventPhase phase, - EventParameters* extra_parameters) - : type(type), time(time), source(source), phase(phase), - extra_parameters(extra_parameters) { - } + EventParameters* extra_parameters); + ~Entry(); EventType type; base::TimeTicks time; @@ -45,6 +43,7 @@ class CapturingNetLog : public NetLog { // Creates a CapturingNetLog that logs a maximum of |max_num_entries| // messages. explicit CapturingNetLog(size_t max_num_entries); + virtual ~CapturingNetLog(); // NetLog implementation: virtual void AddEntry(EventType type, @@ -75,12 +74,11 @@ class CapturingNetLog : public NetLog { // bound() method. class CapturingBoundNetLog { public: - CapturingBoundNetLog(const NetLog::Source& source, CapturingNetLog* net_log) - : source_(source), capturing_net_log_(net_log) { - } + CapturingBoundNetLog(const NetLog::Source& source, CapturingNetLog* net_log); + + explicit CapturingBoundNetLog(size_t max_num_entries); - explicit CapturingBoundNetLog(size_t max_num_entries) - : capturing_net_log_(new CapturingNetLog(max_num_entries)) {} + ~CapturingBoundNetLog(); // The returned BoundNetLog is only valid while |this| is alive. BoundNetLog bound() const { diff --git a/net/base/cert_database.cc b/net/base/cert_database.cc index 961638c..313a6dd0 100644 --- a/net/base/cert_database.cc +++ b/net/base/cert_database.cc @@ -13,4 +13,7 @@ CertDatabase::ImportCertFailure::ImportCertFailure( : certificate(cert), net_error(err) { } +CertDatabase::ImportCertFailure::~ImportCertFailure() { +} + } // namespace net diff --git a/net/base/cert_database.h b/net/base/cert_database.h index 5d7673f..295bddd 100644 --- a/net/base/cert_database.h +++ b/net/base/cert_database.h @@ -65,6 +65,7 @@ class CertDatabase { struct ImportCertFailure { public: ImportCertFailure(X509Certificate* cert, int err); + ~ImportCertFailure(); scoped_refptr<X509Certificate> certificate; int net_error; diff --git a/net/base/cookie_monster.cc b/net/base/cookie_monster.cc index a75420f..82d35b1 100644 --- a/net/base/cookie_monster.cc +++ b/net/base/cookie_monster.cc @@ -1531,6 +1531,9 @@ CookieMonster::ParsedCookie::ParsedCookie(const std::string& cookie_line) } } +CookieMonster::ParsedCookie::~ParsedCookie() { +} + // Returns true if |c| occurs in |chars| // TODO maybe make this take an iterator, could check for end also? static inline bool CharIsA(const char c, const char* chars) { diff --git a/net/base/cookie_monster.h b/net/base/cookie_monster.h index 80535c2..33953d9 100644 --- a/net/base/cookie_monster.h +++ b/net/base/cookie_monster.h @@ -585,7 +585,7 @@ class CookieMonster::ParsedCookie { // Construct from a cookie string like "BLAH=1; path=/; domain=.google.com" ParsedCookie(const std::string& cookie_line); - ~ParsedCookie() { } + ~ParsedCookie(); // You should not call any other methods on the class if !IsValid bool IsValid() const { return is_valid_; } diff --git a/net/base/cookie_store.cc b/net/base/cookie_store.cc new file mode 100644 index 0000000..4891fdf --- /dev/null +++ b/net/base/cookie_store.cc @@ -0,0 +1,36 @@ +// Copyright (c) 2010 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 "net/base/cookie_store.h" + +#include "net/base/cookie_options.h" + +namespace net { + +bool CookieStore::SetCookie(const GURL& url, const std::string& cookie_line) { + return SetCookieWithOptions(url, cookie_line, CookieOptions()); +} + +std::string CookieStore::GetCookies(const GURL& url) { + return GetCookiesWithOptions(url, CookieOptions()); +} + +void CookieStore::SetCookiesWithOptions( + const GURL& url, + const std::vector<std::string>& cookie_lines, + const CookieOptions& options) { + for (size_t i = 0; i < cookie_lines.size(); ++i) + SetCookieWithOptions(url, cookie_lines[i], options); +} + +void CookieStore::SetCookies(const GURL& url, + const std::vector<std::string>& cookie_lines) { + SetCookiesWithOptions(url, cookie_lines, CookieOptions()); +} + +CookieStore::CookieStore() {} + +CookieStore::~CookieStore() {} + +} // namespace net diff --git a/net/base/cookie_store.h b/net/base/cookie_store.h index 2360c96..3976169 100644 --- a/net/base/cookie_store.h +++ b/net/base/cookie_store.h @@ -50,30 +50,22 @@ class CookieStore : public base::RefCountedThreadSafe<CookieStore> { // Helpers to make the above interface simpler for some cases. // Sets a cookie for the given URL using default options. - bool SetCookie(const GURL& url, const std::string& cookie_line) { - return SetCookieWithOptions(url, cookie_line, CookieOptions()); - } + bool SetCookie(const GURL& url, const std::string& cookie_line); // Gets cookies for the given URL using default options. - std::string GetCookies(const GURL& url) { - return GetCookiesWithOptions(url, CookieOptions()); - } + std::string GetCookies(const GURL& url); // Sets a vector of response cookie values for the same URL. void SetCookiesWithOptions(const GURL& url, const std::vector<std::string>& cookie_lines, - const CookieOptions& options) { - for (size_t i = 0; i < cookie_lines.size(); ++i) - SetCookieWithOptions(url, cookie_lines[i], options); - } + const CookieOptions& options); void SetCookies(const GURL& url, - const std::vector<std::string>& cookie_lines) { - SetCookiesWithOptions(url, cookie_lines, CookieOptions()); - } + const std::vector<std::string>& cookie_lines); protected: friend class base::RefCountedThreadSafe<CookieStore>; - virtual ~CookieStore() {} + CookieStore(); + virtual ~CookieStore(); }; } // namespace net diff --git a/net/base/mock_host_resolver.cc b/net/base/mock_host_resolver.cc index a70c6aa..9c82f93 100644 --- a/net/base/mock_host_resolver.cc +++ b/net/base/mock_host_resolver.cc @@ -50,6 +50,8 @@ MockHostResolverBase::MockHostResolverBase(bool use_caching) Reset(NULL); } +MockHostResolverBase::~MockHostResolverBase() {} + int MockHostResolverBase::Resolve(const RequestInfo& info, AddressList* addresses, CompletionCallback* callback, @@ -258,6 +260,29 @@ int RuleBasedHostResolverProc::Resolve(const std::string& host, //----------------------------------------------------------------------------- +WaitingHostResolverProc::WaitingHostResolverProc(HostResolverProc* previous) + : HostResolverProc(previous), event_(false, false) {} + +void WaitingHostResolverProc::Signal() { + event_.Signal(); +} + +int WaitingHostResolverProc::Resolve(const std::string& host, + AddressFamily address_family, + HostResolverFlags host_resolver_flags, + AddressList* addrlist, + int* os_error) { + event_.Wait(); + return ResolveUsingPrevious(host, address_family, host_resolver_flags, + addrlist, os_error); +} + +WaitingHostResolverProc::~WaitingHostResolverProc() {} + +//----------------------------------------------------------------------------- + +ScopedDefaultHostResolverProc::ScopedDefaultHostResolverProc() {} + ScopedDefaultHostResolverProc::ScopedDefaultHostResolverProc( HostResolverProc* proc) { Init(proc); diff --git a/net/base/mock_host_resolver.h b/net/base/mock_host_resolver.h index f158b9f..3c273a7 100644 --- a/net/base/mock_host_resolver.h +++ b/net/base/mock_host_resolver.h @@ -39,7 +39,7 @@ class RuleBasedHostResolverProc; // Base class shared by MockHostResolver and MockCachingHostResolver. class MockHostResolverBase : public HostResolver { public: - virtual ~MockHostResolverBase() {} + virtual ~MockHostResolverBase(); // HostResolver methods: virtual int Resolve(const RequestInfo& info, @@ -154,26 +154,19 @@ class RuleBasedHostResolverProc : public HostResolverProc { // Using WaitingHostResolverProc you can simulate very long lookups. class WaitingHostResolverProc : public HostResolverProc { public: - explicit WaitingHostResolverProc(HostResolverProc* previous) - : HostResolverProc(previous), event_(false, false) {} + explicit WaitingHostResolverProc(HostResolverProc* previous); - void Signal() { - event_.Signal(); - } + void Signal(); // HostResolverProc methods: virtual int Resolve(const std::string& host, AddressFamily address_family, HostResolverFlags host_resolver_flags, AddressList* addrlist, - int* os_error) { - event_.Wait(); - return ResolveUsingPrevious(host, address_family, host_resolver_flags, - addrlist, os_error); - } + int* os_error); private: - ~WaitingHostResolverProc() {} + virtual ~WaitingHostResolverProc(); base::WaitableEvent event_; }; @@ -189,7 +182,7 @@ class WaitingHostResolverProc : public HostResolverProc { // MockHostResolver. class ScopedDefaultHostResolverProc { public: - ScopedDefaultHostResolverProc() {} + ScopedDefaultHostResolverProc(); explicit ScopedDefaultHostResolverProc(HostResolverProc* proc); ~ScopedDefaultHostResolverProc(); diff --git a/net/base/ssl_config_service.cc b/net/base/ssl_config_service.cc index fc35f5d..b349a76 100644 --- a/net/base/ssl_config_service.cc +++ b/net/base/ssl_config_service.cc @@ -15,6 +15,10 @@ namespace net { +SSLConfig::CertAndStatus::CertAndStatus() {} + +SSLConfig::CertAndStatus::~CertAndStatus() {} + SSLConfig::SSLConfig() : rev_checking_enabled(true), ssl2_enabled(false), ssl3_enabled(true), tls1_enabled(true), dnssec_enabled(false), snap_start_enabled(false), diff --git a/net/base/ssl_config_service.h b/net/base/ssl_config_service.h index 5eb2397..45c5392 100644 --- a/net/base/ssl_config_service.h +++ b/net/base/ssl_config_service.h @@ -44,6 +44,9 @@ struct SSLConfig { // are not SSL configuration settings. struct CertAndStatus { + CertAndStatus(); + ~CertAndStatus(); + scoped_refptr<X509Certificate> cert; int cert_status; }; diff --git a/net/base/x509_certificate.h b/net/base/x509_certificate.h index ec5105a..5a9e897 100644 --- a/net/base/x509_certificate.h +++ b/net/base/x509_certificate.h @@ -55,8 +55,7 @@ class X509Certificate : public base::RefCountedThreadSafe<X509Certificate> { typedef std::vector<OSCertHandle> OSCertHandles; // Predicate functor used in maps when X509Certificate is used as the key. - class LessThan - : public std::binary_function<X509Certificate*, X509Certificate*, bool> { + class LessThan { public: bool operator() (X509Certificate* lhs, X509Certificate* rhs) const; }; diff --git a/net/http/http_request_info.cc b/net/http/http_request_info.cc new file mode 100644 index 0000000..8ab3096 --- /dev/null +++ b/net/http/http_request_info.cc @@ -0,0 +1,17 @@ +// Copyright (c) 2010 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 "net/http/http_request_info.h" + +namespace net { + +HttpRequestInfo::HttpRequestInfo() + : load_flags(0), + priority(LOWEST), + motivation(NORMAL_MOTIVATION) { +} + +HttpRequestInfo::~HttpRequestInfo() {} + +} // namespace net diff --git a/net/http/http_request_info.h b/net/http/http_request_info.h index 3c072c0..f740d7c 100644 --- a/net/http/http_request_info.h +++ b/net/http/http_request_info.h @@ -16,7 +16,6 @@ namespace net { struct HttpRequestInfo { - public: enum RequestMotivation{ // TODO(mbelshe): move these into Client Socket. PRECONNECT_MOTIVATED, // This request was motivated by a prefetch. @@ -24,11 +23,8 @@ struct HttpRequestInfo { NORMAL_MOTIVATION // No special motivation associated with the request. }; - HttpRequestInfo() - : load_flags(0), - priority(LOWEST), - motivation(NORMAL_MOTIVATION) { - } + HttpRequestInfo(); + ~HttpRequestInfo(); // The requested URL. GURL url; diff --git a/net/net.gyp b/net/net.gyp index 1ce4608..02e1bcd 100644 --- a/net/net.gyp +++ b/net/net.gyp @@ -49,6 +49,7 @@ 'base/cookie_monster.h', 'base/cookie_options.h', 'base/cookie_policy.h', + 'base/cookie_store.cc', 'base/cookie_store.h', 'base/data_url.cc', 'base/data_url.h', @@ -432,6 +433,7 @@ 'http/http_network_transaction.h', 'http/http_request_headers.cc', 'http/http_request_headers.h', + 'http/http_request_info.cc', 'http/http_request_info.h', 'http/http_response_body_drainer.cc', 'http/http_response_body_drainer.h', diff --git a/net/server/http_server_request_info.h b/net/server/http_server_request_info.h index 9c362e2..63abab5 100644 --- a/net/server/http_server_request_info.h +++ b/net/server/http_server_request_info.h @@ -9,8 +9,6 @@ #include <string> #include <map> -#include "net/http/http_request_info.h" - // Meta information about an HTTP request. // This is geared toward servers in that it keeps a map of the headers and // values rather than just a list of header strings (which net::HttpRequestInfo diff --git a/net/socket/client_socket_pool_histograms.h b/net/socket/client_socket_pool_histograms.h index 9c12e5d..41aad57 100644 --- a/net/socket/client_socket_pool_histograms.h +++ b/net/socket/client_socket_pool_histograms.h @@ -8,8 +8,8 @@ #include <string> -#include "base/ref_counted.h" #include "base/time.h" +#include "base/ref_counted.h" class Histogram; diff --git a/net/socket_stream/socket_stream_job.cc b/net/socket_stream/socket_stream_job.cc index c8849a5..0913015 100644 --- a/net/socket_stream/socket_stream_job.cc +++ b/net/socket_stream/socket_stream_job.cc @@ -24,4 +24,38 @@ SocketStreamJob* SocketStreamJob::CreateSocketStreamJob( return GetJobManager()->CreateJob(url, delegate); } +SocketStreamJob::SocketStreamJob() {} + +SocketStream::UserData* SocketStreamJob::GetUserData(const void* key) const { + return socket_->GetUserData(key); +} + +void SocketStreamJob::SetUserData(const void* key, + SocketStream::UserData* data) { + socket_->SetUserData(key, data); +} + +void SocketStreamJob::Connect() { + socket_->Connect(); +} + +bool SocketStreamJob::SendData(const char* data, int len) { + return socket_->SendData(data, len); +} + +void SocketStreamJob::Close() { + socket_->Close(); +} + +void SocketStreamJob::RestartWithAuth(const string16& username, + const string16& password) { + socket_->RestartWithAuth(username, password); +} + +void SocketStreamJob::DetachDelegate() { + socket_->DetachDelegate(); +} + +SocketStreamJob::~SocketStreamJob() {} + } // namespace net diff --git a/net/socket_stream/socket_stream_job.h b/net/socket_stream/socket_stream_job.h index 89e0c36..a301709 100644 --- a/net/socket_stream/socket_stream_job.h +++ b/net/socket_stream/socket_stream_job.h @@ -34,17 +34,13 @@ class SocketStreamJob : public base::RefCountedThreadSafe<SocketStreamJob> { static SocketStreamJob* CreateSocketStreamJob( const GURL& url, SocketStream::Delegate* delegate); - SocketStreamJob() {} + SocketStreamJob(); void InitSocketStream(SocketStream* socket) { socket_ = socket; } - virtual SocketStream::UserData *GetUserData(const void* key) const { - return socket_->GetUserData(key); - } - virtual void SetUserData(const void* key, SocketStream::UserData* data) { - socket_->SetUserData(key, data); - } + virtual SocketStream::UserData* GetUserData(const void* key) const; + virtual void SetUserData(const void* key, SocketStream::UserData* data); URLRequestContext* context() const { return socket_->context(); @@ -53,31 +49,20 @@ class SocketStreamJob : public base::RefCountedThreadSafe<SocketStreamJob> { socket_->set_context(context); } - virtual void Connect() { - socket_->Connect(); - } + virtual void Connect(); - virtual bool SendData(const char* data, int len) { - return socket_->SendData(data, len); - } + virtual bool SendData(const char* data, int len); - virtual void Close() { - socket_->Close(); - } + virtual void Close(); - virtual void RestartWithAuth( - const string16& username, - const string16& password) { - socket_->RestartWithAuth(username, password); - } + virtual void RestartWithAuth(const string16& username, + const string16& password); - virtual void DetachDelegate() { - socket_->DetachDelegate(); - } + virtual void DetachDelegate(); protected: friend class base::RefCountedThreadSafe<SocketStreamJob>; - virtual ~SocketStreamJob() {} + virtual ~SocketStreamJob(); scoped_refptr<SocketStream> socket_; diff --git a/printing/image.cc b/printing/image.cc index 21ffd99..efa645d 100644 --- a/printing/image.cc +++ b/printing/image.cc @@ -93,6 +93,8 @@ Image::Image(const Image& image) ignore_alpha_(image.ignore_alpha_) { } +Image::~Image() {} + std::string Image::checksum() const { MD5Digest digest; MD5Sum(&data_[0], data_.size(), &digest); diff --git a/printing/image.h b/printing/image.h index 5f4746d..d10c61b 100644 --- a/printing/image.h +++ b/printing/image.h @@ -33,6 +33,8 @@ class Image { // Copy constructor. explicit Image(const Image& image); + ~Image(); + const gfx::Size& size() const { return size_; } diff --git a/remoting/base/capture_data.cc b/remoting/base/capture_data.cc new file mode 100644 index 0000000..2d96441 --- /dev/null +++ b/remoting/base/capture_data.cc @@ -0,0 +1,26 @@ +// Copyright (c) 2010 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 "remoting/base/capture_data.h" + +namespace remoting { + +DataPlanes::DataPlanes() { + for (int i = 0; i < kPlaneCount; ++i) { + data[i] = NULL; + strides[i] = 0; + } +} + +CaptureData::CaptureData(const DataPlanes &data_planes, + int width, + int height, + PixelFormat format) : + data_planes_(data_planes), dirty_rects_(), + width_(width), height_(height), pixel_format_(format) { +} + +CaptureData::~CaptureData() {} + +} // namespace remoting diff --git a/remoting/base/capture_data.h b/remoting/base/capture_data.h index b06dfa4..e99aa38 100644 --- a/remoting/base/capture_data.h +++ b/remoting/base/capture_data.h @@ -15,16 +15,11 @@ namespace remoting { struct DataPlanes { + DataPlanes(); + static const int kPlaneCount = 3; uint8* data[kPlaneCount]; int strides[kPlaneCount]; - - DataPlanes() { - for (int i = 0; i < kPlaneCount; ++i) { - data[i] = NULL; - strides[i] = 0; - } - } }; // Stores the data and information of a capture to pass off to the @@ -34,9 +29,7 @@ class CaptureData : public base::RefCountedThreadSafe<CaptureData> { CaptureData(const DataPlanes &data_planes, int width, int height, - PixelFormat format) : - data_planes_(data_planes), dirty_rects_(), - width_(width), height_(height), pixel_format_(format) { } + PixelFormat format); // Get the data_planes data of the last capture. const DataPlanes& data_planes() const { return data_planes_; } @@ -65,7 +58,7 @@ class CaptureData : public base::RefCountedThreadSafe<CaptureData> { PixelFormat pixel_format_; friend class base::RefCountedThreadSafe<CaptureData>; - ~CaptureData() {} + virtual ~CaptureData(); }; } // namespace remoting diff --git a/remoting/base/protocol_decoder.cc b/remoting/base/protocol_decoder.cc index 5900637..10d2413 100644 --- a/remoting/base/protocol_decoder.cc +++ b/remoting/base/protocol_decoder.cc @@ -17,6 +17,8 @@ ProtocolDecoder::ProtocolDecoder() next_payload_known_(false) { } +ProtocolDecoder::~ProtocolDecoder() {} + void ProtocolDecoder::ParseClientMessages(scoped_refptr<media::DataBuffer> data, ClientMessageList* messages) { ParseMessages<ChromotingClientMessage>(data, messages); diff --git a/remoting/base/protocol_decoder.h b/remoting/base/protocol_decoder.h index 392d9b3..fed196f 100644 --- a/remoting/base/protocol_decoder.h +++ b/remoting/base/protocol_decoder.h @@ -25,7 +25,7 @@ class ProtocolDecoder { public: ProtocolDecoder(); - virtual ~ProtocolDecoder() {} + virtual ~ProtocolDecoder(); // Parse data received from network into ClientMessages. Ownership of |data| // is passed to this object and output is written to |messages|. diff --git a/remoting/client/chromoting_view.cc b/remoting/client/chromoting_view.cc index ba34a5d..5df85b67 100644 --- a/remoting/client/chromoting_view.cc +++ b/remoting/client/chromoting_view.cc @@ -15,6 +15,8 @@ ChromotingView::ChromotingView() frame_height_(0) { } +ChromotingView::~ChromotingView() {} + // TODO(garykac): This assumes a single screen. This will need to be adjusted // to add support for mulitple monitors. void ChromotingView::GetScreenSize(int* width, int* height) { diff --git a/remoting/client/chromoting_view.h b/remoting/client/chromoting_view.h index d1c978b..faf4f68 100644 --- a/remoting/client/chromoting_view.h +++ b/remoting/client/chromoting_view.h @@ -22,7 +22,7 @@ namespace remoting { class ChromotingView { public: ChromotingView(); - virtual ~ChromotingView() {} + virtual ~ChromotingView(); // Get screen dimensions. // TODO(garykac): This will need to be extended to support multi-monitors. diff --git a/remoting/jingle_glue/jingle_info_task.cc b/remoting/jingle_glue/jingle_info_task.cc index ca10e6a..309caf0 100644 --- a/remoting/jingle_glue/jingle_info_task.cc +++ b/remoting/jingle_glue/jingle_info_task.cc @@ -62,6 +62,12 @@ class JingleInfoTask::JingleInfoGetTask : public XmppTask { }; +JingleInfoTask::JingleInfoTask(talk_base::TaskParent* parent) + : XmppTask(parent, buzz::XmppEngine::HL_TYPE) { +} + +JingleInfoTask::~JingleInfoTask() {} + void JingleInfoTask::RefreshJingleInfoNow() { JingleInfoGetTask* get_task = new JingleInfoGetTask(this); get_task->Start(); diff --git a/remoting/jingle_glue/jingle_info_task.h b/remoting/jingle_glue/jingle_info_task.h index 361b27a..cfd8a5e 100644 --- a/remoting/jingle_glue/jingle_info_task.h +++ b/remoting/jingle_glue/jingle_info_task.h @@ -22,9 +22,8 @@ namespace remoting { // This is a copy of googleclient/talk/app/jingleinfotask.h . class JingleInfoTask : public buzz::XmppTask { public: - explicit JingleInfoTask(talk_base::TaskParent* parent) - : XmppTask(parent, buzz::XmppEngine::HL_TYPE) { - } + explicit JingleInfoTask(talk_base::TaskParent* parent); + virtual ~JingleInfoTask(); virtual int ProcessStart(); void RefreshJingleInfoNow(); diff --git a/remoting/remoting.gyp b/remoting/remoting.gyp index 61de2f3..716b3e2 100644 --- a/remoting/remoting.gyp +++ b/remoting/remoting.gyp @@ -128,6 +128,7 @@ # depend on chromotocol_proto_lib for headers. 'hard_dependency': 1, 'sources': [ + 'base/capture_data.cc', 'base/capture_data.h', 'base/compressor.h', 'base/compressor_zlib.cc', |