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

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

Issue 171333003: Pass implementation object to supplemental classes by reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase 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 25375157b2a20c2459c28d4a523e3ef6a1270621..2f2df9cbef84c80488944ec3ddabbe6ba86e9091 100644
--- a/Source/modules/indexeddb/DOMWindowIndexedDatabase.cpp
+++ b/Source/modules/indexeddb/DOMWindowIndexedDatabase.cpp
@@ -33,8 +33,8 @@
namespace WebCore {
-DOMWindowIndexedDatabase::DOMWindowIndexedDatabase(DOMWindow* window)
- : DOMWindowProperty(window->frame())
+DOMWindowIndexedDatabase::DOMWindowIndexedDatabase(DOMWindow& window)
+ : DOMWindowProperty(window.frame())
, m_window(window)
{
}
@@ -48,14 +48,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()
@@ -70,14 +70,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;
@@ -85,7 +85,7 @@ IDBFactory* DOMWindowIndexedDatabase::indexedDB()
if (!page)
return 0;
- if (!m_window->isCurrentlyDisplayedInFrame())
+ if (!m_window.isCurrentlyDisplayedInFrame())
return 0;
if (!m_idbFactory)

Powered by Google App Engine
This is Rietveld 408576698