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

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

Issue 779563003: [POC-WIP] Link window focus tokens with ExecutionContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 ASSERT(m_workerGlobalScope); 117 ASSERT(m_workerGlobalScope);
118 118
119 OwnPtrWillBeRawPtr<MessagePortArray> ports = MessagePort::toMessagePortArray (m_workerGlobalScope, webChannels); 119 OwnPtrWillBeRawPtr<MessagePortArray> ports = MessagePort::toMessagePortArray (m_workerGlobalScope, webChannels);
120 WebSerializedScriptValue value = WebSerializedScriptValue::fromString(messag e); 120 WebSerializedScriptValue value = WebSerializedScriptValue::fromString(messag e);
121 m_workerGlobalScope->dispatchEvent(MessageEvent::create(ports.release(), val ue)); 121 m_workerGlobalScope->dispatchEvent(MessageEvent::create(ports.release(), val ue));
122 } 122 }
123 123
124 void ServiceWorkerGlobalScopeProxy::dispatchNotificationClickEvent(int eventID, const WebString& notificationID, const WebNotificationData& data) 124 void ServiceWorkerGlobalScopeProxy::dispatchNotificationClickEvent(int eventID, const WebString& notificationID, const WebNotificationData& data)
125 { 125 {
126 ASSERT(m_workerGlobalScope); 126 ASSERT(m_workerGlobalScope);
127 m_workerGlobalScope->giveWindowFocusToken();
127 WaitUntilObserver* observer = WaitUntilObserver::create(m_workerGlobalScope, WaitUntilObserver::NotificationClick, eventID); 128 WaitUntilObserver* observer = WaitUntilObserver::create(m_workerGlobalScope, WaitUntilObserver::NotificationClick, eventID);
128 // FIXME: Initialize a Notification object based on |notificationID| and |da ta|. 129 // FIXME: Initialize a Notification object based on |notificationID| and |da ta|.
129 NotificationEventInit eventInit; 130 NotificationEventInit eventInit;
130 RefPtrWillBeRawPtr<Event> event(NotificationEvent::create(EventTypeNames::no tificationclick, eventInit, observer)); 131 RefPtrWillBeRawPtr<Event> event(NotificationEvent::create(EventTypeNames::no tificationclick, eventInit, observer));
131 m_workerGlobalScope->dispatchExtendableEvent(event.release(), observer); 132 m_workerGlobalScope->dispatchExtendableEvent(event.release(), observer);
132 } 133 }
133 134
134 void ServiceWorkerGlobalScopeProxy::dispatchPushEvent(int eventID, const WebStri ng& data) 135 void ServiceWorkerGlobalScopeProxy::dispatchPushEvent(int eventID, const WebStri ng& data)
135 { 136 {
136 ASSERT(m_workerGlobalScope); 137 ASSERT(m_workerGlobalScope);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 193
193 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm pl& embeddedWorker, Document& document, WebServiceWorkerContextClient& client) 194 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm pl& embeddedWorker, Document& document, WebServiceWorkerContextClient& client)
194 : m_embeddedWorker(embeddedWorker) 195 : m_embeddedWorker(embeddedWorker)
195 , m_document(document) 196 , m_document(document)
196 , m_client(client) 197 , m_client(client)
197 , m_workerGlobalScope(0) 198 , m_workerGlobalScope(0)
198 { 199 {
199 } 200 }
200 201
201 } // namespace blink 202 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/ServiceWorkerGlobalScopeClientImpl.cpp ('k') | public/platform/WebServiceWorkerClientFocusCallback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698