summaryrefslogtreecommitdiffstats
path: root/chrome/browser/history
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-30 18:12:22 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-30 18:12:22 +0000
commita39ebb776d61a09d7dc670dfab01b502e37d035e (patch)
tree527e90e7a2d587b14c1a7f8907c464c434ee2197 /chrome/browser/history
parentf46cb4b1dd434c59c5f1ee12221856cb03d4d226 (diff)
downloadchromium_src-a39ebb776d61a09d7dc670dfab01b502e37d035e.zip
chromium_src-a39ebb776d61a09d7dc670dfab01b502e37d035e.tar.gz
chromium_src-a39ebb776d61a09d7dc670dfab01b502e37d035e.tar.bz2
Fix potential memleak in AddPagesWithDetails. Not a biggie
since this is used only during testing, if the comment is correct. The reason this leaks is due to potential returns before Broadcast is reached. BUG=None TEST=None Review URL: http://codereview.chromium.org/151047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19610 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/history')
-rw-r--r--chrome/browser/history/history_backend.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc
index 066a757..691f24a 100644
--- a/chrome/browser/history/history_backend.cc
+++ b/chrome/browser/history/history_backend.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -161,7 +161,7 @@ class HistoryBackend::URLQuerier {
// When track_unique_ is set, this is updated with every URL seen so far.
std::set<GURL> unique_urls_;
- DISALLOW_EVIL_CONSTRUCTORS(URLQuerier);
+ DISALLOW_COPY_AND_ASSIGN(URLQuerier);
};
// HistoryBackend --------------------------------------------------------------
@@ -659,7 +659,7 @@ void HistoryBackend::AddPagesWithDetails(const std::vector<URLRow>& urls) {
if (!db_.get())
return;
- URLsModifiedDetails* modified = new URLsModifiedDetails;
+ scoped_ptr<URLsModifiedDetails> modified(new URLsModifiedDetails);
for (std::vector<URLRow>::const_iterator i = urls.begin();
i != urls.end(); ++i) {
DCHECK(!i->last_visit().is_null());
@@ -732,7 +732,7 @@ void HistoryBackend::AddPagesWithDetails(const std::vector<URLRow>& urls) {
// TODO(brettw) bug 1140015: Add an "add page" notification so the history
// views can keep in sync.
BroadcastNotifications(NotificationType::HISTORY_TYPED_URLS_MODIFIED,
- modified);
+ modified.release());
ScheduleCommit();
}