Skip to content

Commit

Permalink
[Sync] Fixing lint violations in src/sync/internal_api/*
Browse files Browse the repository at this point in the history
BUG=567301

Review URL: https://codereview.chromium.org/1503263002

Cr-Commit-Position: refs/heads/master@{#364594}
  • Loading branch information
skym authored and Commit bot committed Dec 11, 2015
1 parent a7dd944 commit 81977ac
Show file tree
Hide file tree
Showing 84 changed files with 213 additions and 137 deletions.
2 changes: 2 additions & 0 deletions sync/internal_api/attachments/attachment_downloader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "sync/internal_api/public/attachments/attachment_downloader.h"

#include <string>

#include "sync/internal_api/public/attachments/attachment_downloader_impl.h"

namespace syncer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "sync/internal_api/public/attachments/attachment_downloader_impl.h"

#include <map>

#include "base/bind.h"
#include "base/memory/weak_ptr.h"
#include "base/message_loop/message_loop.h"
Expand Down Expand Up @@ -106,7 +108,7 @@ class TokenServiceProvider
: public OAuth2TokenServiceRequest::TokenServiceProvider,
base::NonThreadSafe {
public:
TokenServiceProvider(OAuth2TokenService* token_service);
explicit TokenServiceProvider(OAuth2TokenService* token_service);

// OAuth2TokenService::TokenServiceProvider implementation.
scoped_refptr<base::SingleThreadTaskRunner> GetTokenServiceTaskRunner()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

#include "sync/internal_api/public/attachments/attachment_service_impl.h"

#include <algorithm>
#include <map>
#include <utility>
#include <vector>

#include "base/bind.h"
#include "base/memory/weak_ptr.h"
#include "base/message_loop/message_loop.h"
Expand Down Expand Up @@ -156,6 +161,7 @@ class MockAttachmentDownloader

std::map<AttachmentId, DownloadCallback> download_requests;

private:
DISALLOW_COPY_AND_ASSIGN(MockAttachmentDownloader);
};

Expand All @@ -182,6 +188,7 @@ class MockAttachmentUploader

std::map<AttachmentId, UploadCallback> upload_requests;

private:
DISALLOW_COPY_AND_ASSIGN(MockAttachmentUploader);
};

Expand Down
3 changes: 3 additions & 0 deletions sync/internal_api/attachments/attachment_uploader_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

#include "sync/internal_api/public/attachments/attachment_uploader_impl.h"

#include <string>
#include <vector>

#include "base/base64.h"
#include "base/base64url.h"
#include "base/bind.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

#include "sync/internal_api/public/attachments/attachment_uploader_impl.h"

#include <string>
#include <vector>

#include "base/bind.h"
#include "base/callback.h"
#include "base/memory/ref_counted.h"
Expand Down Expand Up @@ -149,7 +152,7 @@ class TokenServiceProvider
: public OAuth2TokenServiceRequest::TokenServiceProvider,
base::NonThreadSafe {
public:
TokenServiceProvider(OAuth2TokenService* token_service);
explicit TokenServiceProvider(OAuth2TokenService* token_service);

// OAuth2TokenService::TokenServiceProvider implementation.
scoped_refptr<base::SingleThreadTaskRunner> GetTokenServiceTaskRunner()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "sync/internal_api/public/attachments/fake_attachment_downloader.h"

#include <vector>

#include "base/bind.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
Expand Down
4 changes: 2 additions & 2 deletions sync/internal_api/attachments/in_memory_attachment_store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ void InMemoryAttachmentStore::ReadMetadataById(
result_code = AttachmentStore::UNSPECIFIED_ERROR;
continue;
}
DCHECK(iter->second.components.size() > 0);
DCHECK_GT(iter->second.components.size(), 0u);
if (iter->second.components.count(component) == 0) {
result_code = AttachmentStore::UNSPECIFIED_ERROR;
continue;
Expand All @@ -141,7 +141,7 @@ void InMemoryAttachmentStore::ReadMetadata(

for (AttachmentEntryMap::const_iterator iter = attachments_.begin();
iter != attachments_.end(); ++iter) {
DCHECK(iter->second.components.size() > 0);
DCHECK_GT(iter->second.components.size(), 0u);
if (iter->second.components.count(component) > 0) {
AppendMetadata(metadata_list.get(), iter->second.attachment);
}
Expand Down
6 changes: 4 additions & 2 deletions sync/internal_api/attachments/on_disk_attachment_store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "sync/internal_api/public/attachments/on_disk_attachment_store.h"

#include <string>

#include "base/bind.h"
#include "base/callback.h"
#include "base/location.h"
Expand Down Expand Up @@ -334,7 +336,7 @@ void OnDiskAttachmentStore::ReadMetadata(
result_code = AttachmentStore::UNSPECIFIED_ERROR;
continue;
}
DCHECK(record_metadata.component_size() > 0);
DCHECK_GT(record_metadata.component_size(), 0);
if (AttachmentHasReferenceFromComponent(record_metadata, proto_component))
metadata_list->push_back(MakeAttachmentMetadata(id, record_metadata));
}
Expand Down Expand Up @@ -496,7 +498,7 @@ bool OnDiskAttachmentStore::ReadSingleRecordMetadata(
DVLOG(1) << "RecordMetadata::ParseFromString failed";
return false;
}
DCHECK(record_metadata->component_size() > 0);
DCHECK_GT(record_metadata->component_size(), 0);
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "sync/internal_api/public/attachments/on_disk_attachment_store.h"

#include <string>

#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
Expand Down
2 changes: 2 additions & 0 deletions sync/internal_api/change_record.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "sync/internal_api/public/change_record.h"

#include <string>

#include "base/strings/string_number_conversions.h"
#include "base/values.h"
#include "sync/internal_api/public/base_node.h"
Expand Down
3 changes: 3 additions & 0 deletions sync/internal_api/delete_journal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

#include "sync/internal_api/public/delete_journal.h"

#include <set>
#include <string>

#include "sync/internal_api/public/base_transaction.h"
#include "sync/syncable/directory.h"
#include "sync/syncable/syncable_base_transaction.h"
Expand Down
10 changes: 5 additions & 5 deletions sync/internal_api/events/commit_request_event.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ namespace syncer {
CommitRequestEvent::CommitRequestEvent(
base::Time timestamp,
size_t num_items,
ModelTypeSet contributing_types_,
ModelTypeSet contributing_types,
const sync_pb::ClientToServerMessage& request)
: timestamp_(timestamp),
num_items_(num_items),
contributing_types_(contributing_types_),
request_(request) {}
: timestamp_(timestamp),
num_items_(num_items),
contributing_types_(contributing_types),
request_(request) {}

CommitRequestEvent::~CommitRequestEvent() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@ NormalGetUpdatesRequestEvent::NormalGetUpdatesRequestEvent(
is_retry_(is_retry),
request_(request) {}

} // namespace
} // namespace syncer
2 changes: 1 addition & 1 deletion sync/internal_api/events/poll_get_updates_request_event.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ scoped_ptr<ProtocolEvent> PollGetUpdatesRequestEvent::Clone() const {
request_));
}

} // namespace
} // namespace syncer
2 changes: 2 additions & 0 deletions sync/internal_api/http_bridge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "sync/internal_api/public/http_bridge.h"

#include <vector>

#include "base/message_loop/message_loop.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram_macros.h"
Expand Down
13 changes: 7 additions & 6 deletions sync/internal_api/http_bridge_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ class ShuntedHttpBridge : public HttpBridge {
test_->GetIOThreadLoop()->PostTask(FROM_HERE,
base::Bind(&ShuntedHttpBridge::CallOnURLFetchComplete, this));
}

private:
~ShuntedHttpBridge() override {}

Expand Down Expand Up @@ -619,11 +620,11 @@ TEST_F(MAYBE_SyncHttpBridgeTest, RequestContextGetterReleaseOrder) {

// Create bridge factory and factory on sync thread and wait for the creation
// to finish.
sync_thread.message_loop()->PostTask(FROM_HERE,
base::Bind(&HttpBridgeRunOnSyncThread,
base::Unretained(baseline_context_getter.get()),
&release_request_context_signal ,&factory, &bridge,
&signal_when_created, &wait_for_shutdown));
sync_thread.message_loop()->PostTask(
FROM_HERE, base::Bind(&HttpBridgeRunOnSyncThread,
base::Unretained(baseline_context_getter.get()),
&release_request_context_signal, &factory, &bridge,
&signal_when_created, &wait_for_shutdown));
signal_when_created.Wait();

// Simulate sync shutdown by aborting bridge and shutting down factory on
Expand Down Expand Up @@ -680,6 +681,6 @@ TEST_F(MAYBE_SyncHttpBridgeTest, EarlyAbortFactory) {

// At this point, attempting to use the factory would trigger a crash. Both
// this test and the real world code should make sure this never happens.
};
}

} // namespace syncer
3 changes: 3 additions & 0 deletions sync/internal_api/internal_components_factory_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

#include "sync/internal_api/public/internal_components_factory_impl.h"

#include <string>
#include <vector>

#include "sync/engine/backoff_delay_provider.h"
#include "sync/engine/syncer.h"
#include "sync/engine/sync_scheduler_impl.h"
Expand Down
2 changes: 2 additions & 0 deletions sync/internal_api/js_sync_manager_observer_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "sync/internal_api/js_sync_manager_observer.h"

#include <vector>

#include "base/basictypes.h"
#include "base/location.h"
#include "base/run_loop.h"
Expand Down
1 change: 0 additions & 1 deletion sync/internal_api/protocol_event_buffer_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ TEST_F(ProtocolEventBufferTest, AddThenOverflowThenReturnEvents) {
EXPECT_TRUE(
HasId(*(buffered_events[i-1]), static_cast<int64>(i)));
}

}


Expand Down
2 changes: 2 additions & 0 deletions sync/internal_api/public/attachments/attachment_downloader.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_DOWNLOADER_H_
#define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_DOWNLOADER_H_

#include <string>

#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
#include "google_apis/gaia/oauth2_token_service_request.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class SYNC_EXPORT AttachmentServiceProxy : public AttachmentService {
public base::RefCountedThreadSafe<Core> {
public:
// Construct an AttachmentServiceProxyCore that forwards calls to |wrapped|.
Core(const base::WeakPtr<syncer::AttachmentService>& wrapped);
explicit Core(const base::WeakPtr<syncer::AttachmentService>& wrapped);

// AttachmentService implementation.
void GetOrDownloadAttachments(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_UPLOADER_IMPL_H_
#define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_UPLOADER_IMPL_H_

#include <string>

#include "base/containers/scoped_ptr_hash_map.h"
#include "base/threading/non_thread_safe.h"
#include "google_apis/gaia/oauth2_token_service_request.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
#ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_IN_MEMORY_ATTACHMENT_STORE_H_
#define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_IN_MEMORY_ATTACHMENT_STORE_H_

#include <map>
#include <set>

#include "base/memory/ref_counted.h"
#include "base/threading/non_thread_safe.h"
#include "sync/api/attachments/attachment.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ON_DISK_ATTACHMENT_STORE_H_
#define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ON_DISK_ATTACHMENT_STORE_H_

#include <string>

#include "base/files/file_path.h"
#include "base/memory/ref_counted.h"
#include "base/threading/non_thread_safe.h"
Expand Down
2 changes: 2 additions & 0 deletions sync/internal_api/public/base/attachment_id_proto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "sync/internal_api/public/base/attachment_id_proto.h"

#include <string>

#include "base/guid.h"
#include "base/logging.h"
#include "base/strings/string_util.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace syncer {

class BlockingTask : public CancelationObserver {
public:
BlockingTask(CancelationSignal* cancel_signal);
explicit BlockingTask(CancelationSignal* cancel_signal);
~BlockingTask() override;

// Starts the |exec_thread_| and uses it to execute DoRun().
Expand Down
2 changes: 1 addition & 1 deletion sync/internal_api/public/base/invalidation_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ class SYNC_EXPORT InvalidationInterface {

} // namespace syncer

#endif
#endif // SYNC_INTERNAL_API_PUBLIC_BASE_INVALIDATION_INTERFACE_H_
6 changes: 3 additions & 3 deletions sync/internal_api/public/base/model_type_test_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef SYNC_INTERNAL_PUBLIC_API_BASE_MODEL_TYPE_TEST_UTIL_H_
#define SYNC_INTERNAL_PUBLIC_API_BASE_MODEL_TYPE_TEST_UTIL_H_
#ifndef SYNC_INTERNAL_API_PUBLIC_BASE_MODEL_TYPE_TEST_UTIL_H_
#define SYNC_INTERNAL_API_PUBLIC_BASE_MODEL_TYPE_TEST_UTIL_H_

#include <ostream>

Expand All @@ -22,4 +22,4 @@ ::testing::Matcher<ModelTypeSet> HasModelTypes(ModelTypeSet expected_types);

} // namespace syncer

#endif // SYNC_INTERNAL_PUBLIC_API_BASE_MODEL_TYPE_TEST_UTIL_H_
#endif // SYNC_INTERNAL_API_PUBLIC_BASE_MODEL_TYPE_TEST_UTIL_H_
1 change: 1 addition & 0 deletions sync/internal_api/public/base/node_ordinal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "sync/internal_api/public/base/node_ordinal.h"

#include <algorithm>
#include <string>

namespace syncer {

Expand Down
4 changes: 3 additions & 1 deletion sync/internal_api/public/base/node_ordinal_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

#include <algorithm>
#include <cstddef>
#include <functional>
#include <limits>
#include <vector>

#include "testing/gtest/include/gtest/gtest.h"

Expand Down Expand Up @@ -100,7 +102,7 @@ TEST(NodeOrdinalTest, PositionToOrdinalToPosition) {
template <typename T, typename LessThan = std::less<T> >
class IndexedLessThan {
public:
IndexedLessThan(const T* values) : values_(values) {}
explicit IndexedLessThan(const T* values) : values_(values) {}

bool operator()(int i1, int i2) {
return less_than_(values_[i1], values_[i2]);
Expand Down
2 changes: 1 addition & 1 deletion sync/internal_api/public/base/ordinal_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ TEST(Ordinal, EqualsFn) {
EXPECT_FALSE(equals(ordinal1, ordinal2));

EXPECT_FALSE(equals(ordinal2, ordinal1));
EXPECT_TRUE(equals(ordinal2,ordinal2));
EXPECT_TRUE(equals(ordinal2, ordinal2));
}

// Create some Ordinals and shuffle them. Sorting them using
Expand Down
2 changes: 1 addition & 1 deletion sync/internal_api/public/base/progress_marker_map.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ scoped_ptr<base::DictionaryValue> ProgressMarkerMapToValue(
return value.Pass();
}

} // namespace syncer
} // namespace syncer
Loading

0 comments on commit 81977ac

Please sign in to comment.