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

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

Issue 1893983002: Simplify handling of Transferable objects while (de)serializing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove Transferable.cpp, not needed after all. Created 4 years, 8 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 #include "public/platform/WebString.h" 42 #include "public/platform/WebString.h"
43 #include "public/platform/modules/serviceworker/WebServiceWorkerState.h" 43 #include "public/platform/modules/serviceworker/WebServiceWorkerState.h"
44 44
45 namespace blink { 45 namespace blink {
46 46
47 const AtomicString& ServiceWorker::interfaceName() const 47 const AtomicString& ServiceWorker::interfaceName() const
48 { 48 {
49 return EventTargetNames::ServiceWorker; 49 return EventTargetNames::ServiceWorker;
50 } 50 }
51 51
52 void ServiceWorker::postMessage(ExecutionContext* context, PassRefPtr<Serialized ScriptValue> message, const MessagePortArray* ports, ExceptionState& exceptionSt ate) 52 void ServiceWorker::postMessage(ExecutionContext* context, PassRefPtr<Serialized ScriptValue> message, const MessagePortArray& ports, ExceptionState& exceptionSt ate)
53 { 53 {
54 ServiceWorkerContainerClient* client = ServiceWorkerContainerClient::from(ge tExecutionContext()); 54 ServiceWorkerContainerClient* client = ServiceWorkerContainerClient::from(ge tExecutionContext());
55 if (!client || !client->provider()) { 55 if (!client || !client->provider()) {
56 exceptionState.throwDOMException(InvalidStateError, "Failed to post a me ssage: No associated provider is available."); 56 exceptionState.throwDOMException(InvalidStateError, "Failed to post a me ssage: No associated provider is available.");
57 return; 57 return;
58 } 58 }
59 59
60 // Disentangle the port in preparation for sending it to the remote context. 60 // Disentangle the port in preparation for sending it to the remote context.
61 OwnPtr<MessagePortChannelArray> channels = MessagePort::disentanglePorts(con text, ports, exceptionState); 61 OwnPtr<MessagePortChannelArray> channels = MessagePort::disentanglePorts(con text, ports, exceptionState);
62 if (exceptionState.hadException()) 62 if (exceptionState.hadException())
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 { 153 {
154 ASSERT(m_handle); 154 ASSERT(m_handle);
155 m_handle->serviceWorker()->setProxy(this); 155 m_handle->serviceWorker()->setProxy(this);
156 } 156 }
157 157
158 ServiceWorker::~ServiceWorker() 158 ServiceWorker::~ServiceWorker()
159 { 159 {
160 } 160 }
161 161
162 } // namespace blink 162 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698