Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef PushRegistrationCallback_h | |
| 6 #define PushRegistrationCallback_h | |
| 7 | |
| 8 #include "platform/heap/Handle.h" | |
| 9 #include "public/platform/WebCallbacks.h" | |
| 10 #include "wtf/Noncopyable.h" | |
| 11 #include "wtf/PassRefPtr.h" | |
| 12 #include "wtf/RefPtr.h" | |
| 13 | |
| 14 namespace blink { | |
| 15 | |
| 16 class ServiceWorkerRegistration; | |
| 17 class ScriptPromiseResolver; | |
| 18 struct WebPushError; | |
| 19 struct WebPushRegistration; | |
| 20 | |
| 21 // PushRegistrationCallback is an implementation of WebPushRegistrationCallbacks | |
| 22 // that will resolve the underlying promise depending on the result passed to | |
| 23 // the callback. It takes a ServiceWorkerRegistration in its constructor and | |
| 24 // will pass it to the PushRegistration. | |
| 25 class PushRegistrationCallback final | |
|
Michael van Ouwerkerk
2014/12/12 12:18:04
Please rename to PushRegistrationCallbacks. It's a
mlamouri (slow - plz ping)
2014/12/15 10:55:07
Sic :(
| |
| 26 : public WebCallbacks<WebPushRegistration, WebPushError> { | |
|
Michael van Ouwerkerk
2014/12/12 12:18:04
Just write WebPushRegistrationCallbacks
jochen (gone - plz use gerrit)
2014/12/12 14:26:12
should be on previous line (no line length limit)
mlamouri (slow - plz ping)
2014/12/15 10:55:07
Hmm, I don't think so. It would require including
| |
| 27 public: | |
| 28 explicit PushRegistrationCallback(PassRefPtr<ScriptPromiseResolver>, Service WorkerRegistration*); | |
|
Michael van Ouwerkerk
2014/12/12 12:18:04
omit explicit as there are two arguments
mlamouri (slow - plz ping)
2014/12/15 10:55:07
Done.
| |
| 29 virtual ~PushRegistrationCallback(); | |
|
Michael van Ouwerkerk
2014/12/12 12:18:04
Hmmz, I guess we should mark these with override i
mlamouri (slow - plz ping)
2014/12/15 10:55:07
Done.
| |
| 30 | |
| 31 void onSuccess(WebPushRegistration*) override; | |
| 32 void onError(WebPushError*) override; | |
| 33 | |
| 34 void trace(Visitor*); | |
| 35 | |
| 36 private: | |
| 37 RefPtr<ScriptPromiseResolver> m_resolver; | |
| 38 Persistent<ServiceWorkerRegistration> m_registration; | |
|
Michael van Ouwerkerk
2014/12/12 12:18:04
Please rename to m_serviceWorkerRegistration to di
mlamouri (slow - plz ping)
2014/12/15 10:55:07
Done.
| |
| 39 | |
| 40 WTF_MAKE_NONCOPYABLE(PushRegistrationCallback); | |
| 41 }; | |
| 42 | |
| 43 } // namespace blink | |
| 44 | |
| 45 #endif // PushRegistrationCallback_h | |
| OLD | NEW |