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

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

Issue 1156703003: ServiceWorker: Introduce ExtendableMessageEvent to replace MessageEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: update 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 namespace blink { 43 namespace blink {
44 44
45 const AtomicString& ServiceWorker::interfaceName() const 45 const AtomicString& ServiceWorker::interfaceName() const
46 { 46 {
47 return EventTargetNames::ServiceWorker; 47 return EventTargetNames::ServiceWorker;
48 } 48 }
49 49
50 void ServiceWorker::postMessage(ExecutionContext* context, PassRefPtr<Serialized ScriptValue> message, const MessagePortArray* ports, ExceptionState& exceptionSt ate) 50 void ServiceWorker::postMessage(ExecutionContext* context, PassRefPtr<Serialized ScriptValue> message, const MessagePortArray* ports, ExceptionState& exceptionSt ate)
51 { 51 {
52 if (m_wasStopped)
53 return;
52 // Disentangle the port in preparation for sending it to the remote context. 54 // Disentangle the port in preparation for sending it to the remote context.
53 OwnPtr<MessagePortChannelArray> channels = MessagePort::disentanglePorts(con text, ports, exceptionState); 55 OwnPtr<MessagePortChannelArray> channels = MessagePort::disentanglePorts(con text, ports, exceptionState);
54 if (exceptionState.hadException()) 56 if (exceptionState.hadException())
55 return; 57 return;
56 if (m_outerWorker->state() == WebServiceWorkerStateRedundant) { 58 if (m_outerWorker->state() == WebServiceWorkerStateRedundant) {
57 exceptionState.throwDOMException(InvalidStateError, "ServiceWorker is in redundant state."); 59 exceptionState.throwDOMException(InvalidStateError, "ServiceWorker is in redundant state.");
58 return; 60 return;
59 } 61 }
60 62
61 WebString messageString = message->toWireString(); 63 WebString messageString = message->toWireString();
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 { 149 {
148 ASSERT(m_outerWorker); 150 ASSERT(m_outerWorker);
149 m_outerWorker->setProxy(this); 151 m_outerWorker->setProxy(this);
150 } 152 }
151 153
152 ServiceWorker::~ServiceWorker() 154 ServiceWorker::~ServiceWorker()
153 { 155 {
154 } 156 }
155 157
156 } // namespace blink 158 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698