diff options
Diffstat (limited to 'chrome')
41 files changed, 366 insertions, 116 deletions
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(); |