| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "core/timing/MemoryInfo.h" | 42 #include "core/timing/MemoryInfo.h" |
| 43 #include "platform/TraceEvent.h" | 43 #include "platform/TraceEvent.h" |
| 44 #include "wtf/text/CString.h" | 44 #include "wtf/text/CString.h" |
| 45 #include "wtf/text/WTFString.h" | 45 #include "wtf/text/WTFString.h" |
| 46 | 46 |
| 47 namespace blink { | 47 namespace blink { |
| 48 | 48 |
| 49 Console::Console(LocalFrame* frame) | 49 Console::Console(LocalFrame* frame) |
| 50 : DOMWindowProperty(frame) | 50 : DOMWindowProperty(frame) |
| 51 { | 51 { |
| 52 ScriptWrappable::init(this); | |
| 53 } | 52 } |
| 54 | 53 |
| 55 Console::~Console() | 54 Console::~Console() |
| 56 { | 55 { |
| 57 } | 56 } |
| 58 | 57 |
| 59 ExecutionContext* Console::context() | 58 ExecutionContext* Console::context() |
| 60 { | 59 { |
| 61 if (!m_frame) | 60 if (!m_frame) |
| 62 return 0; | 61 return 0; |
| 63 return m_frame->document(); | 62 return m_frame->document(); |
| 64 } | 63 } |
| 65 | 64 |
| 66 void Console::reportMessageToConsole(PassRefPtrWillBeRawPtr<ConsoleMessage> cons
oleMessage) | 65 void Console::reportMessageToConsole(PassRefPtrWillBeRawPtr<ConsoleMessage> cons
oleMessage) |
| 67 { | 66 { |
| 68 if (!m_frame) | 67 if (!m_frame) |
| 69 return; | 68 return; |
| 70 | 69 |
| 71 m_frame->console().addMessage(consoleMessage); | 70 m_frame->console().addMessage(consoleMessage); |
| 72 } | 71 } |
| 73 | 72 |
| 74 PassRefPtrWillBeRawPtr<MemoryInfo> Console::memory() const | 73 PassRefPtrWillBeRawPtr<MemoryInfo> Console::memory() const |
| 75 { | 74 { |
| 76 // FIXME: Because we create a new object here each time, | 75 // FIXME: Because we create a new object here each time, |
| 77 // console.memory !== console.memory, which seems wrong. | 76 // console.memory !== console.memory, which seems wrong. |
| 78 return MemoryInfo::create(); | 77 return MemoryInfo::create(); |
| 79 } | 78 } |
| 80 | 79 |
| 81 } // namespace blink | 80 } // namespace blink |
| OLD | NEW |