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

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: Created 6 years, 1 month 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 WebString messageString = message->toWireString(); 93 WebString messageString = message->toWireString();
94 OwnPtr<WebMessagePortChannelArray> webChannels = MessagePort::toWebMessagePo rtChannelArray(channels.release()); 94 OwnPtr<WebMessagePortChannelArray> webChannels = MessagePort::toWebMessagePo rtChannelArray(channels.release());
95 m_outerWorker->postMessage(messageString, webChannels.leakPtr()); 95 m_outerWorker->postMessage(messageString, webChannels.leakPtr());
96 } 96 }
97 97
98 void ServiceWorker::terminate(ExceptionState& exceptionState) 98 void ServiceWorker::terminate(ExceptionState& exceptionState)
99 { 99 {
100 exceptionState.throwDOMException(InvalidAccessError, "Not supported."); 100 exceptionState.throwDOMException(InvalidAccessError, "Not supported.");
101 } 101 }
102 102
103 void ServiceWorker::internalsTerminate()
104 {
105 m_outerWorker->terminate();
106 }
107
103 bool ServiceWorker::isReady() 108 bool ServiceWorker::isReady()
104 { 109 {
105 return m_proxyState == Ready; 110 return m_proxyState == Ready;
106 } 111 }
107 112
108 void ServiceWorker::dispatchStateChangeEvent() 113 void ServiceWorker::dispatchStateChangeEvent()
109 { 114 {
110 ASSERT(isReady()); 115 ASSERT(isReady());
111 this->dispatchEvent(Event::create(EventTypeNames::statechange)); 116 this->dispatchEvent(Event::create(EventTypeNames::statechange));
112 } 117 }
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 ServiceWorker::ServiceWorker(ExecutionContext* executionContext, PassOwnPtr<WebS erviceWorker> worker) 257 ServiceWorker::ServiceWorker(ExecutionContext* executionContext, PassOwnPtr<WebS erviceWorker> worker)
253 : AbstractWorker(executionContext) 258 : AbstractWorker(executionContext)
254 , m_outerWorker(worker) 259 , m_outerWorker(worker)
255 , m_proxyState(Initial) 260 , m_proxyState(Initial)
256 { 261 {
257 ASSERT(m_outerWorker); 262 ASSERT(m_outerWorker);
258 m_outerWorker->setProxy(this); 263 m_outerWorker->setProxy(this);
259 } 264 }
260 265
261 } // namespace blink 266 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698