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

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

Issue 1199183002: Throw a SecurityError when navigator.serviceWorker is accessed in a sandboxed iframe. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: use ASSERT_NO_EXCEPTION Created 5 years, 6 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
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 Navigator; 17 class Navigator;
17 class ServiceWorkerContainer; 18 class ServiceWorkerContainer;
18 19
19 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 {
20 USING_GARBAGE_COLLECTED_MIXIN(NavigatorServiceWorker); 21 USING_GARBAGE_COLLECTED_MIXIN(NavigatorServiceWorker);
21 public: 22 public:
22 static NavigatorServiceWorker* from(Document&); 23 static NavigatorServiceWorker* from(Document&);
23 static NavigatorServiceWorker& from(Navigator&); 24 static NavigatorServiceWorker& from(Navigator&);
24 static NavigatorServiceWorker* toNavigatorServiceWorker(Navigator&); 25 static NavigatorServiceWorker* toNavigatorServiceWorker(Navigator&);
25 26
26 virtual ~NavigatorServiceWorker(); 27 virtual ~NavigatorServiceWorker();
27 28
28 static ServiceWorkerContainer* serviceWorker(Navigator&); 29 static ServiceWorkerContainer* serviceWorker(Navigator&, ExceptionState&);
29 30
30 DECLARE_VIRTUAL_TRACE(); 31 DECLARE_VIRTUAL_TRACE();
31 32
32 private: 33 private:
33 explicit NavigatorServiceWorker(Navigator&); 34 explicit NavigatorServiceWorker(Navigator&);
34 ServiceWorkerContainer* serviceWorker(); 35 ServiceWorkerContainer* serviceWorker(ExceptionState&);
35 36
36 static const char* supplementName(); 37 static const char* supplementName();
37 38
38 // DOMWindowProperty override. 39 // DOMWindowProperty override.
39 virtual void willDetachGlobalObjectFromFrame() override; 40 virtual void willDetachGlobalObjectFromFrame() override;
40 41
41 Member<ServiceWorkerContainer> m_serviceWorker; 42 Member<ServiceWorkerContainer> m_serviceWorker;
42 }; 43 };
43 44
44 } // namespace blink 45 } // namespace blink
45 46
46 #endif // NavigatorServiceWorker_h 47 #endif // NavigatorServiceWorker_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698