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

Unified Diff: Source/modules/indexeddb/DOMWindowIndexedDatabase.cpp

Issue 165443003: Pass implementation object to supplemental classes by reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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: Source/modules/indexeddb/DOMWindowIndexedDatabase.cpp
diff --git a/Source/modules/indexeddb/DOMWindowIndexedDatabase.cpp b/Source/modules/indexeddb/DOMWindowIndexedDatabase.cpp
index b77178acf4df93ef5099dd8bb74fd066240007ef..768feea0e062cc17462ab67aa9209cdbdb53bbd4 100644
--- a/Source/modules/indexeddb/DOMWindowIndexedDatabase.cpp
+++ b/Source/modules/indexeddb/DOMWindowIndexedDatabase.cpp
@@ -34,8 +34,8 @@
namespace WebCore {
-DOMWindowIndexedDatabase::DOMWindowIndexedDatabase(DOMWindow* window)
- : DOMWindowProperty(window->frame())
+DOMWindowIndexedDatabase::DOMWindowIndexedDatabase(DOMWindow& window)
+ : DOMWindowProperty(window.frame())
, m_window(window)
{
}
@@ -49,14 +49,14 @@ const char* DOMWindowIndexedDatabase::supplementName()
return "DOMWindowIndexedDatabase";
}
-DOMWindowIndexedDatabase* DOMWindowIndexedDatabase::from(DOMWindow* window)
+DOMWindowIndexedDatabase& DOMWindowIndexedDatabase::from(DOMWindow& window)
{
DOMWindowIndexedDatabase* supplement = static_cast<DOMWindowIndexedDatabase*>(Supplement<DOMWindow>::from(window, supplementName()));
if (!supplement) {
supplement = new DOMWindowIndexedDatabase(window);
provideTo(window, supplementName(), adoptPtr(supplement));
}
- return supplement;
+ return *supplement;
}
void DOMWindowIndexedDatabase::willDestroyGlobalObjectInFrame()
@@ -71,14 +71,14 @@ void DOMWindowIndexedDatabase::willDetachGlobalObjectFromFrame()
DOMWindowProperty::willDetachGlobalObjectFromFrame();
}
-IDBFactory* DOMWindowIndexedDatabase::indexedDB(DOMWindow* window)
+IDBFactory* DOMWindowIndexedDatabase::indexedDB(DOMWindow& window)
{
- return from(window)->indexedDB();
+ return from(window).indexedDB();
}
IDBFactory* DOMWindowIndexedDatabase::indexedDB()
{
- Document* document = m_window->document();
+ Document* document = m_window.document();
if (!document)
return 0;
@@ -86,11 +86,11 @@ IDBFactory* DOMWindowIndexedDatabase::indexedDB()
if (!page)
return 0;
- if (!m_window->isCurrentlyDisplayedInFrame())
+ if (!m_window.isCurrentlyDisplayedInFrame())
return 0;
if (!m_idbFactory)
- m_idbFactory = IDBFactory::create(PageGroupIndexedDatabase::from(page->group())->factoryBackend());
+ m_idbFactory = IDBFactory::create(PageGroupIndexedDatabase::from(page->group()).factoryBackend());
return m_idbFactory.get();
}
« no previous file with comments | « Source/modules/indexeddb/DOMWindowIndexedDatabase.h ('k') | Source/modules/indexeddb/InspectorIndexedDBAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698