| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/renderer/debug_message_handler.h" | 5 #include "chrome/renderer/debug_message_handler.h" |
| 6 #include "chrome/renderer/render_view.h" | 6 #include "chrome/renderer/render_view.h" |
| 7 | 7 |
| 8 //////////////////////////////////////// | 8 //////////////////////////////////////// |
| 9 // methods called from the RenderThread | 9 // methods called from the RenderThread |
| 10 | 10 |
| 11 DebugMessageHandler::DebugMessageHandler(RenderView* view) : | 11 DebugMessageHandler::DebugMessageHandler(RenderView* view) : |
| 12 debugger_(NULL), view_(view), channel_(NULL) { | 12 debugger_(NULL), view_(view), channel_(NULL) { |
| 13 view_loop_ = MessageLoop::current(); | 13 view_loop_ = MessageLoop::current(); |
| 14 view_routing_id_ = view_->routing_id(); | 14 view_routing_id_ = view_->routing_id(); |
| 15 } | 15 } |
| 16 | 16 |
| 17 DebugMessageHandler::~DebugMessageHandler() { | 17 DebugMessageHandler::~DebugMessageHandler() { |
| 18 } | 18 } |
| 19 | 19 |
| 20 void DebugMessageHandler::EvaluateScriptUrl(const std::wstring& url) { | 20 void DebugMessageHandler::EvaluateScriptUrl(const std::wstring& url) { |
| 21 DCHECK(MessageLoop::current() == view_loop_); | 21 DCHECK(MessageLoop::current() == view_loop_); |
| 22 // It's possible that this will get cleared out from under us. | 22 // It's possible that this will get cleared out from under us. |
| 23 RenderView* view = view_; | 23 RenderView* view = view_; |
| 24 if (view) { | 24 if (view) { |
| 25 view->EvaluateScriptUrl(L"", url); | 25 view->EvaluateScript(L"", url, L""); |
| 26 } | 26 } |
| 27 } | 27 } |
| 28 | 28 |
| 29 /////////////////////////////////////////////// | 29 /////////////////////////////////////////////// |
| 30 // all methods below called from the IO thread | 30 // all methods below called from the IO thread |
| 31 | 31 |
| 32 void DebugMessageHandler::DebuggerOutput(const std::wstring& out) { | 32 void DebugMessageHandler::DebuggerOutput(const std::wstring& out) { |
| 33 channel_->Send(new ViewHostMsg_DebuggerOutput(view_routing_id_, out)); | 33 channel_->Send(new ViewHostMsg_DebuggerOutput(view_routing_id_, out)); |
| 34 } | 34 } |
| 35 | 35 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 // hang forever and never exit. To avoid this, we look for close messages | 105 // hang forever and never exit. To avoid this, we look for close messages |
| 106 // and tell the debugger to shutdown. | 106 // and tell the debugger to shutdown. |
| 107 IPC_MESSAGE_HANDLER_GENERIC(ViewMsg_Close, | 107 IPC_MESSAGE_HANDLER_GENERIC(ViewMsg_Close, |
| 108 if (debugger_) OnDetach(); | 108 if (debugger_) OnDetach(); |
| 109 handled = false;) | 109 handled = false;) |
| 110 IPC_MESSAGE_UNHANDLED(handled = false); | 110 IPC_MESSAGE_UNHANDLED(handled = false); |
| 111 IPC_END_MESSAGE_MAP() | 111 IPC_END_MESSAGE_MAP() |
| 112 return handled; | 112 return handled; |
| 113 } | 113 } |
| 114 | 114 |
| OLD | NEW |