summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-31 08:08:29 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-31 08:08:29 +0000
commitd92ff03326c5185a1e92babe0cf82c10b84d173a (patch)
tree432c4dfdee2dcef0425102c3f4f41c92454e956d /remoting
parent38fe1964640f28c273b2a68a564b7c47a68f8b01 (diff)
downloadchromium_src-d92ff03326c5185a1e92babe0cf82c10b84d173a.zip
chromium_src-d92ff03326c5185a1e92babe0cf82c10b84d173a.tar.gz
chromium_src-d92ff03326c5185a1e92babe0cf82c10b84d173a.tar.bz2
Convert src/remoting to std::string/char* away from wstring/wchar_t*.
This is easy now that DictionaryValue uses std::string for keys. BUG=23581 TEST=remoting_unittests Review URL: http://codereview.chromium.org/3060034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54441 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r--remoting/host/host_config.cc10
-rw-r--r--remoting/host/host_config.h19
-rw-r--r--remoting/host/json_host_config.cc16
-rw-r--r--remoting/host/json_host_config.h10
-rw-r--r--remoting/host/json_host_config_unittest.cc2
5 files changed, 17 insertions, 40 deletions
diff --git a/remoting/host/host_config.cc b/remoting/host/host_config.cc
index b77ecd5..cfebfeb 100644
--- a/remoting/host/host_config.cc
+++ b/remoting/host/host_config.cc
@@ -6,10 +6,10 @@
namespace remoting {
-const wchar_t* kXmppLoginConfigPath = L"xmpp_login";
-const wchar_t* kXmppAuthTokenConfigPath = L"xmpp_auth_token";
-const wchar_t* kHostIdConfigPath = L"host_id";
-const wchar_t* kHostNameConfigPath = L"host_name";
-const wchar_t* kPrivateKeyConfigPath = L"private_key";
+const char* kXmppLoginConfigPath = "xmpp_login";
+const char* kXmppAuthTokenConfigPath = "xmpp_auth_token";
+const char* kHostIdConfigPath = "host_id";
+const char* kHostNameConfigPath = "host_name";
+const char* kPrivateKeyConfigPath = "private_key";
} // namespace remoting
diff --git a/remoting/host/host_config.h b/remoting/host/host_config.h
index 7c92649d..22ef533 100644
--- a/remoting/host/host_config.h
+++ b/remoting/host/host_config.h
@@ -16,16 +16,16 @@ namespace remoting {
// Following constants define names for configuration parameters.
// Login used to authenticate in XMPP network.
-extern const wchar_t* kXmppLoginConfigPath;
+extern const char* kXmppLoginConfigPath;
// Auth token used to authenticate in XMPP network.
-extern const wchar_t* kXmppAuthTokenConfigPath;
+extern const char* kXmppAuthTokenConfigPath;
// Unique identifier of the host used to register the host in directory.
// Normally a random UUID.
-extern const wchar_t* kHostIdConfigPath;
+extern const char* kHostIdConfigPath;
// Readable host name.
-extern const wchar_t* kHostNameConfigPath;
+extern const char* kHostNameConfigPath;
// Private keys used for host authentication.
-extern const wchar_t* kPrivateKeyConfigPath;
+extern const char* kPrivateKeyConfigPath;
// HostConfig interace provides read-only access to host configuration.
class HostConfig : public base::RefCountedThreadSafe<HostConfig> {
@@ -33,10 +33,7 @@ class HostConfig : public base::RefCountedThreadSafe<HostConfig> {
HostConfig() { };
virtual ~HostConfig() { }
- virtual bool GetString(const std::wstring& path,
- std::wstring* out_value) = 0;
- virtual bool GetString(const std::wstring& path,
- std::string* out_value) = 0;
+ virtual bool GetString(const std::string& path, std::string* out_value) = 0;
DISALLOW_COPY_AND_ASSIGN(HostConfig);
};
@@ -53,9 +50,7 @@ class MutableHostConfig : public HostConfig {
// SetString() updates specified config value. This methods must only
// be called from task specified in Update().
- virtual void SetString(const std::wstring& path,
- const std::wstring& in_value) = 0;
- virtual void SetString(const std::wstring& path,
+ virtual void SetString(const std::string& path,
const std::string& in_value) = 0;
DISALLOW_COPY_AND_ASSIGN(MutableHostConfig);
diff --git a/remoting/host/json_host_config.cc b/remoting/host/json_host_config.cc
index 891ca78..cd868ce 100644
--- a/remoting/host/json_host_config.cc
+++ b/remoting/host/json_host_config.cc
@@ -38,13 +38,7 @@ bool JsonHostConfig::Read() {
return true;
}
-bool JsonHostConfig::GetString(const std::wstring& path,
- std::wstring* out_value) {
- AutoLock auto_lock(lock_);
- return values_->GetString(path, out_value);
-}
-
-bool JsonHostConfig::GetString(const std::wstring& path,
+bool JsonHostConfig::GetString(const std::string& path,
std::string* out_value) {
AutoLock auto_lock(lock_);
return values_->GetString(path, out_value);
@@ -60,13 +54,7 @@ void JsonHostConfig::Update(Task* task) {
FROM_HERE, NewRunnableMethod(this, &JsonHostConfig::DoWrite));
}
-void JsonHostConfig::SetString(const std::wstring& path,
- const std::wstring& in_value) {
- lock_.AssertAcquired();
- values_->SetString(path, in_value);
-}
-
-void JsonHostConfig::SetString(const std::wstring& path,
+void JsonHostConfig::SetString(const std::string& path,
const std::string& in_value) {
lock_.AssertAcquired();
values_->SetString(path, in_value);
diff --git a/remoting/host/json_host_config.h b/remoting/host/json_host_config.h
index 8d73e66..b136cdf 100644
--- a/remoting/host/json_host_config.h
+++ b/remoting/host/json_host_config.h
@@ -31,17 +31,11 @@ class JsonHostConfig : public MutableHostConfig {
virtual bool Read();
// MutableHostConfig interface.
- virtual bool GetString(const std::wstring& path,
- std::wstring* out_value);
- virtual bool GetString(const std::wstring& path,
- std::string* out_value);
+ virtual bool GetString(const std::string& path, std::string* out_value);
virtual void Update(Task* task);
- virtual void SetString(const std::wstring& path,
- const std::wstring& in_value);
- virtual void SetString(const std::wstring& path,
- const std::string& in_value);
+ virtual void SetString(const std::string& path, const std::string& in_value);
private:
void DoWrite();
diff --git a/remoting/host/json_host_config_unittest.cc b/remoting/host/json_host_config_unittest.cc
index 4d40577..534b4c5 100644
--- a/remoting/host/json_host_config_unittest.cc
+++ b/remoting/host/json_host_config_unittest.cc
@@ -79,7 +79,7 @@ TEST_F(JsonHostConfigTest, Read) {
EXPECT_TRUE(target->GetString(kPrivateKeyConfigPath, &value));
EXPECT_EQ("TEST_PRIVATE_KEY", value);
- EXPECT_FALSE(target->GetString(L"non_existent_value", &value));
+ EXPECT_FALSE(target->GetString("non_existent_value", &value));
}
TEST_F(JsonHostConfigTest, Write) {