| 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 30 matching lines...) Expand all Loading... |
| 41 #include "core/workers/WorkerGlobalScope.h" | 41 #include "core/workers/WorkerGlobalScope.h" |
| 42 #include "core/workers/WorkerLoaderProxy.h" | 42 #include "core/workers/WorkerLoaderProxy.h" |
| 43 #include "core/workers/WorkerScriptLoader.h" | 43 #include "core/workers/WorkerScriptLoader.h" |
| 44 #include "core/workers/WorkerScriptLoaderClient.h" | 44 #include "core/workers/WorkerScriptLoaderClient.h" |
| 45 #include "core/workers/WorkerThreadStartupData.h" | 45 #include "core/workers/WorkerThreadStartupData.h" |
| 46 #include "modules/serviceworkers/ServiceWorkerThread.h" | 46 #include "modules/serviceworkers/ServiceWorkerThread.h" |
| 47 #include "platform/NotImplemented.h" | 47 #include "platform/NotImplemented.h" |
| 48 #include "platform/SharedBuffer.h" | 48 #include "platform/SharedBuffer.h" |
| 49 #include "platform/heap/Handle.h" | 49 #include "platform/heap/Handle.h" |
| 50 #include "platform/network/ContentSecurityPolicyParsers.h" | 50 #include "platform/network/ContentSecurityPolicyParsers.h" |
| 51 #include "public/platform/WebURLRequest.h" |
| 51 #include "public/web/WebServiceWorkerContextClient.h" | 52 #include "public/web/WebServiceWorkerContextClient.h" |
| 52 #include "public/web/WebServiceWorkerNetworkProvider.h" | 53 #include "public/web/WebServiceWorkerNetworkProvider.h" |
| 53 #include "public/web/WebSettings.h" | 54 #include "public/web/WebSettings.h" |
| 54 #include "public/web/WebView.h" | 55 #include "public/web/WebView.h" |
| 55 #include "public/web/WebWorkerPermissionClientProxy.h" | 56 #include "public/web/WebWorkerPermissionClientProxy.h" |
| 56 #include "web/ServiceWorkerGlobalScopeClientImpl.h" | 57 #include "web/ServiceWorkerGlobalScopeClientImpl.h" |
| 57 #include "web/ServiceWorkerGlobalScopeProxy.h" | 58 #include "web/ServiceWorkerGlobalScopeProxy.h" |
| 58 #include "web/WebDataSourceImpl.h" | 59 #include "web/WebDataSourceImpl.h" |
| 59 #include "web/WebLocalFrameImpl.h" | 60 #include "web/WebLocalFrameImpl.h" |
| 60 #include "web/WorkerPermissionClient.h" | 61 #include "web/WorkerPermissionClient.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 74 | 75 |
| 75 virtual ~Loader() | 76 virtual ~Loader() |
| 76 { | 77 { |
| 77 m_scriptLoader->setClient(0); | 78 m_scriptLoader->setClient(0); |
| 78 } | 79 } |
| 79 | 80 |
| 80 void load(ExecutionContext* loadingContext, const KURL& scriptURL, const Clo
sure& callback) | 81 void load(ExecutionContext* loadingContext, const KURL& scriptURL, const Clo
sure& callback) |
| 81 { | 82 { |
| 82 ASSERT(loadingContext); | 83 ASSERT(loadingContext); |
| 83 m_callback = callback; | 84 m_callback = callback; |
| 84 m_scriptLoader->setTargetType(ResourceRequest::TargetIsServiceWorker); | 85 m_scriptLoader->setRequestContext(blink::WebURLRequest::RequestContextSe
rviceWorker); |
| 85 m_scriptLoader->loadAsynchronously( | 86 m_scriptLoader->loadAsynchronously( |
| 86 *loadingContext, scriptURL, DenyCrossOriginRequests, this); | 87 *loadingContext, scriptURL, DenyCrossOriginRequests, this); |
| 87 } | 88 } |
| 88 | 89 |
| 89 virtual void notifyFinished() OVERRIDE | 90 virtual void notifyFinished() OVERRIDE |
| 90 { | 91 { |
| 91 m_callback(); | 92 m_callback(); |
| 92 } | 93 } |
| 93 | 94 |
| 94 void cancel() | 95 void cancel() |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 m_mainScriptLoader.clear(); | 359 m_mainScriptLoader.clear(); |
| 359 | 360 |
| 360 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *toW
ebLocalFrameImpl(m_mainFrame)->frame()->document(), *m_workerContextClient); | 361 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *toW
ebLocalFrameImpl(m_mainFrame)->frame()->document(), *m_workerContextClient); |
| 361 m_loaderProxy = LoaderProxy::create(*this); | 362 m_loaderProxy = LoaderProxy::create(*this); |
| 362 | 363 |
| 363 m_workerThread = ServiceWorkerThread::create(*m_loaderProxy, *m_workerGlobal
ScopeProxy, startupData.release()); | 364 m_workerThread = ServiceWorkerThread::create(*m_loaderProxy, *m_workerGlobal
ScopeProxy, startupData.release()); |
| 364 m_workerThread->start(); | 365 m_workerThread->start(); |
| 365 } | 366 } |
| 366 | 367 |
| 367 } // namespace blink | 368 } // namespace blink |
| OLD | NEW |