summaryrefslogtreecommitdiffstats
path: root/chrome/service/service_process.cc
diff options
context:
space:
mode:
authorsanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-21 19:09:55 +0000
committersanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-21 19:09:55 +0000
commit1e6c016987770754320842057097e2be9266011d (patch)
treee34f1122652e8d5fbe44df8108f2e873a0494d47 /chrome/service/service_process.cc
parentbbd8993d6edff252033397a88da1b47c770d0c11 (diff)
downloadchromium_src-1e6c016987770754320842057097e2be9266011d.zip
chromium_src-1e6c016987770754320842057097e2be9266011d.tar.gz
chromium_src-1e6c016987770754320842057097e2be9266011d.tar.bz2
Added the ability in the service process to save and read state from a prefs file. Used this to save and read the cloud print proxy auth token and proxy id.
BUG=None. TEST=Test Cloud Print Proxy (run it second time without LSID and ProxyId command-line args) Review URL: http://codereview.chromium.org/2066018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47945 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/service/service_process.cc')
-rw-r--r--chrome/service/service_process.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/chrome/service/service_process.cc b/chrome/service/service_process.cc
index 9a39e5e..6e9baf2 100644
--- a/chrome/service/service_process.cc
+++ b/chrome/service/service_process.cc
@@ -4,6 +4,7 @@
#include "chrome/service/service_process.h"
+#include "base/stl_util-inl.h"
#include "chrome/service/cloud_print/cloud_print_proxy.h"
#include "chrome/service/net/service_network_change_notifier_thread.h"
@@ -35,19 +36,21 @@ bool ServiceProcess::Teardown() {
network_change_notifier_thread_ = NULL;
io_thread_.reset();
file_thread_.reset();
+ STLDeleteElements(&cloud_print_proxy_list_);
return true;
}
-CloudPrintProxy* ServiceProcess::cloud_print_proxy() {
- if (!cloud_print_proxy_.get()) {
- cloud_print_proxy_.reset(new CloudPrintProxy());
- cloud_print_proxy_->Initialize();
- }
- return cloud_print_proxy_.get();
+CloudPrintProxy* ServiceProcess::CreateCloudPrintProxy(
+ JsonPrefStore* service_prefs) {
+ CloudPrintProxy* cloud_print_proxy = new CloudPrintProxy();
+ cloud_print_proxy->Initialize(service_prefs);
+ cloud_print_proxy_list_.push_back(cloud_print_proxy);
+ return cloud_print_proxy;
}
ServiceProcess::~ServiceProcess() {
Teardown();
+ DCHECK(cloud_print_proxy_list_.size() == 0);
g_service_process = NULL;
}