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

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

Issue 106353005: Expose performance.memory in workers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@Perf-Memory-SharedWorker
Patch Set: Created 6 years, 9 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, 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 virtual void performTask(ExecutionContext *context) 66 virtual void performTask(ExecutionContext *context)
67 { 67 {
68 WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context); 68 WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context);
69 // Notify parent that this context is closed. Parent is responsible for calling WorkerThread::stop(). 69 // Notify parent that this context is closed. Parent is responsible for calling WorkerThread::stop().
70 workerGlobalScope->thread()->workerReportingProxy().workerGlobalScopeClo sed(); 70 workerGlobalScope->thread()->workerReportingProxy().workerGlobalScopeClo sed();
71 } 71 }
72 72
73 virtual bool isCleanupTask() const { return true; } 73 virtual bool isCleanupTask() const { return true; }
74 }; 74 };
75 75
76 WorkerGlobalScope::WorkerGlobalScope(const KURL& url, const String& userAgent, W orkerThread* thread, double timeOrigin, PassOwnPtr<WorkerClients> workerClients) 76 WorkerGlobalScope::WorkerGlobalScope(const KURL& url, const String& userAgent, W orkerThread* thread, double timeOrigin, PassOwnPtr<WorkerClients> workerClients, PassOwnPtr<WorkerSettings> settings)
77 : m_url(url) 77 : m_url(url)
78 , m_userAgent(userAgent) 78 , m_userAgent(userAgent)
79 , m_script(adoptPtr(new WorkerScriptController(*this))) 79 , m_script(adoptPtr(new WorkerScriptController(*this)))
80 , m_thread(thread) 80 , m_thread(thread)
81 , m_workerInspectorController(adoptPtr(new WorkerInspectorController(this))) 81 , m_workerInspectorController(adoptPtr(new WorkerInspectorController(this)))
82 , m_closing(false) 82 , m_closing(false)
83 , m_eventQueue(WorkerEventQueue::create(this)) 83 , m_eventQueue(WorkerEventQueue::create(this))
84 , m_workerClients(workerClients) 84 , m_workerClients(workerClients)
85 , m_timeOrigin(timeOrigin) 85 , m_timeOrigin(timeOrigin)
86 , m_workerSettings(settings)
86 { 87 {
87 ScriptWrappable::init(this); 88 ScriptWrappable::init(this);
88 setClient(this); 89 setClient(this);
89 setSecurityOrigin(SecurityOrigin::create(url)); 90 setSecurityOrigin(SecurityOrigin::create(url));
90 m_workerClients->reattachThread(); 91 m_workerClients->reattachThread();
91 } 92 }
92 93
93 WorkerGlobalScope::~WorkerGlobalScope() 94 WorkerGlobalScope::~WorkerGlobalScope()
94 { 95 {
95 ASSERT(thread()->isCurrentThread()); 96 ASSERT(thread()->isCurrentThread());
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 { 325 {
325 return script()->idleNotification(); 326 return script()->idleNotification();
326 } 327 }
327 328
328 WorkerEventQueue* WorkerGlobalScope::eventQueue() const 329 WorkerEventQueue* WorkerGlobalScope::eventQueue() const
329 { 330 {
330 return m_eventQueue.get(); 331 return m_eventQueue.get();
331 } 332 }
332 333
333 } // namespace WebCore 334 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698