| OLD | NEW | 
|---|
| 1 /* | 1 /* | 
| 2  * Copyright (C) 2008, 2010 Apple Inc. All Rights Reserved. | 2  * Copyright (C) 2008, 2010 Apple Inc. All Rights Reserved. | 
| 3  * Copyright (C) 2009 Google Inc. All Rights Reserved. | 3  * Copyright (C) 2009 Google Inc. All Rights Reserved. | 
| 4  * | 4  * | 
| 5  * Redistribution and use in source and binary forms, with or without | 5  * Redistribution and use in source and binary forms, with or without | 
| 6  * modification, are permitted provided that the following conditions | 6  * modification, are permitted provided that the following conditions | 
| 7  * are met: | 7  * are met: | 
| 8  * 1. Redistributions of source code must retain the above copyright | 8  * 1. 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  * 2. Redistributions in binary form must reproduce the above copyright | 10  * 2. Redistributions in binary form must reproduce the above copyright | 
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 49 { | 49 { | 
| 50     ScriptWrappable::init(this); | 50     ScriptWrappable::init(this); | 
| 51 } | 51 } | 
| 52 | 52 | 
| 53 PassRefPtr<Worker> Worker::create(ExecutionContext* context, const String& url, 
     ExceptionState& exceptionState) | 53 PassRefPtr<Worker> Worker::create(ExecutionContext* context, const String& url, 
     ExceptionState& exceptionState) | 
| 54 { | 54 { | 
| 55     ASSERT(isMainThread()); | 55     ASSERT(isMainThread()); | 
| 56     Document* document = toDocument(context); | 56     Document* document = toDocument(context); | 
| 57     UseCounter::count(context, UseCounter::WorkerStart); | 57     UseCounter::count(context, UseCounter::WorkerStart); | 
| 58     ASSERT(document->page()); | 58     ASSERT(document->page()); | 
| 59     WorkerGlobalScopeProxyProvider* proxyProvider = WorkerGlobalScopeProxyProvid
     er::from(document->page()); | 59     WorkerGlobalScopeProxyProvider* proxyProvider = WorkerGlobalScopeProxyProvid
     er::from(*document->page()); | 
| 60     ASSERT(proxyProvider); | 60     ASSERT(proxyProvider); | 
| 61 | 61 | 
| 62     RefPtr<Worker> worker = adoptRef(new Worker(context)); | 62     RefPtr<Worker> worker = adoptRef(new Worker(context)); | 
| 63 | 63 | 
| 64     worker->suspendIfNeeded(); | 64     worker->suspendIfNeeded(); | 
| 65 | 65 | 
| 66     KURL scriptURL = worker->resolveURL(url, exceptionState); | 66     KURL scriptURL = worker->resolveURL(url, exceptionState); | 
| 67     if (scriptURL.isEmpty()) | 67     if (scriptURL.isEmpty()) | 
| 68         return 0; | 68         return 0; | 
| 69 | 69 | 
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 128             startMode = PauseWorkerGlobalScopeOnStart; | 128             startMode = PauseWorkerGlobalScopeOnStart; | 
| 129         m_contextProxy->startWorkerGlobalScope(m_scriptLoader->url(), executionC
     ontext()->userAgent(m_scriptLoader->url()), m_scriptLoader->script(), startMode)
     ; | 129         m_contextProxy->startWorkerGlobalScope(m_scriptLoader->url(), executionC
     ontext()->userAgent(m_scriptLoader->url()), m_scriptLoader->script(), startMode)
     ; | 
| 130         InspectorInstrumentation::scriptImported(executionContext(), m_scriptLoa
     der->identifier(), m_scriptLoader->script()); | 130         InspectorInstrumentation::scriptImported(executionContext(), m_scriptLoa
     der->identifier(), m_scriptLoader->script()); | 
| 131     } | 131     } | 
| 132     m_scriptLoader = nullptr; | 132     m_scriptLoader = nullptr; | 
| 133 | 133 | 
| 134     unsetPendingActivity(this); | 134     unsetPendingActivity(this); | 
| 135 } | 135 } | 
| 136 | 136 | 
| 137 } // namespace WebCore | 137 } // namespace WebCore | 
| OLD | NEW | 
|---|