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

Side by Side Diff: Source/core/dom/ScriptExecutionContext.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
« no previous file with comments | « Source/bindings/v8/ScheduledAction.cpp ('k') | Source/core/workers/WorkerContext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2012 Google Inc. All Rights Reserved. 3 * Copyright (C) 2012 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 // as a result is that dispatchMessages() will be called needlessly. 136 // as a result is that dispatchMessages() will be called needlessly.
137 if (m_messagePorts.contains(port) && port->started()) 137 if (m_messagePorts.contains(port) && port->started())
138 port->dispatchMessages(); 138 port->dispatchMessages();
139 } 139 }
140 } 140 }
141 141
142 void ScriptExecutionContext::createdMessagePort(MessagePort* port) 142 void ScriptExecutionContext::createdMessagePort(MessagePort* port)
143 { 143 {
144 ASSERT(port); 144 ASSERT(port);
145 ASSERT((isDocument() && isMainThread()) 145 ASSERT((isDocument() && isMainThread())
146 || (isWorkerContext() && currentThread() == static_cast<WorkerContext*>( this)->thread()->threadID())); 146 || (isWorkerContext() && static_cast<WorkerContext*>(this)->thread()->is CurrentThread()));
147 147
148 m_messagePorts.add(port); 148 m_messagePorts.add(port);
149 } 149 }
150 150
151 void ScriptExecutionContext::destroyedMessagePort(MessagePort* port) 151 void ScriptExecutionContext::destroyedMessagePort(MessagePort* port)
152 { 152 {
153 ASSERT(port); 153 ASSERT(port);
154 ASSERT((isDocument() && isMainThread()) 154 ASSERT((isDocument() && isMainThread())
155 || (isWorkerContext() && currentThread() == static_cast<WorkerContext*>( this)->thread()->threadID())); 155 || (isWorkerContext() && static_cast<WorkerContext*>(this)->thread()->is CurrentThread()));
156 156
157 m_messagePorts.remove(port); 157 m_messagePorts.remove(port);
158 } 158 }
159 159
160 bool ScriptExecutionContext::canSuspendActiveDOMObjects() 160 bool ScriptExecutionContext::canSuspendActiveDOMObjects()
161 { 161 {
162 // No protection against m_activeDOMObjects changing during iteration: canSu spend() shouldn't execute arbitrary JS. 162 // No protection against m_activeDOMObjects changing during iteration: canSu spend() shouldn't execute arbitrary JS.
163 m_iteratingActiveDOMObjects = true; 163 m_iteratingActiveDOMObjects = true;
164 ActiveDOMObjectsSet::iterator activeObjectsEnd = m_activeDOMObjects.end(); 164 ActiveDOMObjectsSet::iterator activeObjectsEnd = m_activeDOMObjects.end();
165 for (ActiveDOMObjectsSet::iterator iter = m_activeDOMObjects.begin(); iter ! = activeObjectsEnd; ++iter) { 165 for (ActiveDOMObjectsSet::iterator iter = m_activeDOMObjects.begin(); iter ! = activeObjectsEnd; ++iter) {
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 { 368 {
369 } 369 }
370 370
371 void ScriptExecutionContext::setDatabaseContext(DatabaseContext* databaseContext ) 371 void ScriptExecutionContext::setDatabaseContext(DatabaseContext* databaseContext )
372 { 372 {
373 ASSERT(!m_databaseContext); 373 ASSERT(!m_databaseContext);
374 m_databaseContext = databaseContext; 374 m_databaseContext = databaseContext;
375 } 375 }
376 376
377 } // namespace WebCore 377 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/ScheduledAction.cpp ('k') | Source/core/workers/WorkerContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698