diff options
author | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-07 16:59:41 +0000 |
---|---|---|
committer | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-07 16:59:41 +0000 |
commit | 5f2aa727f81adfb0dc9c3e34b0d777e52091c664 (patch) | |
tree | ac857fa2a4251d89ba829c77fff8a629f391d239 /content/renderer/dom_storage | |
parent | 5dff8195c05331bfda451a2b135c8965095637ab (diff) | |
download | chromium_src-5f2aa727f81adfb0dc9c3e34b0d777e52091c664.zip chromium_src-5f2aa727f81adfb0dc9c3e34b0d777e52091c664.tar.gz chromium_src-5f2aa727f81adfb0dc9c3e34b0d777e52091c664.tar.bz2 |
Move webkit/{browser,common}/dom_storage into content/
Mechanical changes only, directory moving +
* renamed all DomStorage* to DOMStorage* for consistency
* renamed DOMStorageContextImpl to DOMStorageContextProxy, and renamed DomStorageContext to DOMStorageContextImpl
* other minor cleanups
Diff for dom_storage_context_impl.* may look a bit messy
due to chained renames (it's just replaced with former
webkit/browser/dom_storage/dom_storage_context.*)
BUG=265769
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/22297005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@216211 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/dom_storage')
10 files changed, 114 insertions, 114 deletions
diff --git a/content/renderer/dom_storage/OWNERS b/content/renderer/dom_storage/OWNERS index 66ceac5..e1e6b1b 100644 --- a/content/renderer/dom_storage/OWNERS +++ b/content/renderer/dom_storage/OWNERS @@ -1,2 +1,7 @@ -marja@chromium.org michaeln@chromium.org +kinuko@chromium.org +jsbell@chromium.org +ericu@chromium.org +marja@chromium.org + +# Please include michaeln@ or marja@ if you make any functional/runtime changes. diff --git a/content/renderer/dom_storage/dom_storage_cached_area.cc b/content/renderer/dom_storage/dom_storage_cached_area.cc index a0203bb..a01d3c6 100644 --- a/content/renderer/dom_storage/dom_storage_cached_area.cc +++ b/content/renderer/dom_storage/dom_storage_cached_area.cc @@ -7,47 +7,47 @@ #include "base/basictypes.h" #include "base/metrics/histogram.h" #include "base/time/time.h" +#include "content/common/dom_storage/dom_storage_map.h" #include "content/renderer/dom_storage/dom_storage_proxy.h" -#include "webkit/common/dom_storage/dom_storage_map.h" namespace content { -DomStorageCachedArea::DomStorageCachedArea(int64 namespace_id, +DOMStorageCachedArea::DOMStorageCachedArea(int64 namespace_id, const GURL& origin, - DomStorageProxy* proxy) + DOMStorageProxy* proxy) : ignore_all_mutations_(false), namespace_id_(namespace_id), origin_(origin), proxy_(proxy), weak_factory_(this) {} -DomStorageCachedArea::~DomStorageCachedArea() {} +DOMStorageCachedArea::~DOMStorageCachedArea() {} -unsigned DomStorageCachedArea::GetLength(int connection_id) { +unsigned DOMStorageCachedArea::GetLength(int connection_id) { PrimeIfNeeded(connection_id); return map_->Length(); } -base::NullableString16 DomStorageCachedArea::GetKey(int connection_id, +base::NullableString16 DOMStorageCachedArea::GetKey(int connection_id, unsigned index) { PrimeIfNeeded(connection_id); return map_->Key(index); } -base::NullableString16 DomStorageCachedArea::GetItem( +base::NullableString16 DOMStorageCachedArea::GetItem( int connection_id, const base::string16& key) { PrimeIfNeeded(connection_id); return map_->GetItem(key); } -bool DomStorageCachedArea::SetItem(int connection_id, +bool DOMStorageCachedArea::SetItem(int connection_id, const base::string16& key, const base::string16& value, const GURL& page_url) { // A quick check to reject obviously overbudget items to avoid // the priming the cache. - if (key.length() + value.length() > dom_storage::kPerAreaQuota) + if (key.length() + value.length() > kPerStorageAreaQuota) return false; PrimeIfNeeded(connection_id); @@ -59,12 +59,12 @@ bool DomStorageCachedArea::SetItem(int connection_id, ignore_key_mutations_[key]++; proxy_->SetItem( connection_id, key, value, page_url, - base::Bind(&DomStorageCachedArea::OnSetItemComplete, + base::Bind(&DOMStorageCachedArea::OnSetItemComplete, weak_factory_.GetWeakPtr(), key)); return true; } -void DomStorageCachedArea::RemoveItem(int connection_id, +void DOMStorageCachedArea::RemoveItem(int connection_id, const base::string16& key, const GURL& page_url) { PrimeIfNeeded(connection_id); @@ -76,24 +76,24 @@ void DomStorageCachedArea::RemoveItem(int connection_id, ignore_key_mutations_[key]++; proxy_->RemoveItem( connection_id, key, page_url, - base::Bind(&DomStorageCachedArea::OnRemoveItemComplete, + base::Bind(&DOMStorageCachedArea::OnRemoveItemComplete, weak_factory_.GetWeakPtr(), key)); } -void DomStorageCachedArea::Clear(int connection_id, const GURL& page_url) { +void DOMStorageCachedArea::Clear(int connection_id, const GURL& page_url) { // No need to prime the cache in this case. Reset(); - map_ = new dom_storage::DomStorageMap(dom_storage::kPerAreaQuota); + map_ = new DOMStorageMap(kPerStorageAreaQuota); // Ignore all mutations until OnClearComplete time. ignore_all_mutations_ = true; proxy_->ClearArea(connection_id, page_url, - base::Bind(&DomStorageCachedArea::OnClearComplete, + base::Bind(&DOMStorageCachedArea::OnClearComplete, weak_factory_.GetWeakPtr())); } -void DomStorageCachedArea::ApplyMutation( +void DOMStorageCachedArea::ApplyMutation( const base::NullableString16& key, const base::NullableString16& new_value) { if (!map_.get() || ignore_all_mutations_) @@ -101,8 +101,8 @@ void DomStorageCachedArea::ApplyMutation( if (key.is_null()) { // It's a clear event. - scoped_refptr<dom_storage::DomStorageMap> old = map_; - map_ = new dom_storage::DomStorageMap(dom_storage::kPerAreaQuota); + scoped_refptr<DOMStorageMap> old = map_; + map_ = new DOMStorageMap(kPerStorageAreaQuota); // We have to retain local additions which happened after this // clear operation from another process. @@ -136,14 +136,14 @@ void DomStorageCachedArea::ApplyMutation( base::NullableString16 unused; map_->set_quota(kint32max); map_->SetItem(key.string(), new_value.string(), &unused); - map_->set_quota(dom_storage::kPerAreaQuota); + map_->set_quota(kPerStorageAreaQuota); } -size_t DomStorageCachedArea::MemoryBytesUsedByCache() const { +size_t DOMStorageCachedArea::MemoryBytesUsedByCache() const { return map_.get() ? map_->bytes_used() : 0; } -void DomStorageCachedArea::Prime(int connection_id) { +void DOMStorageCachedArea::Prime(int connection_id) { DCHECK(!map_.get()); // The LoadArea method is actually synchronous, but we have to @@ -154,18 +154,18 @@ void DomStorageCachedArea::Prime(int connection_id) { // Ignore all mutations until OnLoadComplete time. ignore_all_mutations_ = true; - dom_storage::ValuesMap values; + DOMStorageValuesMap values; base::TimeTicks before = base::TimeTicks::Now(); proxy_->LoadArea(connection_id, &values, - base::Bind(&DomStorageCachedArea::OnLoadComplete, + base::Bind(&DOMStorageCachedArea::OnLoadComplete, weak_factory_.GetWeakPtr())); base::TimeDelta time_to_prime = base::TimeTicks::Now() - before; // Keeping this histogram named the same (without the ForRenderer suffix) // to maintain histogram continuity. UMA_HISTOGRAM_TIMES("LocalStorage.TimeToPrimeLocalStorage", time_to_prime); - map_ = new dom_storage::DomStorageMap(dom_storage::kPerAreaQuota); + map_ = new DOMStorageMap(kPerStorageAreaQuota); map_->SwapValues(&values); size_t local_storage_size_kb = map_->bytes_used() / 1024; @@ -190,20 +190,20 @@ void DomStorageCachedArea::Prime(int connection_id) { } } -void DomStorageCachedArea::Reset() { +void DOMStorageCachedArea::Reset() { map_ = NULL; weak_factory_.InvalidateWeakPtrs(); ignore_key_mutations_.clear(); ignore_all_mutations_ = false; } -void DomStorageCachedArea::OnLoadComplete(bool success) { +void DOMStorageCachedArea::OnLoadComplete(bool success) { DCHECK(success); DCHECK(ignore_all_mutations_); ignore_all_mutations_ = false; } -void DomStorageCachedArea::OnSetItemComplete(const base::string16& key, +void DOMStorageCachedArea::OnSetItemComplete(const base::string16& key, bool success) { if (!success) { Reset(); @@ -216,7 +216,7 @@ void DomStorageCachedArea::OnSetItemComplete(const base::string16& key, ignore_key_mutations_.erase(found); } -void DomStorageCachedArea::OnRemoveItemComplete(const base::string16& key, +void DOMStorageCachedArea::OnRemoveItemComplete(const base::string16& key, bool success) { DCHECK(success); std::map<base::string16, int>::iterator found = @@ -226,7 +226,7 @@ void DomStorageCachedArea::OnRemoveItemComplete(const base::string16& key, ignore_key_mutations_.erase(found); } -void DomStorageCachedArea::OnClearComplete(bool success) { +void DOMStorageCachedArea::OnClearComplete(bool success) { DCHECK(success); DCHECK(ignore_all_mutations_); ignore_all_mutations_ = false; diff --git a/content/renderer/dom_storage/dom_storage_cached_area.h b/content/renderer/dom_storage/dom_storage_cached_area.h index 2aa4cd9..b991038 100644 --- a/content/renderer/dom_storage/dom_storage_cached_area.h +++ b/content/renderer/dom_storage/dom_storage_cached_area.h @@ -13,13 +13,10 @@ #include "content/common/content_export.h" #include "url/gurl.h" -namespace dom_storage { -class DomStorageMap; -} - namespace content { -class DomStorageProxy; +class DOMStorageMap; +class DOMStorageProxy; // Unlike the other classes in the dom_storage library, this one is intended // for use in renderer processes. It maintains a complete cache of the @@ -27,12 +24,12 @@ class DomStorageProxy; // first access and changes are written to the backend thru the |proxy|. // Mutations originating in other processes are applied to the cache via // the ApplyMutation method. -class CONTENT_EXPORT DomStorageCachedArea - : public base::RefCounted<DomStorageCachedArea> { +class CONTENT_EXPORT DOMStorageCachedArea + : public base::RefCounted<DOMStorageCachedArea> { public: - DomStorageCachedArea(int64 namespace_id, + DOMStorageCachedArea(int64 namespace_id, const GURL& origin, - DomStorageProxy* proxy); + DOMStorageProxy* proxy); int64 namespace_id() const { return namespace_id_; } const GURL& origin() const { return origin_; } @@ -55,9 +52,9 @@ class CONTENT_EXPORT DomStorageCachedArea size_t MemoryBytesUsedByCache() const; private: - friend class DomStorageCachedAreaTest; - friend class base::RefCounted<DomStorageCachedArea>; - ~DomStorageCachedArea(); + friend class DOMStorageCachedAreaTest; + friend class base::RefCounted<DOMStorageCachedArea>; + ~DOMStorageCachedArea(); // Primes the cache, loading all values for the area. void Prime(int connection_id); @@ -87,9 +84,9 @@ class CONTENT_EXPORT DomStorageCachedArea int64 namespace_id_; GURL origin_; - scoped_refptr<dom_storage::DomStorageMap> map_; - scoped_refptr<DomStorageProxy> proxy_; - base::WeakPtrFactory<DomStorageCachedArea> weak_factory_; + scoped_refptr<DOMStorageMap> map_; + scoped_refptr<DOMStorageProxy> proxy_; + base::WeakPtrFactory<DOMStorageCachedArea> weak_factory_; }; } // namespace content diff --git a/content/renderer/dom_storage/dom_storage_cached_area_unittest.cc b/content/renderer/dom_storage/dom_storage_cached_area_unittest.cc index 9dcef95..ada36d7 100644 --- a/content/renderer/dom_storage/dom_storage_cached_area_unittest.cc +++ b/content/renderer/dom_storage/dom_storage_cached_area_unittest.cc @@ -14,17 +14,17 @@ namespace content { namespace { -// A mock implementation of the DomStorageProxy interface. -class MockProxy : public DomStorageProxy { +// A mock implementation of the DOMStorageProxy interface. +class MockProxy : public DOMStorageProxy { public: MockProxy() { ResetObservations(); } - // DomStorageProxy interface for use by DomStorageCachedArea. + // DOMStorageProxy interface for use by DOMStorageCachedArea. virtual void LoadArea(int connection_id, - dom_storage::ValuesMap* values, + DOMStorageValuesMap* values, const CompletionCallback& callback) OVERRIDE { pending_callbacks_.push_back(callback); observed_load_area_ = true; @@ -91,7 +91,7 @@ class MockProxy : public DomStorageProxy { typedef std::list<CompletionCallback> CallbackList; - dom_storage::ValuesMap load_area_return_values_; + DOMStorageValuesMap load_area_return_values_; CallbackList pending_callbacks_; bool observed_load_area_; bool observed_set_item_; @@ -108,9 +108,9 @@ class MockProxy : public DomStorageProxy { } // namespace -class DomStorageCachedAreaTest : public testing::Test { +class DOMStorageCachedAreaTest : public testing::Test { public: - DomStorageCachedAreaTest() + DOMStorageCachedAreaTest() : kNamespaceId(10), kOrigin("http://dom_storage/"), kKey(ASCIIToUTF16("key")), @@ -128,26 +128,26 @@ class DomStorageCachedAreaTest : public testing::Test { mock_proxy_ = new MockProxy(); } - bool IsPrimed(DomStorageCachedArea* cached_area) { + bool IsPrimed(DOMStorageCachedArea* cached_area) { return cached_area->map_.get(); } - bool IsIgnoringAllMutations(DomStorageCachedArea* cached_area) { + bool IsIgnoringAllMutations(DOMStorageCachedArea* cached_area) { return cached_area->ignore_all_mutations_; } - bool IsIgnoringKeyMutations(DomStorageCachedArea* cached_area, + bool IsIgnoringKeyMutations(DOMStorageCachedArea* cached_area, const base::string16& key) { return cached_area->should_ignore_key_mutation(key); } - void ResetAll(DomStorageCachedArea* cached_area) { + void ResetAll(DOMStorageCachedArea* cached_area) { cached_area->Reset(); mock_proxy_->ResetObservations(); mock_proxy_->pending_callbacks_.clear(); } - void ResetCacheOnly(DomStorageCachedArea* cached_area) { + void ResetCacheOnly(DOMStorageCachedArea* cached_area) { cached_area->Reset(); } @@ -155,10 +155,10 @@ class DomStorageCachedAreaTest : public testing::Test { scoped_refptr<MockProxy> mock_proxy_; }; -TEST_F(DomStorageCachedAreaTest, Basics) { +TEST_F(DOMStorageCachedAreaTest, Basics) { EXPECT_TRUE(mock_proxy_->HasOneRef()); - scoped_refptr<DomStorageCachedArea> cached_area = - new DomStorageCachedArea(kNamespaceId, kOrigin, mock_proxy_.get()); + scoped_refptr<DOMStorageCachedArea> cached_area = + new DOMStorageCachedArea(kNamespaceId, kOrigin, mock_proxy_.get()); EXPECT_EQ(kNamespaceId, cached_area->namespace_id()); EXPECT_EQ(kOrigin, cached_area->origin()); EXPECT_FALSE(mock_proxy_->HasOneRef()); @@ -180,10 +180,10 @@ TEST_F(DomStorageCachedAreaTest, Basics) { EXPECT_EQ(0u, cached_area->GetLength(kConnectionId)); } -TEST_F(DomStorageCachedAreaTest, Getters) { +TEST_F(DOMStorageCachedAreaTest, Getters) { const int kConnectionId = 7; - scoped_refptr<DomStorageCachedArea> cached_area = - new DomStorageCachedArea(kNamespaceId, kOrigin, mock_proxy_.get()); + scoped_refptr<DOMStorageCachedArea> cached_area = + new DOMStorageCachedArea(kNamespaceId, kOrigin, mock_proxy_.get()); // GetLength, we expect to see one call to load in the proxy. EXPECT_FALSE(IsPrimed(cached_area.get())); @@ -215,10 +215,10 @@ TEST_F(DomStorageCachedAreaTest, Getters) { EXPECT_EQ(1u, mock_proxy_->pending_callbacks_.size()); } -TEST_F(DomStorageCachedAreaTest, Setters) { +TEST_F(DOMStorageCachedAreaTest, Setters) { const int kConnectionId = 7; - scoped_refptr<DomStorageCachedArea> cached_area = - new DomStorageCachedArea(kNamespaceId, kOrigin, mock_proxy_.get()); + scoped_refptr<DOMStorageCachedArea> cached_area = + new DOMStorageCachedArea(kNamespaceId, kOrigin, mock_proxy_.get()); // SetItem, we expect a call to load followed by a call to set item // in the proxy. @@ -270,10 +270,10 @@ TEST_F(DomStorageCachedAreaTest, Setters) { EXPECT_EQ(2u, mock_proxy_->pending_callbacks_.size()); } -TEST_F(DomStorageCachedAreaTest, MutationsAreIgnoredUntilLoadCompletion) { +TEST_F(DOMStorageCachedAreaTest, MutationsAreIgnoredUntilLoadCompletion) { const int kConnectionId = 7; - scoped_refptr<DomStorageCachedArea> cached_area = - new DomStorageCachedArea(kNamespaceId, kOrigin, mock_proxy_.get()); + scoped_refptr<DOMStorageCachedArea> cached_area = + new DOMStorageCachedArea(kNamespaceId, kOrigin, mock_proxy_.get()); EXPECT_TRUE(cached_area->GetItem(kConnectionId, kKey).is_null()); EXPECT_TRUE(IsPrimed(cached_area.get())); EXPECT_TRUE(IsIgnoringAllMutations(cached_area.get())); @@ -293,10 +293,10 @@ TEST_F(DomStorageCachedAreaTest, MutationsAreIgnoredUntilLoadCompletion) { EXPECT_EQ(kValue, cached_area->GetItem(kConnectionId, kKey).string()); } -TEST_F(DomStorageCachedAreaTest, MutationsAreIgnoredUntilClearCompletion) { +TEST_F(DOMStorageCachedAreaTest, MutationsAreIgnoredUntilClearCompletion) { const int kConnectionId = 4; - scoped_refptr<DomStorageCachedArea> cached_area = - new DomStorageCachedArea(kNamespaceId, kOrigin, mock_proxy_.get()); + scoped_refptr<DOMStorageCachedArea> cached_area = + new DOMStorageCachedArea(kNamespaceId, kOrigin, mock_proxy_.get()); cached_area->Clear(kConnectionId, kPageUrl); EXPECT_TRUE(IsIgnoringAllMutations(cached_area.get())); mock_proxy_->CompleteOnePendingCallback(true); @@ -315,10 +315,10 @@ TEST_F(DomStorageCachedAreaTest, MutationsAreIgnoredUntilClearCompletion) { EXPECT_FALSE(IsIgnoringAllMutations(cached_area.get())); } -TEST_F(DomStorageCachedAreaTest, KeyMutationsAreIgnoredUntilCompletion) { +TEST_F(DOMStorageCachedAreaTest, KeyMutationsAreIgnoredUntilCompletion) { const int kConnectionId = 8; - scoped_refptr<DomStorageCachedArea> cached_area = - new DomStorageCachedArea(kNamespaceId, kOrigin, mock_proxy_.get()); + scoped_refptr<DOMStorageCachedArea> cached_area = + new DOMStorageCachedArea(kNamespaceId, kOrigin, mock_proxy_.get()); // SetItem EXPECT_TRUE(cached_area->SetItem(kConnectionId, kKey, kValue, kPageUrl)); @@ -353,4 +353,4 @@ TEST_F(DomStorageCachedAreaTest, KeyMutationsAreIgnoredUntilCompletion) { EXPECT_FALSE(IsPrimed(cached_area.get())); } -} // namespace dom_storage +} // namespace content diff --git a/content/renderer/dom_storage/dom_storage_dispatcher.cc b/content/renderer/dom_storage/dom_storage_dispatcher.cc index 3cab4fe..a8a37c9 100644 --- a/content/renderer/dom_storage/dom_storage_dispatcher.cc +++ b/content/renderer/dom_storage/dom_storage_dispatcher.cc @@ -9,7 +9,8 @@ #include "base/strings/string_number_conversions.h" #include "base/synchronization/lock.h" -#include "content/common/dom_storage_messages.h" +#include "content/common/dom_storage/dom_storage_messages.h" +#include "content/common/dom_storage/dom_storage_types.h" #include "content/renderer/dom_storage/dom_storage_cached_area.h" #include "content/renderer/dom_storage/dom_storage_proxy.h" #include "content/renderer/dom_storage/webstoragearea_impl.h" @@ -18,9 +19,6 @@ #include "third_party/WebKit/public/platform/Platform.h" #include "third_party/WebKit/public/web/WebKit.h" #include "third_party/WebKit/public/web/WebStorageEventDispatcher.h" -#include "webkit/common/dom_storage/dom_storage_types.h" - -using dom_storage::ValuesMap; namespace content { @@ -92,24 +90,24 @@ bool MessageThrottlingFilter::OnMessageReceived(const IPC::Message& message) { } // namespace // ProxyImpl ----------------------------------------------------- -// An implementation of the DomStorageProxy interface in terms of IPC. +// An implementation of the DOMStorageProxy interface in terms of IPC. // This class also manages the collection of cached areas and pending // operations awaiting completion callbacks. -class DomStorageDispatcher::ProxyImpl : public DomStorageProxy { +class DomStorageDispatcher::ProxyImpl : public DOMStorageProxy { public: explicit ProxyImpl(RenderThreadImpl* sender); // Methods for use by DomStorageDispatcher directly. - DomStorageCachedArea* OpenCachedArea( + DOMStorageCachedArea* OpenCachedArea( int64 namespace_id, const GURL& origin); - void CloseCachedArea(DomStorageCachedArea* area); - DomStorageCachedArea* LookupCachedArea( + void CloseCachedArea(DOMStorageCachedArea* area); + DOMStorageCachedArea* LookupCachedArea( int64 namespace_id, const GURL& origin); void CompleteOnePendingCallback(bool success); void Shutdown(); - // DomStorageProxy interface for use by DomStorageCachedArea. - virtual void LoadArea(int connection_id, ValuesMap* values, + // DOMStorageProxy interface for use by DOMStorageCachedArea. + virtual void LoadArea(int connection_id, DOMStorageValuesMap* values, const CompletionCallback& callback) OVERRIDE; virtual void SetItem(int connection_id, const string16& key, const string16& value, const GURL& page_url, @@ -125,10 +123,10 @@ class DomStorageDispatcher::ProxyImpl : public DomStorageProxy { // Struct to hold references to our contained areas and // to keep track of how many tabs have a given area open. struct CachedAreaHolder { - scoped_refptr<DomStorageCachedArea> area_; + scoped_refptr<DOMStorageCachedArea> area_; int open_count_; CachedAreaHolder() : open_count_(0) {} - CachedAreaHolder(DomStorageCachedArea* area, int count) + CachedAreaHolder(DOMStorageCachedArea* area, int count) : area_(area), open_count_(count) {} }; typedef std::map<std::string, CachedAreaHolder> CachedAreaMap; @@ -176,21 +174,21 @@ DomStorageDispatcher::ProxyImpl::ProxyImpl(RenderThreadImpl* sender) sender_->AddFilter(throttling_filter_.get()); } -DomStorageCachedArea* DomStorageDispatcher::ProxyImpl::OpenCachedArea( +DOMStorageCachedArea* DomStorageDispatcher::ProxyImpl::OpenCachedArea( int64 namespace_id, const GURL& origin) { std::string key = GetCachedAreaKey(namespace_id, origin); if (CachedAreaHolder* holder = GetAreaHolder(key)) { ++(holder->open_count_); return holder->area_.get(); } - scoped_refptr<DomStorageCachedArea> area = - new DomStorageCachedArea(namespace_id, origin, this); + scoped_refptr<DOMStorageCachedArea> area = + new DOMStorageCachedArea(namespace_id, origin, this); cached_areas_[key] = CachedAreaHolder(area.get(), 1); return area.get(); } void DomStorageDispatcher::ProxyImpl::CloseCachedArea( - DomStorageCachedArea* area) { + DOMStorageCachedArea* area) { std::string key = GetCachedAreaKey(area->namespace_id(), area->origin()); CachedAreaHolder* holder = GetAreaHolder(key); DCHECK(holder); @@ -201,7 +199,7 @@ void DomStorageDispatcher::ProxyImpl::CloseCachedArea( } } -DomStorageCachedArea* DomStorageDispatcher::ProxyImpl::LookupCachedArea( +DOMStorageCachedArea* DomStorageDispatcher::ProxyImpl::LookupCachedArea( int64 namespace_id, const GURL& origin) { std::string key = GetCachedAreaKey(namespace_id, origin); CachedAreaHolder* holder = GetAreaHolder(key); @@ -223,7 +221,7 @@ void DomStorageDispatcher::ProxyImpl::Shutdown() { } void DomStorageDispatcher::ProxyImpl::LoadArea( - int connection_id, ValuesMap* values, + int connection_id, DOMStorageValuesMap* values, const CompletionCallback& callback) { PushPendingCallback(callback); throttling_filter_->SendThrottled(new DOMStorageHostMsg_LoadStorageArea( @@ -265,7 +263,7 @@ DomStorageDispatcher::~DomStorageDispatcher() { proxy_->Shutdown(); } -scoped_refptr<DomStorageCachedArea> DomStorageDispatcher::OpenCachedArea( +scoped_refptr<DOMStorageCachedArea> DomStorageDispatcher::OpenCachedArea( int connection_id, int64 namespace_id, const GURL& origin) { RenderThreadImpl::current()->Send( new DOMStorageHostMsg_OpenStorageArea( @@ -274,7 +272,7 @@ scoped_refptr<DomStorageCachedArea> DomStorageDispatcher::OpenCachedArea( } void DomStorageDispatcher::CloseCachedArea( - int connection_id, DomStorageCachedArea* area) { + int connection_id, DOMStorageCachedArea* area) { RenderThreadImpl::current()->Send( new DOMStorageHostMsg_CloseStorageArea(connection_id)); proxy_->CloseCachedArea(area); @@ -301,13 +299,13 @@ void DomStorageDispatcher::OnStorageEvent( originating_area = WebStorageAreaImpl::FromConnectionId( params.connection_id); } else { - DomStorageCachedArea* cached_area = proxy_->LookupCachedArea( + DOMStorageCachedArea* cached_area = proxy_->LookupCachedArea( params.namespace_id, params.origin); if (cached_area) cached_area->ApplyMutation(params.key, params.new_value); } - if (params.namespace_id == dom_storage::kLocalStorageNamespaceId) { + if (params.namespace_id == kLocalStorageNamespaceId) { WebKit::WebStorageEventDispatcher::dispatchLocalStorageEvent( params.key, params.old_value, diff --git a/content/renderer/dom_storage/dom_storage_dispatcher.h b/content/renderer/dom_storage/dom_storage_dispatcher.h index f5d4004..f395d57 100644 --- a/content/renderer/dom_storage/dom_storage_dispatcher.h +++ b/content/renderer/dom_storage/dom_storage_dispatcher.h @@ -16,23 +16,23 @@ class Message; namespace content { -class DomStorageCachedArea; +class DOMStorageCachedArea; // Dispatches DomStorage related messages sent to a renderer process from the // main browser process. There is one instance per child process. Messages // are dispatched on the main renderer thread. The RenderThreadImpl // creates an instance and delegates calls to it. This classes also manages -// the collection of DomStorageCachedAreas that are active in the process. +// the collection of DOMStorageCachedAreas that are active in the process. class DomStorageDispatcher { public: DomStorageDispatcher(); ~DomStorageDispatcher(); // Each call to open should be balanced with a call to close. - scoped_refptr<DomStorageCachedArea> OpenCachedArea(int connection_id, + scoped_refptr<DOMStorageCachedArea> OpenCachedArea(int connection_id, int64 namespace_id, const GURL& origin); - void CloseCachedArea(int connection_id, DomStorageCachedArea* area); + void CloseCachedArea(int connection_id, DOMStorageCachedArea* area); bool OnMessageReceived(const IPC::Message& msg); diff --git a/content/renderer/dom_storage/dom_storage_proxy.h b/content/renderer/dom_storage/dom_storage_proxy.h index 57fcfaf..80cd87c 100644 --- a/content/renderer/dom_storage/dom_storage_proxy.h +++ b/content/renderer/dom_storage/dom_storage_proxy.h @@ -9,18 +9,18 @@ #include "base/memory/ref_counted.h" #include "base/strings/nullable_string16.h" #include "base/strings/string16.h" +#include "content/common/dom_storage/dom_storage_types.h" #include "url/gurl.h" -#include "webkit/common/dom_storage/dom_storage_types.h" namespace content { // Abstract interface for cached area, renderer to browser communications. -class DomStorageProxy : public base::RefCounted<DomStorageProxy> { +class DOMStorageProxy : public base::RefCounted<DOMStorageProxy> { public: typedef base::Callback<void(bool)> CompletionCallback; virtual void LoadArea(int connection_id, - dom_storage::ValuesMap* values, + DOMStorageValuesMap* values, const CompletionCallback& callback) = 0; virtual void SetItem(int connection_id, @@ -39,8 +39,8 @@ class DomStorageProxy : public base::RefCounted<DomStorageProxy> { const CompletionCallback& callback) = 0; protected: - friend class base::RefCounted<DomStorageProxy>; - virtual ~DomStorageProxy() {} + friend class base::RefCounted<DOMStorageProxy>; + virtual ~DOMStorageProxy() {} }; } // namespace content diff --git a/content/renderer/dom_storage/webstoragearea_impl.cc b/content/renderer/dom_storage/webstoragearea_impl.cc index 72e9415..d5bf07d 100644 --- a/content/renderer/dom_storage/webstoragearea_impl.cc +++ b/content/renderer/dom_storage/webstoragearea_impl.cc @@ -8,7 +8,7 @@ #include "base/metrics/histogram.h" #include "base/strings/utf_string_conversions.h" #include "base/time/time.h" -#include "content/common/dom_storage_messages.h" +#include "content/common/dom_storage/dom_storage_messages.h" #include "content/renderer/dom_storage/dom_storage_cached_area.h" #include "content/renderer/dom_storage/dom_storage_dispatcher.h" #include "content/renderer/render_thread_impl.h" diff --git a/content/renderer/dom_storage/webstoragearea_impl.h b/content/renderer/dom_storage/webstoragearea_impl.h index 47d0581..7854562 100644 --- a/content/renderer/dom_storage/webstoragearea_impl.h +++ b/content/renderer/dom_storage/webstoragearea_impl.h @@ -14,7 +14,7 @@ class GURL; namespace content { -class DomStorageCachedArea; +class DOMStorageCachedArea; class WebStorageAreaImpl : public WebKit::WebStorageArea { public: @@ -37,7 +37,7 @@ class WebStorageAreaImpl : public WebKit::WebStorageArea { private: int connection_id_; - scoped_refptr<DomStorageCachedArea> cached_area_; + scoped_refptr<DOMStorageCachedArea> cached_area_; }; } // namespace content diff --git a/content/renderer/dom_storage/webstoragenamespace_impl.cc b/content/renderer/dom_storage/webstoragenamespace_impl.cc index de2b6c5..d5f1dc5 100644 --- a/content/renderer/dom_storage/webstoragenamespace_impl.cc +++ b/content/renderer/dom_storage/webstoragenamespace_impl.cc @@ -5,10 +5,10 @@ #include "content/renderer/dom_storage/webstoragenamespace_impl.h" #include "base/logging.h" +#include "content/common/dom_storage/dom_storage_types.h" #include "content/renderer/dom_storage/webstoragearea_impl.h" #include "third_party/WebKit/public/platform/WebString.h" #include "url/gurl.h" -#include "webkit/common/dom_storage/dom_storage_types.h" using WebKit::WebStorageArea; using WebKit::WebStorageNamespace; @@ -17,13 +17,13 @@ using WebKit::WebString; namespace content { WebStorageNamespaceImpl::WebStorageNamespaceImpl() - : namespace_id_(dom_storage::kLocalStorageNamespaceId) { + : namespace_id_(kLocalStorageNamespaceId) { } WebStorageNamespaceImpl::WebStorageNamespaceImpl( int64 namespace_id) : namespace_id_(namespace_id) { - DCHECK_NE(dom_storage::kInvalidSessionStorageNamespaceId, namespace_id); + DCHECK_NE(kInvalidSessionStorageNamespaceId, namespace_id); } WebStorageNamespaceImpl::~WebStorageNamespaceImpl() { |