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

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

Issue 335293003: Add slots for navigator.serviceWorker.installing and active. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 public RefCounted<ServiceWorkerContainer>, 55 public RefCounted<ServiceWorkerContainer>,
56 public ScriptWrappable, 56 public ScriptWrappable,
57 public ContextLifecycleObserver, 57 public ContextLifecycleObserver,
58 public blink::WebServiceWorkerProviderClient { 58 public blink::WebServiceWorkerProviderClient {
59 public: 59 public:
60 static PassRefPtr<ServiceWorkerContainer> create(ExecutionContext*); 60 static PassRefPtr<ServiceWorkerContainer> create(ExecutionContext*);
61 ~ServiceWorkerContainer(); 61 ~ServiceWorkerContainer();
62 62
63 void detachClient(); 63 void detachClient();
64 64
65 PassRefPtrWillBeRawPtr<ServiceWorker> active() { return m_active.get(); }
66 PassRefPtrWillBeRawPtr<ServiceWorker> controller() { return m_controller.get (); }
67 PassRefPtrWillBeRawPtr<ServiceWorker> installing() { return m_installing.get (); }
65 PassRefPtrWillBeRawPtr<ServiceWorker> waiting() { return m_waiting.get(); } 68 PassRefPtrWillBeRawPtr<ServiceWorker> waiting() { return m_waiting.get(); }
66 PassRefPtrWillBeRawPtr<ServiceWorker> controller() { return m_controller.get (); }
67 ScriptPromise ready(ScriptState*); 69 ScriptPromise ready(ScriptState*);
68 70
69 ScriptPromise registerServiceWorker(ScriptState*, const String& pattern, con st Dictionary&); 71 ScriptPromise registerServiceWorker(ScriptState*, const String& pattern, con st Dictionary&);
70 ScriptPromise unregisterServiceWorker(ScriptState*, const String& scope = St ring()); 72 ScriptPromise unregisterServiceWorker(ScriptState*, const String& scope = St ring());
71 73
72 // WebServiceWorkerProviderClient overrides. 74 // WebServiceWorkerProviderClient overrides.
75 virtual void setActive(blink::WebServiceWorker*) OVERRIDE;
76 virtual void setController(blink::WebServiceWorker*) OVERRIDE;
77 virtual void setInstalling(blink::WebServiceWorker*) OVERRIDE;
73 virtual void setWaiting(blink::WebServiceWorker*) OVERRIDE; 78 virtual void setWaiting(blink::WebServiceWorker*) OVERRIDE;
74 virtual void setController(blink::WebServiceWorker*) OVERRIDE;
75 virtual void dispatchMessageEvent(const blink::WebString& message, const bli nk::WebMessagePortChannelArray&) OVERRIDE; 79 virtual void dispatchMessageEvent(const blink::WebString& message, const bli nk::WebMessagePortChannelArray&) OVERRIDE;
76 80
77 // FIXME: Delete this when the embedder switches to setController.
78 virtual void setCurrentServiceWorker(blink::WebServiceWorker*) OVERRIDE;
79
80 private: 81 private:
81 explicit ServiceWorkerContainer(ExecutionContext*); 82 explicit ServiceWorkerContainer(ExecutionContext*);
82 83
83 blink::WebServiceWorkerProvider* m_provider; 84 blink::WebServiceWorkerProvider* m_provider;
85 RefPtr<ServiceWorker> m_active;
86 RefPtr<ServiceWorker> m_controller;
87 RefPtr<ServiceWorker> m_installing;
84 RefPtr<ServiceWorker> m_waiting; 88 RefPtr<ServiceWorker> m_waiting;
85 RefPtr<ServiceWorker> m_controller;
86 }; 89 };
87 90
88 } // namespace WebCore 91 } // namespace WebCore
89 92
90 #endif // ServiceWorkerContainer_h 93 #endif // ServiceWorkerContainer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698