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

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

Issue 695643002: Add terminateServiceWorker method for layout tests - blink side (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 WebString messageString = message->toWireString(); 94 WebString messageString = message->toWireString();
95 OwnPtr<WebMessagePortChannelArray> webChannels = MessagePort::toWebMessagePo rtChannelArray(channels.release()); 95 OwnPtr<WebMessagePortChannelArray> webChannels = MessagePort::toWebMessagePo rtChannelArray(channels.release());
96 m_outerWorker->postMessage(messageString, webChannels.leakPtr()); 96 m_outerWorker->postMessage(messageString, webChannels.leakPtr());
97 } 97 }
98 98
99 void ServiceWorker::terminate(ExceptionState& exceptionState) 99 void ServiceWorker::terminate(ExceptionState& exceptionState)
100 { 100 {
101 exceptionState.throwDOMException(InvalidAccessError, "Not supported."); 101 exceptionState.throwDOMException(InvalidAccessError, "Not supported.");
102 } 102 }
103 103
104 void ServiceWorker::internalsTerminate()
105 {
106 m_outerWorker->terminate();
107 }
108
104 bool ServiceWorker::isReady() 109 bool ServiceWorker::isReady()
105 { 110 {
106 return m_proxyState == Ready; 111 return m_proxyState == Ready;
107 } 112 }
108 113
109 void ServiceWorker::dispatchStateChangeEvent() 114 void ServiceWorker::dispatchStateChangeEvent()
110 { 115 {
111 ASSERT(isReady()); 116 ASSERT(isReady());
112 this->dispatchEvent(Event::create(EventTypeNames::statechange)); 117 this->dispatchEvent(Event::create(EventTypeNames::statechange));
113 } 118 }
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 ServiceWorker::ServiceWorker(ExecutionContext* executionContext, PassOwnPtr<WebS erviceWorker> worker) 258 ServiceWorker::ServiceWorker(ExecutionContext* executionContext, PassOwnPtr<WebS erviceWorker> worker)
254 : AbstractWorker(executionContext) 259 : AbstractWorker(executionContext)
255 , m_outerWorker(worker) 260 , m_outerWorker(worker)
256 , m_proxyState(Initial) 261 , m_proxyState(Initial)
257 { 262 {
258 ASSERT(m_outerWorker); 263 ASSERT(m_outerWorker);
259 m_outerWorker->setProxy(this); 264 m_outerWorker->setProxy(this);
260 } 265 }
261 266
262 } // namespace blink 267 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/serviceworkers/ServiceWorker.h ('k') | Source/modules/serviceworkers/testing/InternalsServiceWorker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698