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

Side by Side Diff: components/drive/drive_uploader.cc

Issue 2073353002: Merge PowerSaveBlockerImpl and PowerSaveBlocker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-power-factory
Patch Set: android Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/media/cast_transport_host_filter.cc ('k') | content/browser/DEPS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/drive/drive_uploader.h" 5 #include "components/drive/drive_uploader.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 UploadFileInfo(const base::FilePath& local_path, 92 UploadFileInfo(const base::FilePath& local_path,
93 const std::string& content_type, 93 const std::string& content_type,
94 const UploadCompletionCallback& callback, 94 const UploadCompletionCallback& callback,
95 const ProgressCallback& progress_callback) 95 const ProgressCallback& progress_callback)
96 : file_path(local_path), 96 : file_path(local_path),
97 content_type(content_type), 97 content_type(content_type),
98 completion_callback(callback), 98 completion_callback(callback),
99 progress_callback(progress_callback), 99 progress_callback(progress_callback),
100 content_length(0), 100 content_length(0),
101 next_start_position(-1), 101 next_start_position(-1),
102 power_save_blocker(device::PowerSaveBlocker::CreateWithTaskRunners( 102 power_save_blocker(new device::PowerSaveBlocker(
103 device::PowerSaveBlocker::kPowerSaveBlockPreventAppSuspension, 103 device::PowerSaveBlocker::kPowerSaveBlockPreventAppSuspension,
104 device::PowerSaveBlocker::kReasonOther, 104 device::PowerSaveBlocker::kReasonOther,
105 "Upload in progress", 105 "Upload in progress",
106 content::BrowserThread::GetMessageLoopProxyForThread( 106 content::BrowserThread::GetMessageLoopProxyForThread(
107 content::BrowserThread::UI), 107 content::BrowserThread::UI),
108 content::BrowserThread::GetMessageLoopProxyForThread( 108 content::BrowserThread::GetMessageLoopProxyForThread(
109 content::BrowserThread::FILE))), 109 content::BrowserThread::FILE))),
110 cancelled(false), 110 cancelled(false),
111 weak_ptr_factory_(this) {} 111 weak_ptr_factory_(this) {}
112 112
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 DVLOG(1) << "Upload failed " << upload_file_info->DebugString(); 533 DVLOG(1) << "Upload failed " << upload_file_info->DebugString();
534 if (error == HTTP_PRECONDITION) 534 if (error == HTTP_PRECONDITION)
535 error = HTTP_CONFLICT; // ETag mismatch. 535 error = HTTP_CONFLICT; // ETag mismatch.
536 upload_file_info->completion_callback.Run(error, 536 upload_file_info->completion_callback.Run(error,
537 upload_file_info->upload_location, 537 upload_file_info->upload_location,
538 std::unique_ptr<FileResource>()); 538 std::unique_ptr<FileResource>());
539 } 539 }
540 } 540 }
541 541
542 } // namespace drive 542 } // namespace drive
OLDNEW
« no previous file with comments | « chrome/browser/media/cast_transport_host_filter.cc ('k') | content/browser/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698