Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6687)

Unified Diff: chrome/service/cloud_print/cloud_print_url_fetcher.cc

Issue 12208089: Changing CloudPrintURLFetcher instantiation to be more testable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporated Gene's suggestions Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..f28dac0e1af4e0e4d9efa9d10eb81ef6b29590cd 100644
--- a/chrome/service/cloud_print/cloud_print_url_fetcher.cc
+++ b/chrome/service/cloud_print/cloud_print_url_fetcher.cc
@@ -20,6 +20,25 @@
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(CloudPrintURLFetcherFactory* factory) {
+ g_factory = factory;
+}
+
CloudPrintURLFetcher::ResponseAction
CloudPrintURLFetcher::Delegate::HandleRawResponse(
const net::URLFetcher* source,
« no previous file with comments | « chrome/service/cloud_print/cloud_print_url_fetcher.h ('k') | chrome/service/cloud_print/cloud_print_wipeout.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698