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

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

Issue 2141673002: [DevTools] Always send a copy of worker message through the page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 4 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) 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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 terminateInternally(); 261 terminateInternally();
262 } 262 }
263 263
264 void InProcessWorkerMessagingProxy::postMessageToPageInspector(const String& mes sage) 264 void InProcessWorkerMessagingProxy::postMessageToPageInspector(const String& mes sage)
265 { 265 {
266 DCHECK(isParentContextThread()); 266 DCHECK(isParentContextThread());
267 if (m_workerInspectorProxy) 267 if (m_workerInspectorProxy)
268 m_workerInspectorProxy->dispatchMessageFromWorker(message); 268 m_workerInspectorProxy->dispatchMessageFromWorker(message);
269 } 269 }
270 270
271 void InProcessWorkerMessagingProxy::postWorkerConsoleAgentEnabled()
272 {
273 DCHECK(isParentContextThread());
274 if (m_workerInspectorProxy)
275 m_workerInspectorProxy->workerConsoleAgentEnabled();
276 }
277
278 void InProcessWorkerMessagingProxy::confirmMessageFromWorkerObject(bool hasPendi ngActivity) 271 void InProcessWorkerMessagingProxy::confirmMessageFromWorkerObject(bool hasPendi ngActivity)
279 { 272 {
280 DCHECK(isParentContextThread()); 273 DCHECK(isParentContextThread());
281 if (!m_askedToTerminate) { 274 if (!m_askedToTerminate) {
282 DCHECK(m_unconfirmedMessageCount); 275 DCHECK(m_unconfirmedMessageCount);
283 --m_unconfirmedMessageCount; 276 --m_unconfirmedMessageCount;
284 } 277 }
285 reportPendingActivity(hasPendingActivity); 278 reportPendingActivity(hasPendingActivity);
286 } 279 }
287 280
(...skipping 17 matching lines...) Expand all
305 298
306 bool InProcessWorkerMessagingProxy::isParentContextThread() const 299 bool InProcessWorkerMessagingProxy::isParentContextThread() const
307 { 300 {
308 // TODO(nhiroki): Nested worker is not supported yet, so the parent context 301 // TODO(nhiroki): Nested worker is not supported yet, so the parent context
309 // thread should be equal to the main thread (http://crbug.com/31666). 302 // thread should be equal to the main thread (http://crbug.com/31666).
310 DCHECK(getExecutionContext()->isDocument()); 303 DCHECK(getExecutionContext()->isDocument());
311 return isMainThread(); 304 return isMainThread();
312 } 305 }
313 306
314 } // namespace blink 307 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698