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

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

Issue 912443002: ServiceWorker: Make "ready" fetches registration from browser process(3/3). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add cleanup Created 5 years, 9 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 /* 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 PassRefPtrWillBeRawPtr<ServiceWorker> controller() { return m_controller.get (); } 70 PassRefPtrWillBeRawPtr<ServiceWorker> controller() { return m_controller.get (); }
71 ScriptPromise ready(ScriptState*); 71 ScriptPromise ready(ScriptState*);
72 WebServiceWorkerProvider* provider() { return m_provider; } 72 WebServiceWorkerProvider* provider() { return m_provider; }
73 73
74 ScriptPromise registerServiceWorker(ScriptState*, const String& pattern, con st RegistrationOptions&); 74 ScriptPromise registerServiceWorker(ScriptState*, const String& pattern, con st RegistrationOptions&);
75 ScriptPromise getRegistration(ScriptState*, const String& documentURL); 75 ScriptPromise getRegistration(ScriptState*, const String& documentURL);
76 76
77 // WebServiceWorkerProviderClient overrides. 77 // WebServiceWorkerProviderClient overrides.
78 virtual void setController(WebServiceWorker*, bool shouldNotifyControllerCha nge) override; 78 virtual void setController(WebServiceWorker*, bool shouldNotifyControllerCha nge) override;
79 virtual void setReadyRegistration(WebServiceWorkerRegistration*) override;
80 virtual void dispatchMessageEvent(const WebString& message, const WebMessage PortChannelArray&) override; 79 virtual void dispatchMessageEvent(const WebString& message, const WebMessage PortChannelArray&) override;
81 virtual bool getClientInfo(WebServiceWorkerClientInfo*); 80 virtual bool getClientInfo(WebServiceWorkerClientInfo*);
82 81
83 // EventTarget overrides. 82 // EventTarget overrides.
84 virtual ExecutionContext* executionContext() const override { return Context LifecycleObserver::executionContext(); } 83 virtual ExecutionContext* executionContext() const override { return Context LifecycleObserver::executionContext(); }
85 virtual const AtomicString& interfaceName() const override; 84 virtual const AtomicString& interfaceName() const override;
86 85
87 DEFINE_ATTRIBUTE_EVENT_LISTENER(controllerchange); 86 DEFINE_ATTRIBUTE_EVENT_LISTENER(controllerchange);
88 87
89 private: 88 private:
90 explicit ServiceWorkerContainer(ExecutionContext*); 89 explicit ServiceWorkerContainer(ExecutionContext*);
91 90
92 class GetRegistrationForReadyCallback; 91 class GetRegistrationForReadyCallback;
93 typedef ScriptPromiseProperty<Member<ServiceWorkerContainer>, Member<Service WorkerRegistration>, Member<ServiceWorkerRegistration>> ReadyProperty; 92 typedef ScriptPromiseProperty<Member<ServiceWorkerContainer>, Member<Service WorkerRegistration>, Member<ServiceWorkerRegistration>> ReadyProperty;
94 ReadyProperty* createReadyProperty(); 93 ReadyProperty* createReadyProperty();
95 94
96 WebServiceWorkerProvider* m_provider; 95 WebServiceWorkerProvider* m_provider;
97 RefPtrWillBeMember<ServiceWorker> m_controller; 96 RefPtrWillBeMember<ServiceWorker> m_controller;
98 Member<ServiceWorkerRegistration> m_readyRegistration;
99 Member<ReadyProperty> m_ready; 97 Member<ReadyProperty> m_ready;
100 }; 98 };
101 99
102 } // namespace blink 100 } // namespace blink
103 101
104 #endif // ServiceWorkerContainer_h 102 #endif // ServiceWorkerContainer_h
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/serviceworker/ready.html ('k') | Source/modules/serviceworkers/ServiceWorkerContainer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698