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/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
10 #include "base/task_runner_util.h" | 10 #include "base/task_runner_util.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 } // namespace | 68 } // namespace |
69 | 69 |
70 namespace google_apis { | 70 namespace google_apis { |
71 | 71 |
72 //============================ UrlFetchOperationBase =========================== | 72 //============================ UrlFetchOperationBase =========================== |
73 | 73 |
74 UrlFetchOperationBase::UrlFetchOperationBase( | 74 UrlFetchOperationBase::UrlFetchOperationBase( |
75 OperationRegistry* registry, | 75 OperationRegistry* registry, |
76 net::URLRequestContextGetter* url_request_context_getter) | 76 net::URLRequestContextGetter* url_request_context_getter) |
77 : OperationRegistry::Operation(registry), | 77 : OperationRegistry::Operation(registry), |
78 save_temp_file_(false), | |
79 url_request_context_getter_(url_request_context_getter), | 78 url_request_context_getter_(url_request_context_getter), |
80 re_authenticate_count_(0), | 79 re_authenticate_count_(0), |
81 started_(false), | 80 started_(false), |
| 81 save_temp_file_(false), |
82 ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) { | 82 ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) { |
83 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 83 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
84 } | 84 } |
85 | 85 |
86 UrlFetchOperationBase::UrlFetchOperationBase( | 86 UrlFetchOperationBase::UrlFetchOperationBase( |
87 OperationRegistry* registry, | 87 OperationRegistry* registry, |
88 net::URLRequestContextGetter* url_request_context_getter, | 88 net::URLRequestContextGetter* url_request_context_getter, |
89 OperationType type, | 89 OperationType type, |
90 const FilePath& path) | 90 const FilePath& path) |
91 : OperationRegistry::Operation(registry, type, path), | 91 : OperationRegistry::Operation(registry, type, path), |
92 save_temp_file_(false), | |
93 url_request_context_getter_(url_request_context_getter), | 92 url_request_context_getter_(url_request_context_getter), |
94 re_authenticate_count_(0), | 93 re_authenticate_count_(0), |
95 started_(false), | 94 started_(false), |
| 95 save_temp_file_(false), |
96 ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) { | 96 ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) { |
97 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 97 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
98 } | 98 } |
99 | 99 |
100 UrlFetchOperationBase::~UrlFetchOperationBase() {} | 100 UrlFetchOperationBase::~UrlFetchOperationBase() {} |
101 | 101 |
102 void UrlFetchOperationBase::Start(const std::string& access_token, | 102 void UrlFetchOperationBase::Start(const std::string& access_token, |
103 const std::string& custom_user_agent, | 103 const std::string& custom_user_agent, |
104 const ReAuthenticateCallback& callback) { | 104 const ReAuthenticateCallback& callback) { |
105 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 105 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 OnProcessURLFetchResultsComplete(success); | 339 OnProcessURLFetchResultsComplete(success); |
340 } | 340 } |
341 | 341 |
342 void GetDataOperation::RunCallbackOnSuccess(GDataErrorCode fetch_error_code, | 342 void GetDataOperation::RunCallbackOnSuccess(GDataErrorCode fetch_error_code, |
343 scoped_ptr<base::Value> value) { | 343 scoped_ptr<base::Value> value) { |
344 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 344 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
345 callback_.Run(fetch_error_code, value.Pass()); | 345 callback_.Run(fetch_error_code, value.Pass()); |
346 } | 346 } |
347 | 347 |
348 } // namespace google_apis | 348 } // namespace google_apis |
OLD | NEW |