google_apis: Change protected data members to private
Non-private data members are prohibited by the style guide. BUG=163544 TEST=none Review URL: https://codereview.chromium.org/11571002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172824 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
chrome/browser/google_apis
@ -75,10 +75,10 @@ UrlFetchOperationBase::UrlFetchOperationBase(
|
||||
OperationRegistry* registry,
|
||||
net::URLRequestContextGetter* url_request_context_getter)
|
||||
: OperationRegistry::Operation(registry),
|
||||
save_temp_file_(false),
|
||||
url_request_context_getter_(url_request_context_getter),
|
||||
re_authenticate_count_(0),
|
||||
started_(false),
|
||||
save_temp_file_(false),
|
||||
ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
}
|
||||
@ -89,10 +89,10 @@ UrlFetchOperationBase::UrlFetchOperationBase(
|
||||
OperationType type,
|
||||
const FilePath& path)
|
||||
: OperationRegistry::Operation(registry, type, path),
|
||||
save_temp_file_(false),
|
||||
url_request_context_getter_(url_request_context_getter),
|
||||
re_authenticate_count_(0),
|
||||
started_(false),
|
||||
save_temp_file_(false),
|
||||
ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
}
|
||||
|
@ -137,10 +137,19 @@ class UrlFetchOperationBase : public AuthenticatedOperationInterface,
|
||||
// the status of the URLFetcher.
|
||||
static GDataErrorCode GetErrorCode(const net::URLFetcher* source);
|
||||
|
||||
// The following members are used by DownloadFileOperation.
|
||||
// TODO(satorux): Make them private.
|
||||
bool save_temp_file_;
|
||||
FilePath output_file_path_;
|
||||
// By default, no temporary file will be saved. Derived classes can set
|
||||
// this to true in their constructors, if they want to save the downloaded
|
||||
// content to a temporary file.
|
||||
void set_save_temp_file(bool save_temp_file) {
|
||||
save_temp_file_ = save_temp_file;
|
||||
}
|
||||
|
||||
// By default, no file will be saved. Derived classes can set an output
|
||||
// file path in their constructors, if they want to save the donwloaded
|
||||
// content to a file at a specific path.
|
||||
void set_output_file_path(const FilePath& output_file_path) {
|
||||
output_file_path_ = output_file_path;
|
||||
}
|
||||
|
||||
private:
|
||||
// OperationRegistry::Operation overrides.
|
||||
@ -158,6 +167,9 @@ class UrlFetchOperationBase : public AuthenticatedOperationInterface,
|
||||
scoped_ptr<net::URLFetcher> url_fetcher_;
|
||||
bool started_;
|
||||
|
||||
bool save_temp_file_;
|
||||
FilePath output_file_path_;
|
||||
|
||||
// WeakPtrFactory bound to the UI thread.
|
||||
// Note: This should remain the last member so it'll be destroyed and
|
||||
// invalidate its weak pointers before any other members are destroyed.
|
||||
|
@ -191,9 +191,9 @@ DownloadFileOperation::DownloadFileOperation(
|
||||
|
||||
// Make sure we download the content into a temp file.
|
||||
if (output_file_path.empty())
|
||||
save_temp_file_ = true;
|
||||
set_save_temp_file(true);
|
||||
else
|
||||
output_file_path_ = output_file_path;
|
||||
set_output_file_path(output_file_path);
|
||||
}
|
||||
|
||||
DownloadFileOperation::~DownloadFileOperation() {}
|
||||
|
Reference in New Issue
Block a user