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

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

Issue 26878003: Reduce repetitive EventTarget subclassing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix nit Created 7 years, 2 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/core/workers/WorkerGlobalScope.h ('k') | Source/core/xml/XMLHttpRequestEventTarget.h » ('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) 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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 bool WorkerGlobalScope::isContextThread() const 257 bool WorkerGlobalScope::isContextThread() const
258 { 258 {
259 return thread()->isCurrentThread(); 259 return thread()->isCurrentThread();
260 } 260 }
261 261
262 bool WorkerGlobalScope::isJSExecutionForbidden() const 262 bool WorkerGlobalScope::isJSExecutionForbidden() const
263 { 263 {
264 return m_script->isExecutionForbidden(); 264 return m_script->isExecutionForbidden();
265 } 265 }
266 266
267 EventTargetData* WorkerGlobalScope::eventTargetData()
268 {
269 return &m_eventTargetData;
270 }
271
272 EventTargetData* WorkerGlobalScope::ensureEventTargetData()
273 {
274 return &m_eventTargetData;
275 }
276
277 WorkerGlobalScope::Observer::Observer(WorkerGlobalScope* context) 267 WorkerGlobalScope::Observer::Observer(WorkerGlobalScope* context)
278 : m_context(context) 268 : m_context(context)
279 { 269 {
280 ASSERT(m_context && m_context->isContextThread()); 270 ASSERT(m_context && m_context->isContextThread());
281 m_context->registerObserver(this); 271 m_context->registerObserver(this);
282 } 272 }
283 273
284 WorkerGlobalScope::Observer::~Observer() 274 WorkerGlobalScope::Observer::~Observer()
285 { 275 {
286 if (!m_context) 276 if (!m_context)
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 { 315 {
326 return script()->idleNotification(); 316 return script()->idleNotification();
327 } 317 }
328 318
329 WorkerEventQueue* WorkerGlobalScope::eventQueue() const 319 WorkerEventQueue* WorkerGlobalScope::eventQueue() const
330 { 320 {
331 return m_eventQueue.get(); 321 return m_eventQueue.get();
332 } 322 }
333 323
334 } // namespace WebCore 324 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/workers/WorkerGlobalScope.h ('k') | Source/core/xml/XMLHttpRequestEventTarget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698