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

Side by Side Diff: Source/modules/indexeddb/DOMWindowIndexedDatabase.cpp

Issue 683013002: Extract a DOMWindow interface from LocalDOMWindow and use it in the idl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix incorrect assumption Created 6 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, Google Inc. All rights reserved. 2 * Copyright (C) 2011, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met: 5 * modification, are permitted provided that the following conditions are met:
6 * 6 *
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 m_idbFactory = nullptr; 68 m_idbFactory = nullptr;
69 DOMWindowProperty::willDestroyGlobalObjectInFrame(); 69 DOMWindowProperty::willDestroyGlobalObjectInFrame();
70 } 70 }
71 71
72 void DOMWindowIndexedDatabase::willDetachGlobalObjectFromFrame() 72 void DOMWindowIndexedDatabase::willDetachGlobalObjectFromFrame()
73 { 73 {
74 m_idbFactory = nullptr; 74 m_idbFactory = nullptr;
75 DOMWindowProperty::willDetachGlobalObjectFromFrame(); 75 DOMWindowProperty::willDetachGlobalObjectFromFrame();
76 } 76 }
77 77
78 IDBFactory* DOMWindowIndexedDatabase::indexedDB(LocalDOMWindow& window) 78 IDBFactory* DOMWindowIndexedDatabase::indexedDB(DOMWindow& window)
haraken 2014/11/08 09:17:25 Ditto.
79 { 79 {
80 return from(window).indexedDB(); 80 return from(toLocalDOMWindow(window)).indexedDB();
81 } 81 }
82 82
83 IDBFactory* DOMWindowIndexedDatabase::indexedDB() 83 IDBFactory* DOMWindowIndexedDatabase::indexedDB()
84 { 84 {
85 Document* document = m_window.document(); 85 Document* document = m_window.document();
86 if (!document) 86 if (!document)
87 return 0; 87 return 0;
88 88
89 Page* page = document->page(); 89 Page* page = document->page();
90 if (!page) 90 if (!page)
91 return 0; 91 return 0;
92 92
93 if (!m_window.isCurrentlyDisplayedInFrame()) 93 if (!m_window.isCurrentlyDisplayedInFrame())
94 return 0; 94 return 0;
95 95
96 if (!m_idbFactory) 96 if (!m_idbFactory)
97 m_idbFactory = IDBFactory::create(IndexedDBClient::create()); 97 m_idbFactory = IDBFactory::create(IndexedDBClient::create());
98 return m_idbFactory.get(); 98 return m_idbFactory.get();
99 } 99 }
100 100
101 } // namespace blink 101 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698