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

Side by Side Diff: third_party/WebKit/Source/core/workers/WorkerMessagingProxy.cpp

Issue 1609343002: Move hasPendingActivity from ActiveDOMObject to ScriptWrappable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
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 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 10 matching lines...) Expand all
21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 * 25 *
26 */ 26 */
27 27
28 28
29 #include "core/workers/WorkerMessagingProxy.h" 29 #include "core/workers/WorkerMessagingProxy.h"
30 30
31 #include "bindings/core/v8/V8GCController.h"
31 #include "core/dom/CrossThreadTask.h" 32 #include "core/dom/CrossThreadTask.h"
32 #include "core/dom/Document.h" 33 #include "core/dom/Document.h"
33 #include "core/events/ErrorEvent.h" 34 #include "core/events/ErrorEvent.h"
34 #include "core/events/MessageEvent.h" 35 #include "core/events/MessageEvent.h"
35 #include "core/frame/Console.h" 36 #include "core/frame/Console.h"
36 #include "core/frame/FrameConsole.h" 37 #include "core/frame/FrameConsole.h"
37 #include "core/frame/LocalDOMWindow.h" 38 #include "core/frame/LocalDOMWindow.h"
38 #include "core/frame/LocalFrame.h" 39 #include "core/frame/LocalFrame.h"
39 #include "core/frame/csp/ContentSecurityPolicy.h" 40 #include "core/frame/csp/ContentSecurityPolicy.h"
40 #include "core/inspector/ConsoleMessage.h" 41 #include "core/inspector/ConsoleMessage.h"
(...skipping 18 matching lines...) Expand all
59 { 60 {
60 WorkerGlobalScope* globalScope = toWorkerGlobalScope(scriptContext); 61 WorkerGlobalScope* globalScope = toWorkerGlobalScope(scriptContext);
61 globalScope->exceptionHandled(exceptionId, isHandled); 62 globalScope->exceptionHandled(exceptionId, isHandled);
62 } 63 }
63 64
64 void processMessageOnWorkerGlobalScope(PassRefPtr<SerializedScriptValue> message , PassOwnPtr<MessagePortChannelArray> channels, WorkerObjectProxy* workerObjectP roxy, ExecutionContext* scriptContext) 65 void processMessageOnWorkerGlobalScope(PassRefPtr<SerializedScriptValue> message , PassOwnPtr<MessagePortChannelArray> channels, WorkerObjectProxy* workerObjectP roxy, ExecutionContext* scriptContext)
65 { 66 {
66 WorkerGlobalScope* globalScope = toWorkerGlobalScope(scriptContext); 67 WorkerGlobalScope* globalScope = toWorkerGlobalScope(scriptContext);
67 MessagePortArray* ports = MessagePort::entanglePorts(*scriptContext, channel s); 68 MessagePortArray* ports = MessagePort::entanglePorts(*scriptContext, channel s);
68 globalScope->dispatchEvent(MessageEvent::create(ports, message)); 69 globalScope->dispatchEvent(MessageEvent::create(ports, message));
69 workerObjectProxy->confirmMessageFromWorkerObject(scriptContext->hasPendingA ctivity()); 70 workerObjectProxy->confirmMessageFromWorkerObject(V8GCController::hasPending Activity(scriptContext));
70 } 71 }
71 72
72 } // namespace 73 } // namespace
73 74
74 WorkerMessagingProxy::WorkerMessagingProxy(InProcessWorkerBase* workerObject, Pa ssOwnPtrWillBeRawPtr<WorkerClients> workerClients) 75 WorkerMessagingProxy::WorkerMessagingProxy(InProcessWorkerBase* workerObject, Pa ssOwnPtrWillBeRawPtr<WorkerClients> workerClients)
75 : m_executionContext(workerObject->executionContext()) 76 : m_executionContext(workerObject->executionContext())
76 , m_workerObjectProxy(WorkerObjectProxy::create(this)) 77 , m_workerObjectProxy(WorkerObjectProxy::create(this))
77 , m_workerObject(workerObject) 78 , m_workerObject(workerObject)
78 , m_mayBeDestroyed(false) 79 , m_mayBeDestroyed(false)
79 , m_unconfirmedMessageCount(0) 80 , m_unconfirmedMessageCount(0)
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 296
296 // FIXME: This need to be revisited when we support nested worker one day 297 // FIXME: This need to be revisited when we support nested worker one day
297 ASSERT(m_executionContext->isDocument()); 298 ASSERT(m_executionContext->isDocument());
298 Document* document = toDocument(m_executionContext.get()); 299 Document* document = toDocument(m_executionContext.get());
299 LocalFrame* frame = document->frame(); 300 LocalFrame* frame = document->frame();
300 if (frame) 301 if (frame)
301 frame->console().adoptWorkerMessagesAfterTermination(this); 302 frame->console().adoptWorkerMessagesAfterTermination(this);
302 } 303 }
303 304
304 } // namespace blink 305 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698