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

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

Issue 374583002: Replace CallClosureTask::create(bind()) with createCrossThreadTask() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 29 matching lines...) Expand all
40 40
41 namespace WebCore { 41 namespace WebCore {
42 42
43 PassOwnPtr<WorkerObjectProxy> WorkerObjectProxy::create(ExecutionContext* execut ionContext, WorkerMessagingProxy* messagingProxy) 43 PassOwnPtr<WorkerObjectProxy> WorkerObjectProxy::create(ExecutionContext* execut ionContext, WorkerMessagingProxy* messagingProxy)
44 { 44 {
45 return adoptPtr(new WorkerObjectProxy(executionContext, messagingProxy)); 45 return adoptPtr(new WorkerObjectProxy(executionContext, messagingProxy));
46 } 46 }
47 47
48 void WorkerObjectProxy::postMessageToWorkerObject(PassRefPtr<SerializedScriptVal ue> message, PassOwnPtr<MessagePortChannelArray> channels) 48 void WorkerObjectProxy::postMessageToWorkerObject(PassRefPtr<SerializedScriptVal ue> message, PassOwnPtr<MessagePortChannelArray> channels)
49 { 49 {
50 m_executionContext->postTask(bind(&WorkerMessagingProxy::postMessageToWorker Object, m_messagingProxy, message, channels)); 50 m_executionContext->postTask(createCallClosureTask(&WorkerMessagingProxy::po stMessageToWorkerObject, m_messagingProxy, message, channels));
51 } 51 }
52 52
53 void WorkerObjectProxy::postTaskToMainExecutionContext(PassOwnPtr<ExecutionConte xtTask> task) 53 void WorkerObjectProxy::postTaskToMainExecutionContext(PassOwnPtr<ExecutionConte xtTask> task)
54 { 54 {
55 m_executionContext->postTask(task); 55 m_executionContext->postTask(task);
56 } 56 }
57 57
58 void WorkerObjectProxy::confirmMessageFromWorkerObject(bool hasPendingActivity) 58 void WorkerObjectProxy::confirmMessageFromWorkerObject(bool hasPendingActivity)
59 { 59 {
60 m_executionContext->postTask(bind(&WorkerMessagingProxy::confirmMessageFromW orkerObject, m_messagingProxy, hasPendingActivity)); 60 m_executionContext->postTask(createCallClosureTask(&WorkerMessagingProxy::co nfirmMessageFromWorkerObject, m_messagingProxy, hasPendingActivity));
61 } 61 }
62 62
63 void WorkerObjectProxy::reportPendingActivity(bool hasPendingActivity) 63 void WorkerObjectProxy::reportPendingActivity(bool hasPendingActivity)
64 { 64 {
65 m_executionContext->postTask(bind(&WorkerMessagingProxy::reportPendingActivi ty, m_messagingProxy, hasPendingActivity)); 65 m_executionContext->postTask(createCallClosureTask(&WorkerMessagingProxy::re portPendingActivity, m_messagingProxy, hasPendingActivity));
66 } 66 }
67 67
68 void WorkerObjectProxy::reportException(const String& errorMessage, int lineNumb er, int columnNumber, const String& sourceURL) 68 void WorkerObjectProxy::reportException(const String& errorMessage, int lineNumb er, int columnNumber, const String& sourceURL)
69 { 69 {
70 m_executionContext->postTask(bind(&WorkerMessagingProxy::reportException, m_ messagingProxy, errorMessage.isolatedCopy(), lineNumber, columnNumber, sourceURL .isolatedCopy())); 70 m_executionContext->postTask(createCallClosureTask(&WorkerMessagingProxy::re portException, m_messagingProxy, errorMessage, lineNumber, columnNumber, sourceU RL));
71 } 71 }
72 72
73 void WorkerObjectProxy::reportConsoleMessage(MessageSource source, MessageLevel level, const String& message, int lineNumber, const String& sourceURL) 73 void WorkerObjectProxy::reportConsoleMessage(MessageSource source, MessageLevel level, const String& message, int lineNumber, const String& sourceURL)
74 { 74 {
75 m_executionContext->postTask(bind(&WorkerMessagingProxy::reportConsoleMessag e, m_messagingProxy, source, level, message.isolatedCopy(), lineNumber, sourceUR L.isolatedCopy())); 75 m_executionContext->postTask(createCallClosureTask(&WorkerMessagingProxy::re portConsoleMessage, m_messagingProxy, source, level, message, lineNumber, source URL));
76 } 76 }
77 77
78 void WorkerObjectProxy::postMessageToPageInspector(const String& message) 78 void WorkerObjectProxy::postMessageToPageInspector(const String& message)
79 { 79 {
80 if (m_executionContext->isDocument()) 80 if (m_executionContext->isDocument())
81 toDocument(m_executionContext)->postInspectorTask(bind(&WorkerMessagingP roxy::postMessageToPageInspector, m_messagingProxy, message.isolatedCopy())); 81 toDocument(m_executionContext)->postInspectorTask(createCallClosureTask( &WorkerMessagingProxy::postMessageToPageInspector, m_messagingProxy, message));
82 } 82 }
83 83
84 void WorkerObjectProxy::updateInspectorStateCookie(const String&) 84 void WorkerObjectProxy::updateInspectorStateCookie(const String&)
85 { 85 {
86 notImplemented(); 86 notImplemented();
87 } 87 }
88 88
89 void WorkerObjectProxy::workerGlobalScopeClosed() 89 void WorkerObjectProxy::workerGlobalScopeClosed()
90 { 90 {
91 m_executionContext->postTask(bind(&WorkerMessagingProxy::terminateWorkerGlob alScope, m_messagingProxy)); 91 m_executionContext->postTask(createCallClosureTask(&WorkerMessagingProxy::te rminateWorkerGlobalScope, m_messagingProxy));
92 } 92 }
93 93
94 void WorkerObjectProxy::workerGlobalScopeDestroyed() 94 void WorkerObjectProxy::workerGlobalScopeDestroyed()
95 { 95 {
96 // This will terminate the MessagingProxy. 96 // This will terminate the MessagingProxy.
97 m_executionContext->postTask(bind(&WorkerMessagingProxy::workerGlobalScopeDe stroyed, m_messagingProxy)); 97 m_executionContext->postTask(createCallClosureTask(&WorkerMessagingProxy::wo rkerGlobalScopeDestroyed, m_messagingProxy));
98 } 98 }
99 99
100 WorkerObjectProxy::WorkerObjectProxy(ExecutionContext* executionContext, WorkerM essagingProxy* messagingProxy) 100 WorkerObjectProxy::WorkerObjectProxy(ExecutionContext* executionContext, WorkerM essagingProxy* messagingProxy)
101 : m_executionContext(executionContext) 101 : m_executionContext(executionContext)
102 , m_messagingProxy(messagingProxy) 102 , m_messagingProxy(messagingProxy)
103 { 103 {
104 } 104 }
105 105
106 } // namespace WebCore 106 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698