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

Side by Side Diff: third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp

Issue 2466513002: Deprecate ServiceWorkerMessageEvent in favor of MessageEvent (Closed)
Patch Set: Rebase and update cross-origin-objects-exceptions-expected.txt Created 4 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 23 matching lines...) Expand all
34 #include "bindings/core/v8/ScriptPromiseResolver.h" 34 #include "bindings/core/v8/ScriptPromiseResolver.h"
35 #include "bindings/core/v8/ScriptState.h" 35 #include "bindings/core/v8/ScriptState.h"
36 #include "bindings/core/v8/SerializedScriptValue.h" 36 #include "bindings/core/v8/SerializedScriptValue.h"
37 #include "bindings/core/v8/SerializedScriptValueFactory.h" 37 #include "bindings/core/v8/SerializedScriptValueFactory.h"
38 #include "bindings/core/v8/V8ThrowException.h" 38 #include "bindings/core/v8/V8ThrowException.h"
39 #include "core/dom/DOMException.h" 39 #include "core/dom/DOMException.h"
40 #include "core/dom/Document.h" 40 #include "core/dom/Document.h"
41 #include "core/dom/ExceptionCode.h" 41 #include "core/dom/ExceptionCode.h"
42 #include "core/dom/ExecutionContext.h" 42 #include "core/dom/ExecutionContext.h"
43 #include "core/dom/MessagePort.h" 43 #include "core/dom/MessagePort.h"
44 #include "core/events/MessageEvent.h"
44 #include "core/frame/LocalDOMWindow.h" 45 #include "core/frame/LocalDOMWindow.h"
45 #include "core/frame/UseCounter.h" 46 #include "core/frame/UseCounter.h"
46 #include "core/frame/csp/ContentSecurityPolicy.h" 47 #include "core/frame/csp/ContentSecurityPolicy.h"
47 #include "modules/EventTargetModules.h" 48 #include "modules/EventTargetModules.h"
48 #include "modules/serviceworkers/ServiceWorker.h" 49 #include "modules/serviceworkers/ServiceWorker.h"
49 #include "modules/serviceworkers/ServiceWorkerContainerClient.h" 50 #include "modules/serviceworkers/ServiceWorkerContainerClient.h"
50 #include "modules/serviceworkers/ServiceWorkerError.h" 51 #include "modules/serviceworkers/ServiceWorkerError.h"
51 #include "modules/serviceworkers/ServiceWorkerMessageEvent.h"
52 #include "modules/serviceworkers/ServiceWorkerRegistration.h" 52 #include "modules/serviceworkers/ServiceWorkerRegistration.h"
53 #include "platform/RuntimeEnabledFeatures.h" 53 #include "platform/RuntimeEnabledFeatures.h"
54 #include "platform/weborigin/SchemeRegistry.h" 54 #include "platform/weborigin/SchemeRegistry.h"
55 #include "public/platform/WebString.h" 55 #include "public/platform/WebString.h"
56 #include "public/platform/WebURL.h" 56 #include "public/platform/WebURL.h"
57 #include "public/platform/modules/serviceworker/WebServiceWorker.h" 57 #include "public/platform/modules/serviceworker/WebServiceWorker.h"
58 #include "public/platform/modules/serviceworker/WebServiceWorkerProvider.h" 58 #include "public/platform/modules/serviceworker/WebServiceWorkerProvider.h"
59 #include "public/platform/modules/serviceworker/WebServiceWorkerRegistration.h" 59 #include "public/platform/modules/serviceworker/WebServiceWorkerRegistration.h"
60 #include "wtf/PtrUtil.h" 60 #include "wtf/PtrUtil.h"
61 #include <memory> 61 #include <memory>
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 const WebString& message, 442 const WebString& message,
443 const WebMessagePortChannelArray& webChannels) { 443 const WebMessagePortChannelArray& webChannels) {
444 if (!getExecutionContext() || !getExecutionContext()->executingWindow()) 444 if (!getExecutionContext() || !getExecutionContext()->executingWindow())
445 return; 445 return;
446 446
447 MessagePortArray* ports = 447 MessagePortArray* ports =
448 MessagePort::toMessagePortArray(getExecutionContext(), webChannels); 448 MessagePort::toMessagePortArray(getExecutionContext(), webChannels);
449 RefPtr<SerializedScriptValue> value = SerializedScriptValue::create(message); 449 RefPtr<SerializedScriptValue> value = SerializedScriptValue::create(message);
450 ServiceWorker* source = ServiceWorker::from( 450 ServiceWorker* source = ServiceWorker::from(
451 getExecutionContext(), WTF::wrapUnique(handle.release())); 451 getExecutionContext(), WTF::wrapUnique(handle.release()));
452 dispatchEvent(ServiceWorkerMessageEvent::create( 452 dispatchEvent(MessageEvent::create(
453 ports, value, source, 453 ports, value, getExecutionContext()->getSecurityOrigin()->toString(),
454 getExecutionContext()->getSecurityOrigin()->toString())); 454 String() /* lastEventId */, source, String() /* suborigin */));
455 } 455 }
456 456
457 const AtomicString& ServiceWorkerContainer::interfaceName() const { 457 const AtomicString& ServiceWorkerContainer::interfaceName() const {
458 return EventTargetNames::ServiceWorkerContainer; 458 return EventTargetNames::ServiceWorkerContainer;
459 } 459 }
460 460
461 ServiceWorkerContainer::ServiceWorkerContainer( 461 ServiceWorkerContainer::ServiceWorkerContainer(
462 ExecutionContext* executionContext) 462 ExecutionContext* executionContext)
463 : ContextLifecycleObserver(executionContext), m_provider(0) { 463 : ContextLifecycleObserver(executionContext), m_provider(0) {
464 if (!executionContext) 464 if (!executionContext)
465 return; 465 return;
466 466
467 if (ServiceWorkerContainerClient* client = 467 if (ServiceWorkerContainerClient* client =
468 ServiceWorkerContainerClient::from(executionContext)) { 468 ServiceWorkerContainerClient::from(executionContext)) {
469 m_provider = client->provider(); 469 m_provider = client->provider();
470 if (m_provider) 470 if (m_provider)
471 m_provider->setClient(this); 471 m_provider->setClient(this);
472 } 472 }
473 } 473 }
474 474
475 } // namespace blink 475 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698