summaryrefslogtreecommitdiffstats
path: root/WebCore/history/mac
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-05 14:34:32 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-05 14:34:32 -0800
commit635860845790a19bf50bbc51ba8fb66a96dde068 (patch)
treeef6ad9ff73a5b57f65249d4232a202fa77e6a140 /WebCore/history/mac
parent8e35f3cfc7fba1d1c829dc557ebad6409cbe16a2 (diff)
downloadexternal_webkit-635860845790a19bf50bbc51ba8fb66a96dde068.zip
external_webkit-635860845790a19bf50bbc51ba8fb66a96dde068.tar.gz
external_webkit-635860845790a19bf50bbc51ba8fb66a96dde068.tar.bz2
auto import from //depot/cupcake/@136594
Diffstat (limited to 'WebCore/history/mac')
-rw-r--r--WebCore/history/mac/HistoryItemMac.mm24
1 files changed, 13 insertions, 11 deletions
diff --git a/WebCore/history/mac/HistoryItemMac.mm b/WebCore/history/mac/HistoryItemMac.mm
index cac9b1b..52ae7be 100644
--- a/WebCore/history/mac/HistoryItemMac.mm
+++ b/WebCore/history/mac/HistoryItemMac.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,10 +26,9 @@
#include "config.h"
#include "HistoryItem.h"
-namespace WebCore {
+#include "StringHash.h"
-// Notification strings.
-NSString *WebHistoryItemChangedNotification = @"WebHistoryItemChangedNotification";
+namespace WebCore {
id HistoryItem::viewState() const
{
@@ -52,14 +51,17 @@ id HistoryItem::getTransientProperty(const String& key) const
void HistoryItem::setTransientProperty(const String& key, id value)
{
- if (!m_transientProperties)
- m_transientProperties.set(new HashMap<String, RetainPtr<id> >);
- if (value == nil)
- m_transientProperties->remove(key);
- else
+ if (!value) {
+ if (m_transientProperties) {
+ m_transientProperties->remove(key);
+ if (m_transientProperties->isEmpty())
+ m_transientProperties.clear();
+ }
+ } else {
+ if (!m_transientProperties)
+ m_transientProperties.set(new HashMap<String, RetainPtr<id> >);
m_transientProperties->set(key, value);
+ }
}
} // namespace WebCore
-
-