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

Side by Side Diff: Source/modules/serviceworkers/ExtendableEvent.cpp

Issue 715013003: ExtendableEvent and InstallEvent should have an EventConstructor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: basic layout test Created 6 years, 1 month 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) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 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 23 matching lines...) Expand all
34 #include "bindings/core/v8/ScriptWrappable.h" 34 #include "bindings/core/v8/ScriptWrappable.h"
35 #include "modules/serviceworkers/WaitUntilObserver.h" 35 #include "modules/serviceworkers/WaitUntilObserver.h"
36 36
37 namespace blink { 37 namespace blink {
38 38
39 PassRefPtrWillBeRawPtr<ExtendableEvent> ExtendableEvent::create() 39 PassRefPtrWillBeRawPtr<ExtendableEvent> ExtendableEvent::create()
40 { 40 {
41 return adoptRefWillBeNoop(new ExtendableEvent()); 41 return adoptRefWillBeNoop(new ExtendableEvent());
42 } 42 }
43 43
44 PassRefPtrWillBeRawPtr<ExtendableEvent> ExtendableEvent::create(const AtomicStri ng& type, const EventInit& eventInit, WaitUntilObserver* observer) 44 PassRefPtrWillBeRawPtr<ExtendableEvent> ExtendableEvent::create(const AtomicStri ng& type, const ExtendableEventInit& eventInit)
45 {
46 return adoptRefWillBeNoop(new ExtendableEvent(type, eventInit));
47 }
48
49 PassRefPtrWillBeRawPtr<ExtendableEvent> ExtendableEvent::create(const AtomicStri ng& type, const ExtendableEventInit& eventInit, WaitUntilObserver* observer)
45 { 50 {
46 return adoptRefWillBeNoop(new ExtendableEvent(type, eventInit, observer)); 51 return adoptRefWillBeNoop(new ExtendableEvent(type, eventInit, observer));
47 } 52 }
48 53
49 ExtendableEvent::~ExtendableEvent() 54 ExtendableEvent::~ExtendableEvent()
50 { 55 {
51 } 56 }
52 57
53 void ExtendableEvent::waitUntil(ScriptState* scriptState, const ScriptValue& val ue) 58 void ExtendableEvent::waitUntil(ScriptState* scriptState, const ScriptValue& val ue)
54 { 59 {
55 m_observer->waitUntil(scriptState, value); 60 if (m_observer)
61 m_observer->waitUntil(scriptState, value);
56 } 62 }
57 63
58 ExtendableEvent::ExtendableEvent() 64 ExtendableEvent::ExtendableEvent()
59 { 65 {
60 } 66 }
61 67
62 ExtendableEvent::ExtendableEvent(const AtomicString& type, const EventInit& init ializer, WaitUntilObserver* observer) 68 ExtendableEvent::ExtendableEvent(const AtomicString& type, const ExtendableEvent Init& initializer)
69 : Event(type, initializer)
70 {
71 }
72
73 ExtendableEvent::ExtendableEvent(const AtomicString& type, const ExtendableEvent Init& initializer, WaitUntilObserver* observer)
63 : Event(type, initializer) 74 : Event(type, initializer)
64 , m_observer(observer) 75 , m_observer(observer)
65 { 76 {
66 } 77 }
67 78
68 const AtomicString& ExtendableEvent::interfaceName() const 79 const AtomicString& ExtendableEvent::interfaceName() const
69 { 80 {
70 return EventNames::ExtendableEvent; 81 return EventNames::ExtendableEvent;
71 } 82 }
72 83
73 void ExtendableEvent::trace(Visitor* visitor) 84 void ExtendableEvent::trace(Visitor* visitor)
74 { 85 {
75 visitor->trace(m_observer); 86 visitor->trace(m_observer);
76 Event::trace(visitor); 87 Event::trace(visitor);
77 } 88 }
78 89
79 } // namespace blink 90 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/serviceworkers/ExtendableEvent.h ('k') | Source/modules/serviceworkers/ExtendableEvent.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698