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

Unified Diff: chrome/browser/extensions/api/sessions/sessions_api.cc

Issue 59743002: Do not leak a DictionaryValue from SessionsRestoreFunction::SetResultRestoredTab. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/sessions/sessions_api.cc
diff --git a/chrome/browser/extensions/api/sessions/sessions_api.cc b/chrome/browser/extensions/api/sessions/sessions_api.cc
index 013afa32fa8293696faddcef4548cb7c5aa79643..d2e68cffdf1f3cfcfd0f9485a931a8960443c0e2 100644
--- a/chrome/browser/extensions/api/sessions/sessions_api.cc
+++ b/chrome/browser/extensions/api/sessions/sessions_api.cc
@@ -393,8 +393,9 @@ void SessionsRestoreFunction::SetInvalidIdError(const std::string& invalid_id) {
void SessionsRestoreFunction::SetResultRestoredTab(
const content::WebContents* contents) {
- scoped_ptr<tabs::Tab> tab(tabs::Tab::FromValue(
- *ExtensionTabUtil::CreateTabValue(contents, GetExtension())));
+ scoped_ptr<DictionaryValue> tab_value(
+ ExtensionTabUtil::CreateTabValue(contents, GetExtension()));
+ scoped_ptr<tabs::Tab> tab(tabs::Tab::FromValue(*tab_value));
scoped_ptr<api::sessions::Session> restored_session(CreateSessionModelHelper(
base::Time::Now().ToTimeT(),
tab.Pass(),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698