OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
46 class WebServiceWorker; | 46 class WebServiceWorker; |
47 } | 47 } |
48 | 48 |
49 namespace WebCore { | 49 namespace WebCore { |
50 | 50 |
51 class Dictionary; | 51 class Dictionary; |
52 class ExecutionContext; | 52 class ExecutionContext; |
53 class ServiceWorker; | 53 class ServiceWorker; |
54 | 54 |
55 class ServiceWorkerContainer FINAL : | 55 class ServiceWorkerContainer FINAL : |
56 public RefCounted<ServiceWorkerContainer>, | 56 public RefCountedWillBeRefCountedGarbageCollected<ServiceWorkerContainer>, |
haraken
2014/06/02 07:25:06
I'm curious why ServiceWorkerContainer needs to be
zerny-chromium
2014/06/02 07:47:33
Good point. The IDL implied change is that control
haraken
2014/06/02 07:54:32
Probably we want to just use a Persistent for m_co
| |
57 public ScriptWrappable, | 57 public ScriptWrappable, |
58 public ContextLifecycleObserver, | 58 public ContextLifecycleObserver, |
59 public DOMWindowLifecycleObserver, | 59 public DOMWindowLifecycleObserver, |
60 public blink::WebServiceWorkerProviderClient { | 60 public blink::WebServiceWorkerProviderClient { |
61 public: | 61 public: |
62 static PassRefPtr<ServiceWorkerContainer> create(ExecutionContext*); | 62 static PassRefPtrWillBeRawPtr<ServiceWorkerContainer> create(ExecutionContex t*); |
63 ~ServiceWorkerContainer(); | 63 ~ServiceWorkerContainer(); |
64 | 64 |
65 void detachClient(); | 65 void detachClient(); |
66 | 66 |
67 ScriptPromise registerServiceWorker(ExecutionContext*, const String& pattern , const Dictionary&); | 67 ScriptPromise registerServiceWorker(ExecutionContext*, const String& pattern , const Dictionary&); |
68 ScriptPromise unregisterServiceWorker(ExecutionContext*, const String& scope = String()); | 68 ScriptPromise unregisterServiceWorker(ExecutionContext*, const String& scope = String()); |
69 | 69 |
70 PassRefPtr<ServiceWorker> controller() { return m_controller; } | 70 PassRefPtrWillBeRawPtr<ServiceWorker> controller() { return m_controller; } |
71 | 71 |
72 // WebServiceWorkerProviderClient overrides. | 72 // WebServiceWorkerProviderClient overrides. |
73 virtual void setController(blink::WebServiceWorker*) OVERRIDE; | 73 virtual void setController(blink::WebServiceWorker*) OVERRIDE; |
74 virtual void dispatchMessageEvent(const blink::WebString& message, const bli nk::WebMessagePortChannelArray&) OVERRIDE; | 74 virtual void dispatchMessageEvent(const blink::WebString& message, const bli nk::WebMessagePortChannelArray&) OVERRIDE; |
75 | 75 |
76 // FIXME: Delete this when the embedder switches to setController. | 76 // FIXME: Delete this when the embedder switches to setController. |
77 virtual void setCurrentServiceWorker(blink::WebServiceWorker*) OVERRIDE; | 77 virtual void setCurrentServiceWorker(blink::WebServiceWorker*) OVERRIDE; |
78 | 78 |
79 void trace(Visitor* visitor) { visitor->trace(m_controller); } | |
80 | |
79 private: | 81 private: |
80 explicit ServiceWorkerContainer(ExecutionContext*); | 82 explicit ServiceWorkerContainer(ExecutionContext*); |
81 | 83 |
82 blink::WebServiceWorkerProvider* m_provider; | 84 blink::WebServiceWorkerProvider* m_provider; |
83 RefPtr<ServiceWorker> m_controller; | 85 RefPtrWillBeMember<ServiceWorker> m_controller; |
84 }; | 86 }; |
85 | 87 |
86 } // namespace WebCore | 88 } // namespace WebCore |
87 | 89 |
88 #endif // ServiceWorkerContainer_h | 90 #endif // ServiceWorkerContainer_h |
OLD | NEW |