Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(289)

Unified Diff: chrome/browser/automation/testing_automation_provider.cc

Issue 15984016: Call scoped_refptr<T>::get() rather than relying on implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/automation/testing_automation_provider.cc
diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc
index e44edb89d1a47a73097e7f6f7d05f855c427c759..bc3f676cebd1aff6137304fa7c882e054f2003d0 100644
--- a/chrome/browser/automation/testing_automation_provider.cc
+++ b/chrome/browser/automation/testing_automation_provider.cc
@@ -1286,7 +1286,7 @@ void TestingAutomationProvider::GetBookmarksAsJSON(
scoped_refptr<BookmarkStorage> storage(
new BookmarkStorage(browser->profile(),
bookmark_model,
- browser->profile()->GetIOTaskRunner()));
+ browser->profile()->GetIOTaskRunner().get()));
if (!storage->SerializeData(&bookmarks_as_json)) {
reply.SendError("Failed to serialize bookmarks");
return;
@@ -3109,7 +3109,8 @@ void TestingAutomationProvider::GetPluginsInfoCallback(
DictionaryValue* args,
IPC::Message* reply_message,
const std::vector<webkit::WebPluginInfo>& plugins) {
- PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(browser->profile());
+ PluginPrefs* plugin_prefs =
+ PluginPrefs::GetForProfile(browser->profile()).get();
ListValue* items = new ListValue;
for (std::vector<webkit::WebPluginInfo>::const_iterator it =
plugins.begin();
@@ -3162,10 +3163,16 @@ void TestingAutomationProvider::EnablePlugin(Browser* browser,
AutomationJSONReply(this, reply_message).SendError("path not specified.");
return;
}
- PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(browser->profile());
- plugin_prefs->EnablePlugin(true, base::FilePath(path),
- base::Bind(&DidEnablePlugin, AsWeakPtr(), reply_message,
- path, "Could not enable plugin for path %s."));
+ PluginPrefs* plugin_prefs =
+ PluginPrefs::GetForProfile(browser->profile()).get();
+ plugin_prefs->EnablePlugin(
+ true,
+ base::FilePath(path),
+ base::Bind(&DidEnablePlugin,
+ AsWeakPtr(),
+ reply_message,
+ path,
+ "Could not enable plugin for path %s."));
}
// Sample json input:
@@ -3179,10 +3186,16 @@ void TestingAutomationProvider::DisablePlugin(Browser* browser,
AutomationJSONReply(this, reply_message).SendError("path not specified.");
return;
}
- PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(browser->profile());
- plugin_prefs->EnablePlugin(false, base::FilePath(path),
- base::Bind(&DidEnablePlugin, AsWeakPtr(), reply_message,
- path, "Could not disable plugin for path %s."));
+ PluginPrefs* plugin_prefs =
+ PluginPrefs::GetForProfile(browser->profile()).get();
+ plugin_prefs->EnablePlugin(
+ false,
+ base::FilePath(path),
+ base::Bind(&DidEnablePlugin,
+ AsWeakPtr(),
+ reply_message,
+ path,
+ "Could not disable plugin for path %s."));
}
// Sample json input:
@@ -3361,7 +3374,7 @@ void TestingAutomationProvider::AddSavedPassword(
// Use IMPLICIT_ACCESS since new passwords aren't added in incognito mode.
PasswordStore* password_store = PasswordStoreFactory::GetForProfile(
- browser->profile(), Profile::IMPLICIT_ACCESS);
+ browser->profile(), Profile::IMPLICIT_ACCESS).get();
// The password store does not exist for an incognito window.
if (password_store == NULL) {
@@ -3407,7 +3420,7 @@ void TestingAutomationProvider::RemoveSavedPassword(
// Use EXPLICIT_ACCESS since passwords can be removed in incognito mode.
PasswordStore* password_store = PasswordStoreFactory::GetForProfile(
- browser->profile(), Profile::EXPLICIT_ACCESS);
+ browser->profile(), Profile::EXPLICIT_ACCESS).get();
if (password_store == NULL) {
AutomationJSONReply(this, reply_message).SendError(
"Unable to get password store.");
@@ -3433,7 +3446,7 @@ void TestingAutomationProvider::GetSavedPasswords(
// Use EXPLICIT_ACCESS since saved passwords can be retrieved in
// incognito mode.
PasswordStore* password_store = PasswordStoreFactory::GetForProfile(
- browser->profile(), Profile::EXPLICIT_ACCESS);
+ browser->profile(), Profile::EXPLICIT_ACCESS).get();
if (password_store == NULL) {
AutomationJSONReply reply(this, reply_message);

Powered by Google App Engine
This is Rietveld 408576698