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

Side by Side Diff: Source/web/ServiceWorkerGlobalScopeProxy.h

Issue 1220223003: [Background Sync] Add sync registration details to onsync event (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add MODULES_EXPORT declaration to SyncRegistration Created 5 years, 5 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 28 matching lines...) Expand all
39 #include "wtf/OwnPtr.h" 39 #include "wtf/OwnPtr.h"
40 40
41 namespace blink { 41 namespace blink {
42 42
43 class ConsoleMessage; 43 class ConsoleMessage;
44 class Document; 44 class Document;
45 class ServiceWorkerGlobalScope; 45 class ServiceWorkerGlobalScope;
46 class WebEmbeddedWorkerImpl; 46 class WebEmbeddedWorkerImpl;
47 class WebServiceWorkerContextClient; 47 class WebServiceWorkerContextClient;
48 class WebServiceWorkerRequest; 48 class WebServiceWorkerRequest;
49 struct WebSyncRegistration;
49 50
50 // This class is created and destructed on the main thread, but live most 51 // This class is created and destructed on the main thread, but live most
51 // of its time as a resident of the worker thread. 52 // of its time as a resident of the worker thread.
52 // All methods other than its ctor/dtor are called on the worker thread. 53 // All methods other than its ctor/dtor are called on the worker thread.
53 // 54 //
54 // This implements WebServiceWorkerContextProxy, which connects ServiceWorker's 55 // This implements WebServiceWorkerContextProxy, which connects ServiceWorker's
55 // WorkerGlobalScope and embedder/chrome, and implements ServiceWorker-specific 56 // WorkerGlobalScope and embedder/chrome, and implements ServiceWorker-specific
56 // events/upcall methods that are to be called by embedder/chromium, 57 // events/upcall methods that are to be called by embedder/chromium,
57 // e.g. onfetch. 58 // e.g. onfetch.
58 // 59 //
(...skipping 12 matching lines...) Expand all
71 virtual void setRegistration(WebServiceWorkerRegistration*) override; 72 virtual void setRegistration(WebServiceWorkerRegistration*) override;
72 virtual void dispatchActivateEvent(int) override; 73 virtual void dispatchActivateEvent(int) override;
73 virtual void dispatchCrossOriginConnectEvent(int, const WebCrossOriginServic eWorkerClient&) override; 74 virtual void dispatchCrossOriginConnectEvent(int, const WebCrossOriginServic eWorkerClient&) override;
74 virtual void dispatchCrossOriginMessageEvent(const WebCrossOriginServiceWork erClient&, const WebString& message, const WebMessagePortChannelArray&) override ; 75 virtual void dispatchCrossOriginMessageEvent(const WebCrossOriginServiceWork erClient&, const WebString& message, const WebMessagePortChannelArray&) override ;
75 virtual void dispatchFetchEvent(int, const WebServiceWorkerRequest&) overrid e; 76 virtual void dispatchFetchEvent(int, const WebServiceWorkerRequest&) overrid e;
76 virtual void dispatchGeofencingEvent(int, WebGeofencingEventType, const WebS tring& regionID, const WebCircularGeofencingRegion&) override; 77 virtual void dispatchGeofencingEvent(int, WebGeofencingEventType, const WebS tring& regionID, const WebCircularGeofencingRegion&) override;
77 virtual void dispatchInstallEvent(int) override; 78 virtual void dispatchInstallEvent(int) override;
78 virtual void dispatchMessageEvent(const WebString& message, const WebMessage PortChannelArray&) override; 79 virtual void dispatchMessageEvent(const WebString& message, const WebMessage PortChannelArray&) override;
79 virtual void dispatchNotificationClickEvent(int, int64_t notificationID, con st WebNotificationData&) override; 80 virtual void dispatchNotificationClickEvent(int, int64_t notificationID, con st WebNotificationData&) override;
80 virtual void dispatchPushEvent(int, const WebString& data) override; 81 virtual void dispatchPushEvent(int, const WebString& data) override;
82 // FIXME: Remove the single-parameter version once all call sites have been
Michael van Ouwerkerk 2015/07/07 14:07:35 The style is now TODO(name) https://www.chromium.
iclelland 2015/07/07 14:37:24 Fixed (all three occurrences) -- thanks!
83 // updated.
81 virtual void dispatchSyncEvent(int) override; 84 virtual void dispatchSyncEvent(int) override;
85 virtual void dispatchSyncEvent(int, const WebSyncRegistration&) override;
82 virtual void addStashedMessagePorts(const WebMessagePortChannelArray&, const WebVector<WebString>& webChannelNames) override; 86 virtual void addStashedMessagePorts(const WebMessagePortChannelArray&, const WebVector<WebString>& webChannelNames) override;
83 87
84 // WorkerReportingProxy overrides: 88 // WorkerReportingProxy overrides:
85 virtual void reportException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL, int exceptionId) override; 89 virtual void reportException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL, int exceptionId) override;
86 virtual void reportConsoleMessage(PassRefPtrWillBeRawPtr<ConsoleMessage>) ov erride; 90 virtual void reportConsoleMessage(PassRefPtrWillBeRawPtr<ConsoleMessage>) ov erride;
87 virtual void postMessageToPageInspector(const String&) override; 91 virtual void postMessageToPageInspector(const String&) override;
88 virtual void postWorkerConsoleAgentEnabled() override { } 92 virtual void postWorkerConsoleAgentEnabled() override { }
89 virtual void didEvaluateWorkerScript(bool success) override; 93 virtual void didEvaluateWorkerScript(bool success) override;
90 virtual void workerGlobalScopeStarted(WorkerGlobalScope*) override; 94 virtual void workerGlobalScopeStarted(WorkerGlobalScope*) override;
91 virtual void workerGlobalScopeClosed() override; 95 virtual void workerGlobalScopeClosed() override;
92 virtual void willDestroyWorkerGlobalScope() override; 96 virtual void willDestroyWorkerGlobalScope() override;
93 virtual void workerThreadTerminated() override; 97 virtual void workerThreadTerminated() override;
94 98
95 private: 99 private:
96 ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerImpl&, Document&, WebServiceW orkerContextClient&); 100 ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerImpl&, Document&, WebServiceW orkerContextClient&);
97 101
98 WebEmbeddedWorkerImpl& m_embeddedWorker; 102 WebEmbeddedWorkerImpl& m_embeddedWorker;
99 Document& m_document; 103 Document& m_document;
100 104
101 WebServiceWorkerContextClient& m_client; 105 WebServiceWorkerContextClient& m_client;
102 106
103 ServiceWorkerGlobalScope* m_workerGlobalScope; 107 ServiceWorkerGlobalScope* m_workerGlobalScope;
104 }; 108 };
105 109
106 } // namespace blink 110 } // namespace blink
107 111
108 #endif // ServiceWorkerGlobalScopeProxy_h 112 #endif // ServiceWorkerGlobalScopeProxy_h
OLDNEW
« no previous file with comments | « Source/modules/background_sync/SyncRegistration.cpp ('k') | Source/web/ServiceWorkerGlobalScopeProxy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698