Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: components/sync/core_impl/attachments/attachment_uploader_impl.cc

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/sync/core_impl/attachments/attachment_uploader_impl.cc
diff --git a/sync/internal_api/attachments/attachment_uploader_impl.cc b/components/sync/core_impl/attachments/attachment_uploader_impl.cc
similarity index 95%
rename from sync/internal_api/attachments/attachment_uploader_impl.cc
rename to components/sync/core_impl/attachments/attachment_uploader_impl.cc
index 6666f5cb31a816c1245adbec6fff5ba28bffb8e1..3647cf4e560edf762e7013b9e941fe9a598615a4 100644
--- a/sync/internal_api/attachments/attachment_uploader_impl.cc
+++ b/components/sync/core_impl/attachments/attachment_uploader_impl.cc
@@ -2,9 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "sync/internal_api/public/attachments/attachment_uploader_impl.h"
+#include "components/sync/core/attachments/attachment_uploader_impl.h"
#include <stdint.h>
+
#include <string>
#include <utility>
#include <vector>
@@ -22,14 +23,14 @@
#include "base/sys_byteorder.h"
#include "base/threading/non_thread_safe.h"
#include "base/threading/thread_task_runner_handle.h"
+#include "components/sync/api/attachments/attachment.h"
+#include "components/sync/protocol/sync.pb.h"
#include "google_apis/gaia/gaia_constants.h"
#include "net/base/load_flags.h"
#include "net/http/http_status_code.h"
#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_fetcher_delegate.h"
#include "net/url_request/url_request_status.h"
-#include "sync/api/attachments/attachment.h"
-#include "sync/protocol/sync.pb.h"
namespace {
@@ -155,8 +156,7 @@ AttachmentUploaderImpl::UploadState::UploadState(
GetToken();
}
-AttachmentUploaderImpl::UploadState::~UploadState() {
-}
+AttachmentUploaderImpl::UploadState::~UploadState() {}
bool AttachmentUploaderImpl::UploadState::IsStopped() const {
DCHECK(CalledOnValidThread());
@@ -186,7 +186,8 @@ void AttachmentUploaderImpl::UploadState::OnURLFetchComplete(
AttachmentId attachment_id = attachment_.GetId();
net::URLRequestStatus status = source->GetStatus();
const int response_code = source->GetResponseCode();
- UMA_HISTOGRAM_SPARSE_SLOWLY("Sync.Attachments.UploadResponseCode",
+ UMA_HISTOGRAM_SPARSE_SLOWLY(
+ "Sync.Attachments.UploadResponseCode",
status.is_success() ? response_code : status.error());
if (response_code == net::HTTP_OK) {
result = UPLOAD_SUCCESS;
@@ -314,8 +315,8 @@ void AttachmentUploaderImpl::UploadAttachment(const Attachment& attachment,
// We have an old upload request for this attachment...
if (!iter->second->IsStopped()) {
// "join" to it.
- DCHECK(attachment.GetData()
- ->Equals(iter->second->GetAttachment().GetData()));
+ DCHECK(attachment.GetData()->Equals(
+ iter->second->GetAttachment().GetData()));
iter->second->AddUserCallback(callback);
return;
} else {
@@ -361,7 +362,7 @@ void AttachmentUploaderImpl::OnUploadStateStopped(const UniqueId& unique_id) {
std::string AttachmentUploaderImpl::FormatCrc32cHash(uint32_t crc32c) {
const uint32_t crc32c_big_endian = base::HostToNet32(crc32c);
const base::StringPiece raw(reinterpret_cast<const char*>(&crc32c_big_endian),
- sizeof(crc32c_big_endian));
+ sizeof(crc32c_big_endian));
std::string encoded;
base::Base64Encode(raw, &encoded);
return encoded;
@@ -386,9 +387,9 @@ void AttachmentUploaderImpl::ConfigureURLFetcherCommon(
// Encode the birthday. Birthday is opaque so we assume it could contain
// anything. Encode it so that it's safe to pass as an HTTP header value.
std::string encoded_store_birthday;
- base::Base64UrlEncode(
- raw_store_birthday, base::Base64UrlEncodePolicy::OMIT_PADDING,
- &encoded_store_birthday);
+ base::Base64UrlEncode(raw_store_birthday,
+ base::Base64UrlEncodePolicy::OMIT_PADDING,
+ &encoded_store_birthday);
fetcher->AddExtraRequestHeader(base::StringPrintf(
"%s: %s", kSyncStoreBirthday, encoded_store_birthday.c_str()));

Powered by Google App Engine
This is Rietveld 408576698