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

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

Issue 205013002: The blink half of the new ServiceWorker 'sync' event. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 } 67 }
68 68
69 void ServiceWorkerGlobalScopeProxy::dispatchFetchEvent(int eventID) 69 void ServiceWorkerGlobalScopeProxy::dispatchFetchEvent(int eventID)
70 { 70 {
71 ASSERT(m_workerGlobalScope); 71 ASSERT(m_workerGlobalScope);
72 RefPtr<RespondWithObserver> observer = RespondWithObserver::create(m_workerG lobalScope, eventID); 72 RefPtr<RespondWithObserver> observer = RespondWithObserver::create(m_workerG lobalScope, eventID);
73 m_workerGlobalScope->dispatchEvent(FetchEvent::create(observer)); 73 m_workerGlobalScope->dispatchEvent(FetchEvent::create(observer));
74 observer->didDispatchEvent(); 74 observer->didDispatchEvent();
75 } 75 }
76 76
77 void ServiceWorkerGlobalScopeProxy::dispatchSyncEvent(int eventID)
78 {
79 ASSERT(m_workerGlobalScope);
80 m_workerGlobalScope->dispatchEvent(Event::create(EventTypeNames::sync));
81 ServiceWorkerGlobalScopeClient::from(m_workerGlobalScope)->didHandleSyncEven t(eventID);
82 }
83
84
77 void ServiceWorkerGlobalScopeProxy::reportException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL) 85 void ServiceWorkerGlobalScopeProxy::reportException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL)
78 { 86 {
79 m_client.reportException(errorMessage, lineNumber, columnNumber, sourceURL); 87 m_client.reportException(errorMessage, lineNumber, columnNumber, sourceURL);
80 } 88 }
81 89
82 void ServiceWorkerGlobalScopeProxy::reportConsoleMessage(MessageSource, MessageL evel, const String& message, int lineNumber, const String& sourceURL) 90 void ServiceWorkerGlobalScopeProxy::reportConsoleMessage(MessageSource, MessageL evel, const String& message, int lineNumber, const String& sourceURL)
83 { 91 {
84 notImplemented(); 92 notImplemented();
85 } 93 }
86 94
(...skipping 27 matching lines...) Expand all
114 122
115 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm pl& embeddedWorker, ExecutionContext& executionContext, WebServiceWorkerContextC lient& client) 123 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm pl& embeddedWorker, ExecutionContext& executionContext, WebServiceWorkerContextC lient& client)
116 : m_embeddedWorker(embeddedWorker) 124 : m_embeddedWorker(embeddedWorker)
117 , m_executionContext(executionContext) 125 , m_executionContext(executionContext)
118 , m_client(client) 126 , m_client(client)
119 , m_workerGlobalScope(0) 127 , m_workerGlobalScope(0)
120 { 128 {
121 } 129 }
122 130
123 } // namespace blink 131 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698