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

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

Issue 180843003: Start to implement FetchEvent for ServiceWorker (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: patch for landing Created 6 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 | Annotate | Revision Log
OLDNEW
(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 #include "config.h"
6 #include "FetchEvent.h"
7
8 #include "core/events/ThreadLocalEventNames.h"
9 #include "modules/serviceworkers/ServiceWorkerGlobalScope.h"
10 #include "wtf/RefPtr.h"
11
12 namespace WebCore {
13
14 PassRefPtr<FetchEvent> FetchEvent::create()
15 {
16 return adoptRef(new FetchEvent());
17 }
18
19 PassRefPtr<FetchEvent> FetchEvent::create(PassRefPtr<RespondWithObserver> observ er)
20 {
21 return adoptRef(new FetchEvent(observer));
22 }
23
24 void FetchEvent::respondWith(const ScriptValue& value)
25 {
26 m_observer->respondWith(value);
27 }
28
29 const AtomicString& FetchEvent::interfaceName() const
30 {
31 return EventNames::FetchEvent;
32 }
33
34 FetchEvent::FetchEvent()
35 {
36 ScriptWrappable::init(this);
37 }
38
39 FetchEvent::FetchEvent(PassRefPtr<RespondWithObserver> observer)
40 : Event(EventTypeNames::fetch, /*canBubble=*/false, /*cancelable=*/true)
41 , m_observer(observer)
42 {
43 ScriptWrappable::init(this);
44 }
45
46 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/serviceworkers/FetchEvent.h ('k') | Source/modules/serviceworkers/FetchEvent.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698