OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
3 * Copyright (C) 2012 Google Inc. All Rights Reserved. | 3 * Copyright (C) 2012 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 19 matching lines...) Expand all Loading... |
30 | 30 |
31 #include "CachedScript.h" | 31 #include "CachedScript.h" |
32 #include "DOMTimer.h" | 32 #include "DOMTimer.h" |
33 #include "DatabaseContext.h" | 33 #include "DatabaseContext.h" |
34 #include "ErrorEvent.h" | 34 #include "ErrorEvent.h" |
35 #include "EventTarget.h" | 35 #include "EventTarget.h" |
36 #include "MessagePort.h" | 36 #include "MessagePort.h" |
37 #include "PublicURLManager.h" | 37 #include "PublicURLManager.h" |
38 #include "ScriptCallStack.h" | 38 #include "ScriptCallStack.h" |
39 #include "Settings.h" | 39 #include "Settings.h" |
40 #include "WebCoreMemoryInstrumentation.h" | |
41 #include "WorkerContext.h" | 40 #include "WorkerContext.h" |
42 #include "WorkerThread.h" | 41 #include "WorkerThread.h" |
43 #include <wtf/MainThread.h> | 42 #include <wtf/MainThread.h> |
44 #include <wtf/MemoryInstrumentationHashMap.h> | |
45 #include <wtf/MemoryInstrumentationVector.h> | |
46 #include <wtf/Vector.h> | 43 #include <wtf/Vector.h> |
47 | 44 |
48 namespace WTF { | |
49 | |
50 template<> struct SequenceMemoryInstrumentationTraits<WebCore::ContextDestructio
nObserver*> { | |
51 template <typename I> static void reportMemoryUsage(I, I, MemoryClassInfo&)
{ } | |
52 }; | |
53 | |
54 } | |
55 namespace WebCore { | 45 namespace WebCore { |
56 | 46 |
57 class ProcessMessagesSoonTask : public ScriptExecutionContext::Task { | 47 class ProcessMessagesSoonTask : public ScriptExecutionContext::Task { |
58 public: | 48 public: |
59 static PassOwnPtr<ProcessMessagesSoonTask> create() | 49 static PassOwnPtr<ProcessMessagesSoonTask> create() |
60 { | 50 { |
61 return adoptPtr(new ProcessMessagesSoonTask); | 51 return adoptPtr(new ProcessMessagesSoonTask); |
62 } | 52 } |
63 | 53 |
64 virtual void performTask(ScriptExecutionContext* context) | 54 virtual void performTask(ScriptExecutionContext* context) |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 DOMTimer* timer = iter->value; | 357 DOMTimer* timer = iter->value; |
368 timer->didChangeAlignmentInterval(); | 358 timer->didChangeAlignmentInterval(); |
369 } | 359 } |
370 } | 360 } |
371 | 361 |
372 double ScriptExecutionContext::timerAlignmentInterval() const | 362 double ScriptExecutionContext::timerAlignmentInterval() const |
373 { | 363 { |
374 return Settings::defaultDOMTimerAlignmentInterval(); | 364 return Settings::defaultDOMTimerAlignmentInterval(); |
375 } | 365 } |
376 | 366 |
377 void ScriptExecutionContext::reportMemoryUsage(MemoryObjectInfo* memoryObjectInf
o) const | |
378 { | |
379 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); | |
380 SecurityContext::reportMemoryUsage(memoryObjectInfo); | |
381 info.addMember(m_messagePorts, "messagePorts"); | |
382 info.addMember(m_destructionObservers, "destructionObservers"); | |
383 info.addMember(m_activeDOMObjects, "activeDOMObjects"); | |
384 info.addMember(m_timeouts, "timeouts"); | |
385 info.addMember(m_pendingExceptions, "pendingExceptions"); | |
386 info.addMember(m_publicURLManager, "publicURLManager"); | |
387 } | |
388 | |
389 ScriptExecutionContext::Task::~Task() | 367 ScriptExecutionContext::Task::~Task() |
390 { | 368 { |
391 } | 369 } |
392 | 370 |
393 void ScriptExecutionContext::setDatabaseContext(DatabaseContext* databaseContext
) | 371 void ScriptExecutionContext::setDatabaseContext(DatabaseContext* databaseContext
) |
394 { | 372 { |
395 ASSERT(!m_databaseContext); | 373 ASSERT(!m_databaseContext); |
396 m_databaseContext = databaseContext; | 374 m_databaseContext = databaseContext; |
397 } | 375 } |
398 | 376 |
399 } // namespace WebCore | 377 } // namespace WebCore |
OLD | NEW |