summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorinferno@chromium.org <inferno@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-24 21:32:53 +0000
committerinferno@chromium.org <inferno@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-24 21:32:53 +0000
commitb8d39a65ae7830fb2e255dd60bbe533610d38977 (patch)
tree2f126fc592b8fe69b46fdcd6e8a8941e66c370c2
parent162348fb49c149375604be6ec26675da6376ee55 (diff)
downloadchromium_src-b8d39a65ae7830fb2e255dd60bbe533610d38977.zip
chromium_src-b8d39a65ae7830fb2e255dd60bbe533610d38977.tar.gz
chromium_src-b8d39a65ae7830fb2e255dd60bbe533610d38977.tar.bz2
Merge 148176 - Fix stale pointer access in content settings extension API.
BUG=138738 TEST=no crash Review URL: https://chromiumcodereview.appspot.com/10800101 TBR=bauerb@chromium.org Review URL: https://chromiumcodereview.appspot.com/10809084 git-svn-id: svn://svn.chromium.org/chrome/branches/1180/src@148206 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/extensions/api/content_settings/content_settings_api.cc16
1 files changed, 4 insertions, 12 deletions
diff --git a/chrome/browser/extensions/api/content_settings/content_settings_api.cc b/chrome/browser/extensions/api/content_settings/content_settings_api.cc
index 9e16a45..33ecbb6 100644
--- a/chrome/browser/extensions/api/content_settings/content_settings_api.cc
+++ b/chrome/browser/extensions/api/content_settings/content_settings_api.cc
@@ -117,11 +117,8 @@ bool GetContentSettingFunction::RunImpl() {
}
std::string resource_identifier;
- if (params->details.resource_identifier.get()) {
- EXTENSION_FUNCTION_VALIDATE(
- params->details.resource_identifier->ToValue()->GetString(keys::kIdKey,
- &resource_identifier));
- }
+ if (params->details.resource_identifier.get())
+ resource_identifier = params->details.resource_identifier->id;
bool incognito = false;
if (params->details.incognito.get())
@@ -198,13 +195,8 @@ bool SetContentSettingFunction::RunImpl() {
}
std::string resource_identifier;
- if (params->details.resource_identifier.get()) {
- DictionaryValue* resource_identifier_dict =
- params->details.resource_identifier->ToValue().get();
- EXTENSION_FUNCTION_VALIDATE(
- resource_identifier_dict->GetString(keys::kIdKey,
- &resource_identifier));
- }
+ if (params->details.resource_identifier.get())
+ resource_identifier = params->details.resource_identifier->id;
std::string setting_str;
EXTENSION_FUNCTION_VALIDATE(