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

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

Powered by Google App Engine
This is Rietveld 408576698