OLD | NEW |
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 "chrome/browser/google_apis/base_operations.h" | 5 #include "chrome/browser/google_apis/base_operations.h" |
6 | 6 |
7 #include "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/task_runner_util.h" | 10 #include "base/task_runner_util.h" |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 } | 367 } |
368 | 368 |
369 void GetDataOperation::RunCallbackOnSuccess(GDataErrorCode fetch_error_code, | 369 void GetDataOperation::RunCallbackOnSuccess(GDataErrorCode fetch_error_code, |
370 scoped_ptr<base::Value> value) { | 370 scoped_ptr<base::Value> value) { |
371 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 371 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
372 callback_.Run(fetch_error_code, value.Pass()); | 372 callback_.Run(fetch_error_code, value.Pass()); |
373 } | 373 } |
374 | 374 |
375 //========================= InitiateUploadOperationBase ======================== | 375 //========================= InitiateUploadOperationBase ======================== |
376 | 376 |
377 InitiateUploadParams::InitiateUploadParams( | |
378 UploadMode upload_mode, | |
379 const std::string& title, | |
380 const std::string& content_type, | |
381 int64 content_length, | |
382 const GURL& upload_location, | |
383 const base::FilePath& drive_file_path, | |
384 const std::string& etag) | |
385 : upload_mode(upload_mode), | |
386 title(title), | |
387 content_type(content_type), | |
388 content_length(content_length), | |
389 upload_location(upload_location), | |
390 drive_file_path(drive_file_path), | |
391 etag(etag) { | |
392 } | |
393 | |
394 InitiateUploadParams::~InitiateUploadParams() { | |
395 } | |
396 | |
397 InitiateUploadOperationBase::InitiateUploadOperationBase( | 377 InitiateUploadOperationBase::InitiateUploadOperationBase( |
398 OperationRegistry* registry, | 378 OperationRegistry* registry, |
399 net::URLRequestContextGetter* url_request_context_getter, | 379 net::URLRequestContextGetter* url_request_context_getter, |
400 const InitiateUploadCallback& callback, | 380 const InitiateUploadCallback& callback, |
401 const base::FilePath& drive_file_path, | 381 const base::FilePath& drive_file_path, |
402 const std::string& content_type, | 382 const std::string& content_type, |
403 int64 content_length) | 383 int64 content_length) |
404 : UrlFetchOperationBase(registry, | 384 : UrlFetchOperationBase(registry, |
405 url_request_context_getter, | 385 url_request_context_getter, |
406 OPERATION_UPLOAD, | 386 OPERATION_UPLOAD, |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 | 497 |
518 download_action_callback_.Run(code, temp_file); | 498 download_action_callback_.Run(code, temp_file); |
519 OnProcessURLFetchResultsComplete(code == HTTP_SUCCESS); | 499 OnProcessURLFetchResultsComplete(code == HTTP_SUCCESS); |
520 } | 500 } |
521 | 501 |
522 void DownloadFileOperation::RunCallbackOnPrematureFailure(GDataErrorCode code) { | 502 void DownloadFileOperation::RunCallbackOnPrematureFailure(GDataErrorCode code) { |
523 download_action_callback_.Run(code, base::FilePath()); | 503 download_action_callback_.Run(code, base::FilePath()); |
524 } | 504 } |
525 | 505 |
526 } // namespace google_apis | 506 } // namespace google_apis |
OLD | NEW |