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

Side by Side Diff: Source/core/workers/WorkerContext.cpp

Issue 15338009: Move workers to Chromium threading (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Revert actual model change Created 7 years, 7 months 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 | Annotate | Revision Log
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « Source/core/dom/ScriptExecutionContext.cpp ('k') | Source/core/workers/WorkerMessagingProxy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698