Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 95 ScriptPromise ServiceWorkerGlobalScope::fetch(ScriptState* scriptState, const St ring& urlstring) | 95 ScriptPromise ServiceWorkerGlobalScope::fetch(ScriptState* scriptState, const St ring& urlstring) |
| 96 { | 96 { |
| 97 KURL url = completeURL(urlstring); | 97 KURL url = completeURL(urlstring); |
| 98 if (!url.isValid()) | 98 if (!url.isValid()) |
| 99 return ScriptPromise::reject(scriptState, V8ThrowException::createTypeEr ror("Invalid URL", scriptState->isolate())); | 99 return ScriptPromise::reject(scriptState, V8ThrowException::createTypeEr ror("Invalid URL", scriptState->isolate())); |
| 100 OwnPtr<ResourceRequest> resourceRequest = adoptPtr(new ResourceRequest(url)) ; | 100 OwnPtr<ResourceRequest> resourceRequest = adoptPtr(new ResourceRequest(url)) ; |
| 101 resourceRequest->setHTTPMethod("GET"); | 101 resourceRequest->setHTTPMethod("GET"); |
| 102 return m_fetchManager->fetch(scriptState, resourceRequest.release()); | 102 return m_fetchManager->fetch(scriptState, resourceRequest.release()); |
| 103 } | 103 } |
| 104 | 104 |
| 105 PassRefPtr<ServiceWorkerClients> ServiceWorkerGlobalScope::clients() | 105 PassRefPtrWillBeRawPtr<ServiceWorkerClients> ServiceWorkerGlobalScope::clients() |
| 106 { | 106 { |
| 107 if (!m_clients) | 107 if (!m_clients) |
| 108 m_clients = ServiceWorkerClients::create(); | 108 m_clients = ServiceWorkerClients::create(); |
| 109 return m_clients; | 109 return m_clients; |
|
haraken
2014/07/11 05:39:12
m_clients.release()
tkent
2014/07/11 05:47:27
I don't think so. This function should not move o
haraken
2014/07/11 05:48:10
oh, you're right.
| |
| 110 } | 110 } |
| 111 | 111 |
| 112 const AtomicString& ServiceWorkerGlobalScope::interfaceName() const | 112 const AtomicString& ServiceWorkerGlobalScope::interfaceName() const |
| 113 { | 113 { |
| 114 return EventTargetNames::ServiceWorkerGlobalScope; | 114 return EventTargetNames::ServiceWorkerGlobalScope; |
| 115 } | 115 } |
| 116 | 116 |
| 117 void ServiceWorkerGlobalScope::trace(Visitor* visitor) | 117 void ServiceWorkerGlobalScope::trace(Visitor* visitor) |
| 118 { | 118 { |
| 119 visitor->trace(m_clients); | |
| 119 WorkerGlobalScope::trace(visitor); | 120 WorkerGlobalScope::trace(visitor); |
| 120 } | 121 } |
| 121 | 122 |
| 122 void ServiceWorkerGlobalScope::logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawP tr<ScriptCallStack> callStack) | 123 void ServiceWorkerGlobalScope::logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawP tr<ScriptCallStack> callStack) |
| 123 { | 124 { |
| 124 WorkerGlobalScope::logExceptionToConsole(errorMessage, sourceURL, lineNumber , columnNumber, callStack); | 125 WorkerGlobalScope::logExceptionToConsole(errorMessage, sourceURL, lineNumber , columnNumber, callStack); |
| 125 addMessageToWorkerConsole(JSMessageSource, ErrorMessageLevel, errorMessage, sourceURL, lineNumber, callStack, 0); | 126 addMessageToWorkerConsole(JSMessageSource, ErrorMessageLevel, errorMessage, sourceURL, lineNumber, callStack, 0); |
| 126 } | 127 } |
| 127 | 128 |
| 128 } // namespace WebCore | 129 } // namespace WebCore |
| OLD | NEW |