| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 3 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved. | 3 * Copyright (C) 2009, 2011 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 , m_closing(false) | 92 , m_closing(false) |
| 93 , m_eventQueue(WorkerEventQueue::create(this)) | 93 , m_eventQueue(WorkerEventQueue::create(this)) |
| 94 , m_topOrigin(topOrigin) | 94 , m_topOrigin(topOrigin) |
| 95 { | 95 { |
| 96 ScriptWrappable::init(this); | 96 ScriptWrappable::init(this); |
| 97 setSecurityOrigin(SecurityOrigin::create(url)); | 97 setSecurityOrigin(SecurityOrigin::create(url)); |
| 98 } | 98 } |
| 99 | 99 |
| 100 WorkerContext::~WorkerContext() | 100 WorkerContext::~WorkerContext() |
| 101 { | 101 { |
| 102 ASSERT(currentThread() == thread()->threadID()); | 102 ASSERT(thread()->isCurrentThread()); |
| 103 | 103 |
| 104 // Make sure we have no observers. | 104 // Make sure we have no observers. |
| 105 notifyObserversOfStop(); | 105 notifyObserversOfStop(); |
| 106 | 106 |
| 107 // Notify proxy that we are going away. This can free the WorkerThread objec
t, so do not access it after this. | 107 // Notify proxy that we are going away. This can free the WorkerThread objec
t, so do not access it after this. |
| 108 thread()->workerReportingProxy().workerContextDestroyed(); | 108 thread()->workerReportingProxy().workerContextDestroyed(); |
| 109 } | 109 } |
| 110 | 110 |
| 111 void WorkerContext::applyContentSecurityPolicyFromString(const String& policy, C
ontentSecurityPolicy::HeaderType contentSecurityPolicyType) | 111 void WorkerContext::applyContentSecurityPolicyFromString(const String& policy, C
ontentSecurityPolicy::HeaderType contentSecurityPolicyType) |
| 112 { | 112 { |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 { | 295 { |
| 296 ASSERT(isContextThread()); | 296 ASSERT(isContextThread()); |
| 297 if (callStack) | 297 if (callStack) |
| 298 InspectorInstrumentation::addMessageToConsole(this, source, LogMessageTy
pe, level, message, callStack, requestIdentifier); | 298 InspectorInstrumentation::addMessageToConsole(this, source, LogMessageTy
pe, level, message, callStack, requestIdentifier); |
| 299 else | 299 else |
| 300 InspectorInstrumentation::addMessageToConsole(this, source, LogMessageTy
pe, level, message, sourceURL, lineNumber, state, requestIdentifier); | 300 InspectorInstrumentation::addMessageToConsole(this, source, LogMessageTy
pe, level, message, sourceURL, lineNumber, state, requestIdentifier); |
| 301 } | 301 } |
| 302 | 302 |
| 303 bool WorkerContext::isContextThread() const | 303 bool WorkerContext::isContextThread() const |
| 304 { | 304 { |
| 305 return currentThread() == thread()->threadID(); | 305 return thread()->isCurrentThread(); |
| 306 } | 306 } |
| 307 | 307 |
| 308 bool WorkerContext::isJSExecutionForbidden() const | 308 bool WorkerContext::isJSExecutionForbidden() const |
| 309 { | 309 { |
| 310 return m_script->isExecutionForbidden(); | 310 return m_script->isExecutionForbidden(); |
| 311 } | 311 } |
| 312 | 312 |
| 313 EventTargetData* WorkerContext::eventTargetData() | 313 EventTargetData* WorkerContext::eventTargetData() |
| 314 { | 314 { |
| 315 return &m_eventTargetData; | 315 return &m_eventTargetData; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 iter = m_workerObservers.begin(); | 366 iter = m_workerObservers.begin(); |
| 367 } | 367 } |
| 368 } | 368 } |
| 369 | 369 |
| 370 WorkerEventQueue* WorkerContext::eventQueue() const | 370 WorkerEventQueue* WorkerContext::eventQueue() const |
| 371 { | 371 { |
| 372 return m_eventQueue.get(); | 372 return m_eventQueue.get(); |
| 373 } | 373 } |
| 374 | 374 |
| 375 } // namespace WebCore | 375 } // namespace WebCore |
| OLD | NEW |