From b8d39a65ae7830fb2e255dd60bbe533610d38977 Mon Sep 17 00:00:00 2001 From: "inferno@chromium.org" Date: Tue, 24 Jul 2012 21:32:53 +0000 Subject: 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 --- .../api/content_settings/content_settings_api.cc | 16 ++++------------ 1 file 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( -- cgit v1.1