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

Side by Side Diff: Source/modules/serviceworkers/NavigatorServiceWorker.h

Issue 1305903007: Add ASSERT() to avoid accidental leaking ServiceWorkerContainer to cross origin context. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | Source/modules/serviceworkers/NavigatorServiceWorker.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NavigatorServiceWorker_h 5 #ifndef NavigatorServiceWorker_h
6 #define NavigatorServiceWorker_h 6 #define NavigatorServiceWorker_h
7 7
8 #include "core/frame/Navigator.h" 8 #include "core/frame/Navigator.h"
9 #include "modules/ModulesExport.h" 9 #include "modules/ModulesExport.h"
10 #include "platform/Supplementable.h" 10 #include "platform/Supplementable.h"
11 #include "platform/heap/Handle.h" 11 #include "platform/heap/Handle.h"
12 12
13 namespace blink { 13 namespace blink {
14 14
15 class Document; 15 class Document;
16 class ExceptionState; 16 class ExceptionState;
17 class Navigator; 17 class Navigator;
18 class ServiceWorkerContainer; 18 class ServiceWorkerContainer;
19 19
20 class MODULES_EXPORT NavigatorServiceWorker final : public GarbageCollectedFinal ized<NavigatorServiceWorker>, public HeapSupplement<Navigator>, public DOMWindow Property { 20 class MODULES_EXPORT NavigatorServiceWorker final : public GarbageCollectedFinal ized<NavigatorServiceWorker>, public HeapSupplement<Navigator>, public DOMWindow Property {
21 USING_GARBAGE_COLLECTED_MIXIN(NavigatorServiceWorker); 21 USING_GARBAGE_COLLECTED_MIXIN(NavigatorServiceWorker);
22 public: 22 public:
23 static NavigatorServiceWorker* from(Document&); 23 static NavigatorServiceWorker* from(Document&);
24 static NavigatorServiceWorker& from(Navigator&); 24 static NavigatorServiceWorker& from(Navigator&);
25 static NavigatorServiceWorker* toNavigatorServiceWorker(Navigator&); 25 static NavigatorServiceWorker* toNavigatorServiceWorker(Navigator&);
26 26
27 virtual ~NavigatorServiceWorker(); 27 virtual ~NavigatorServiceWorker();
28 28
29 static ServiceWorkerContainer* serviceWorker(Navigator&, ExceptionState&); 29 static ServiceWorkerContainer* serviceWorker(ExecutionContext*, Navigator&, ExceptionState&);
30 30
31 DECLARE_VIRTUAL_TRACE(); 31 DECLARE_VIRTUAL_TRACE();
32 32
33 private: 33 private:
34 explicit NavigatorServiceWorker(Navigator&); 34 explicit NavigatorServiceWorker(Navigator&);
35 ServiceWorkerContainer* serviceWorker(ExceptionState&); 35 ServiceWorkerContainer* serviceWorker(ExceptionState&);
36 36
37 static const char* supplementName(); 37 static const char* supplementName();
38 38
39 // DOMWindowProperty override. 39 // DOMWindowProperty override.
40 void willDetachGlobalObjectFromFrame() override; 40 void willDetachGlobalObjectFromFrame() override;
41 41
42 Member<ServiceWorkerContainer> m_serviceWorker; 42 Member<ServiceWorkerContainer> m_serviceWorker;
43 }; 43 };
44 44
45 } // namespace blink 45 } // namespace blink
46 46
47 #endif // NavigatorServiceWorker_h 47 #endif // NavigatorServiceWorker_h
OLDNEW
« no previous file with comments | « no previous file | Source/modules/serviceworkers/NavigatorServiceWorker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698