Chromium Code Reviews| Index: chrome/service/cloud_print/cloud_print_url_fetcher.cc |
| diff --git a/chrome/service/cloud_print/cloud_print_url_fetcher.cc b/chrome/service/cloud_print/cloud_print_url_fetcher.cc |
| index dc2a46869f733f1aac4dce371c4c4520e303c0a5..9f887831a336eb4af8b8b1544d90272bfb623fe8 100644 |
| --- a/chrome/service/cloud_print/cloud_print_url_fetcher.cc |
| +++ b/chrome/service/cloud_print/cloud_print_url_fetcher.cc |
| @@ -20,6 +20,36 @@ |
| namespace cloud_print { |
| +static CloudPrintURLFetcherFactory* g_factory = NULL; |
| + |
| +// static |
| +CloudPrintURLFetcher* CloudPrintURLFetcher::Create() { |
| + CloudPrintURLFetcherFactory* factory = CloudPrintURLFetcher::factory(); |
| + return factory ? factory->CreateCloudPrintURLFetcher() : |
| + new CloudPrintURLFetcher; |
| +} |
| + |
| +// static |
| +CloudPrintURLFetcherFactory* CloudPrintURLFetcher::factory() { |
| + return g_factory; |
| +} |
| + |
| +// static |
| +void CloudPrintURLFetcher::set_factory( |
|
gene
2013/02/11 23:34:05
Does this fit on one line?
|
| + CloudPrintURLFetcherFactory* factory) { |
| + g_factory = factory; |
| +} |
| + |
| + |
| +CloudPrintURLFetcherFactory::CloudPrintURLFetcherFactory() { |
|
gene
2013/02/11 23:34:05
Can we omit constructor/destructor here, and have
|
| + CloudPrintURLFetcher::set_factory(this); |
| +} |
| + |
| +CloudPrintURLFetcherFactory::~CloudPrintURLFetcherFactory() { |
| + CloudPrintURLFetcher::set_factory(NULL); |
| +} |
| + |
| + |
| CloudPrintURLFetcher::ResponseAction |
| CloudPrintURLFetcher::Delegate::HandleRawResponse( |
| const net::URLFetcher* source, |
| @@ -53,7 +83,8 @@ CloudPrintURLFetcher::CloudPrintURLFetcher() |
| num_retries_(0) { |
| } |
| -bool CloudPrintURLFetcher::IsSameRequest(const net::URLFetcher* source) { |
| +bool CloudPrintURLFetcher::IsSameRequest( |
|
gene
2013/02/11 23:34:05
This should fit on one line.
|
| + const net::URLFetcher* source) { |
| return (request_.get() == source); |
| } |