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

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

Issue 16434011: Support performance.now() in workers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 7 years, 6 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
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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 { 74 {
75 ASSERT_WITH_SECURITY_IMPLICATION(context->isWorkerContext()); 75 ASSERT_WITH_SECURITY_IMPLICATION(context->isWorkerContext());
76 WorkerContext* workerContext = static_cast<WorkerContext*>(context); 76 WorkerContext* workerContext = static_cast<WorkerContext*>(context);
77 // Notify parent that this context is closed. Parent is responsible for calling WorkerThread::stop(). 77 // Notify parent that this context is closed. Parent is responsible for calling WorkerThread::stop().
78 workerContext->thread()->workerReportingProxy().workerContextClosed(); 78 workerContext->thread()->workerReportingProxy().workerContextClosed();
79 } 79 }
80 80
81 virtual bool isCleanupTask() const { return true; } 81 virtual bool isCleanupTask() const { return true; }
82 }; 82 };
83 83
84 WorkerContext::WorkerContext(const KURL& url, const String& userAgent, PassOwnPt r<GroupSettings> settings, WorkerThread* thread, PassRefPtr<SecurityOrigin> topO rigin) 84 WorkerContext::WorkerContext(const KURL& url, const String& userAgent, PassOwnPt r<GroupSettings> settings, WorkerThread* thread, PassRefPtr<SecurityOrigin> topO rigin, double timeOrigin)
85 : m_url(url) 85 : m_url(url)
86 , m_userAgent(userAgent) 86 , m_userAgent(userAgent)
87 , m_groupSettings(settings) 87 , m_groupSettings(settings)
88 , m_script(adoptPtr(new WorkerScriptController(this))) 88 , m_script(adoptPtr(new WorkerScriptController(this)))
89 , m_thread(thread) 89 , m_thread(thread)
90 , m_workerInspectorController(adoptPtr(new WorkerInspectorController(this))) 90 , m_workerInspectorController(adoptPtr(new WorkerInspectorController(this)))
91 , m_closing(false) 91 , m_closing(false)
92 , m_eventQueue(WorkerEventQueue::create(this)) 92 , m_eventQueue(WorkerEventQueue::create(this))
93 , m_topOrigin(topOrigin) 93 , m_topOrigin(topOrigin)
94 , m_timeOrigin(timeOrigin)
94 { 95 {
95 ScriptWrappable::init(this); 96 ScriptWrappable::init(this);
96 setSecurityOrigin(SecurityOrigin::create(url)); 97 setSecurityOrigin(SecurityOrigin::create(url));
97 } 98 }
98 99
99 WorkerContext::~WorkerContext() 100 WorkerContext::~WorkerContext()
100 { 101 {
101 ASSERT(thread()->isCurrentThread()); 102 ASSERT(thread()->isCurrentThread());
102 103
103 // Make sure we have no observers. 104 // Make sure we have no observers.
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 iter = m_workerObservers.begin(); 366 iter = m_workerObservers.begin();
366 } 367 }
367 } 368 }
368 369
369 WorkerEventQueue* WorkerContext::eventQueue() const 370 WorkerEventQueue* WorkerContext::eventQueue() const
370 { 371 {
371 return m_eventQueue.get(); 372 return m_eventQueue.get();
372 } 373 }
373 374
374 } // namespace WebCore 375 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698