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,
|
OperationRegistry* registry,
|
||||||
net::URLRequestContextGetter* url_request_context_getter)
|
net::URLRequestContextGetter* url_request_context_getter)
|
||||||
: OperationRegistry::Operation(registry),
|
: OperationRegistry::Operation(registry),
|
||||||
save_temp_file_(false),
|
|
||||||
url_request_context_getter_(url_request_context_getter),
|
url_request_context_getter_(url_request_context_getter),
|
||||||
re_authenticate_count_(0),
|
re_authenticate_count_(0),
|
||||||
started_(false),
|
started_(false),
|
||||||
|
save_temp_file_(false),
|
||||||
ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) {
|
ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) {
|
||||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||||
}
|
}
|
||||||
@@ -89,10 +89,10 @@ UrlFetchOperationBase::UrlFetchOperationBase(
|
|||||||
OperationType type,
|
OperationType type,
|
||||||
const FilePath& path)
|
const FilePath& path)
|
||||||
: OperationRegistry::Operation(registry, type, path),
|
: OperationRegistry::Operation(registry, type, path),
|
||||||
save_temp_file_(false),
|
|
||||||
url_request_context_getter_(url_request_context_getter),
|
url_request_context_getter_(url_request_context_getter),
|
||||||
re_authenticate_count_(0),
|
re_authenticate_count_(0),
|
||||||
started_(false),
|
started_(false),
|
||||||
|
save_temp_file_(false),
|
||||||
ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) {
|
ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) {
|
||||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||||
}
|
}
|
||||||
|
@@ -137,10 +137,19 @@ class UrlFetchOperationBase : public AuthenticatedOperationInterface,
|
|||||||
// the status of the URLFetcher.
|
// the status of the URLFetcher.
|
||||||
static GDataErrorCode GetErrorCode(const net::URLFetcher* source);
|
static GDataErrorCode GetErrorCode(const net::URLFetcher* source);
|
||||||
|
|
||||||
// The following members are used by DownloadFileOperation.
|
// By default, no temporary file will be saved. Derived classes can set
|
||||||
// TODO(satorux): Make them private.
|
// this to true in their constructors, if they want to save the downloaded
|
||||||
bool save_temp_file_;
|
// content to a temporary file.
|
||||||
FilePath output_file_path_;
|
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:
|
private:
|
||||||
// OperationRegistry::Operation overrides.
|
// OperationRegistry::Operation overrides.
|
||||||
@@ -158,6 +167,9 @@ class UrlFetchOperationBase : public AuthenticatedOperationInterface,
|
|||||||
scoped_ptr<net::URLFetcher> url_fetcher_;
|
scoped_ptr<net::URLFetcher> url_fetcher_;
|
||||||
bool started_;
|
bool started_;
|
||||||
|
|
||||||
|
bool save_temp_file_;
|
||||||
|
FilePath output_file_path_;
|
||||||
|
|
||||||
// WeakPtrFactory bound to the UI thread.
|
// WeakPtrFactory bound to the UI thread.
|
||||||
// Note: This should remain the last member so it'll be destroyed and
|
// Note: This should remain the last member so it'll be destroyed and
|
||||||
// invalidate its weak pointers before any other members are destroyed.
|
// 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.
|
// Make sure we download the content into a temp file.
|
||||||
if (output_file_path.empty())
|
if (output_file_path.empty())
|
||||||
save_temp_file_ = true;
|
set_save_temp_file(true);
|
||||||
else
|
else
|
||||||
output_file_path_ = output_file_path;
|
set_output_file_path(output_file_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
DownloadFileOperation::~DownloadFileOperation() {}
|
DownloadFileOperation::~DownloadFileOperation() {}
|
||||||
|
Reference in New Issue
Block a user