summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authorrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-11 00:15:41 +0000
committerrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-11 00:15:41 +0000
commitcd57857578b7b905ee27580d8ca279f6f7642e82 (patch)
tree82230a21554f358452b508ee64ef1ea3efcb518b /remoting
parentcc7cde43832b547cdab856fe1bedc9514ca38e13 (diff)
downloadchromium_src-cd57857578b7b905ee27580d8ca279f6f7642e82.zip
chromium_src-cd57857578b7b905ee27580d8ca279f6f7642e82.tar.gz
chromium_src-cd57857578b7b905ee27580d8ca279f6f7642e82.tar.bz2
Modify the base::JSONReader interface to take a set of options rather than a boolean flag.
This is just prep work for a large CL that rewrites the JSON parser. Splitting out this interface change will make it easier to review the other CL. BUG=121469 TEST=No functional change. Review URL: https://chromiumcodereview.appspot.com/9960077 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131680 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r--remoting/client/plugin/chromoting_instance.cc3
-rw-r--r--remoting/host/elevated_controller_win.cc3
-rw-r--r--remoting/host/gaia_oauth_client.cc2
-rw-r--r--remoting/host/json_host_config.cc3
-rw-r--r--remoting/host/plugin/daemon_controller_win.cc3
-rw-r--r--remoting/host/plugin/host_script_object.cc6
6 files changed, 13 insertions, 7 deletions
diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc
index 70d481f..1671d71 100644
--- a/remoting/client/plugin/chromoting_instance.cc
+++ b/remoting/client/plugin/chromoting_instance.cc
@@ -216,7 +216,8 @@ void ChromotingInstance::HandleMessage(const pp::Var& message) {
}
scoped_ptr<base::Value> json(
- base::JSONReader::Read(message.AsString(), true));
+ base::JSONReader::Read(message.AsString(),
+ base::JSON_ALLOW_TRAILING_COMMAS));
base::DictionaryValue* message_dict = NULL;
std::string method;
base::DictionaryValue* data = NULL;
diff --git a/remoting/host/elevated_controller_win.cc b/remoting/host/elevated_controller_win.cc
index 1c13ffa..1a8bec6 100644
--- a/remoting/host/elevated_controller_win.cc
+++ b/remoting/host/elevated_controller_win.cc
@@ -74,7 +74,8 @@ HRESULT ReadConfig(const FilePath& filename,
// Parse the JSON configuration, expecting it to contain a dictionary.
std::string file_content(buffer.get(), size);
- scoped_ptr<base::Value> value(base::JSONReader::Read(file_content, true));
+ scoped_ptr<base::Value> value(
+ base::JSONReader::Read(file_content, base::JSON_ALLOW_TRAILING_COMMAS));
base::DictionaryValue* dictionary;
if (value.get() == NULL || !value->GetAsDictionary(&dictionary)) {
diff --git a/remoting/host/gaia_oauth_client.cc b/remoting/host/gaia_oauth_client.cc
index 8b2844b..0412ae0 100644
--- a/remoting/host/gaia_oauth_client.cc
+++ b/remoting/host/gaia_oauth_client.cc
@@ -144,7 +144,7 @@ void GaiaOAuthClient::Core::HandleResponse(
if (source->GetResponseCode() == net::HTTP_OK) {
std::string data;
source->GetResponseAsString(&data);
- scoped_ptr<Value> message_value(base::JSONReader::Read(data, false));
+ scoped_ptr<Value> message_value(base::JSONReader::Read(data));
if (message_value.get() &&
message_value->IsType(Value::TYPE_DICTIONARY)) {
scoped_ptr<DictionaryValue> response_dict(
diff --git a/remoting/host/json_host_config.cc b/remoting/host/json_host_config.cc
index 66e518c2..6c5c2e8 100644
--- a/remoting/host/json_host_config.cc
+++ b/remoting/host/json_host_config.cc
@@ -30,7 +30,8 @@ bool JsonHostConfig::Read() {
return false;
}
- scoped_ptr<Value> value(base::JSONReader::Read(file_content, true));
+ scoped_ptr<Value> value(
+ base::JSONReader::Read(file_content, base::JSON_ALLOW_TRAILING_COMMAS));
if (value.get() == NULL || !value->IsType(Value::TYPE_DICTIONARY)) {
LOG(WARNING) << "Failed to parse " << filename_.value();
return false;
diff --git a/remoting/host/plugin/daemon_controller_win.cc b/remoting/host/plugin/daemon_controller_win.cc
index 5369fbb..4b011db 100644
--- a/remoting/host/plugin/daemon_controller_win.cc
+++ b/remoting/host/plugin/daemon_controller_win.cc
@@ -327,7 +327,8 @@ void DaemonControllerWin::DoGetConfig(const GetConfigCallback& callback) {
// Parse the string into a dictionary.
scoped_ptr<base::Value> config(
- base::JSONReader::Read(UTF16ToUTF8(file_content), true));
+ base::JSONReader::Read(UTF16ToUTF8(file_content),
+ base::JSON_ALLOW_TRAILING_COMMAS));
base::DictionaryValue* dictionary;
if (config.get() == NULL || !config->GetAsDictionary(&dictionary)) {
diff --git a/remoting/host/plugin/host_script_object.cc b/remoting/host/plugin/host_script_object.cc
index f7f64c8..5743a96 100644
--- a/remoting/host/plugin/host_script_object.cc
+++ b/remoting/host/plugin/host_script_object.cc
@@ -678,7 +678,8 @@ bool HostNPScriptObject::UpdateDaemonConfig(const NPVariant* args,
}
std::string config_str = StringFromNPVariant(args[0]);
- scoped_ptr<base::Value> config(base::JSONReader::Read(config_str, true));
+ scoped_ptr<base::Value> config(
+ base::JSONReader::Read(config_str, base::JSON_ALLOW_TRAILING_COMMAS));
if (config_str.empty() || !config.get() ||
!config->IsType(base::Value::TYPE_DICTIONARY)) {
SetException("updateDaemonConfig: bad config parameter");
@@ -739,7 +740,8 @@ bool HostNPScriptObject::StartDaemon(const NPVariant* args,
}
std::string config_str = StringFromNPVariant(args[0]);
- scoped_ptr<base::Value> config(base::JSONReader::Read(config_str, true));
+ scoped_ptr<base::Value> config(
+ base::JSONReader::Read(config_str, base::JSON_ALLOW_TRAILING_COMMAS));
if (config_str.empty() || !config.get() ||
!config->IsType(base::Value::TYPE_DICTIONARY)) {
SetException("updateDaemonConfig: bad config parameter");