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

Side by Side Diff: src/debug.cc

Issue 100158: Create a transition API for the debug message handler (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 7 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 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1402 matching lines...) Expand 10 before | Expand all | Expand 10 after
1413 0, NULL, &caught_exception); 1413 0, NULL, &caught_exception);
1414 } 1414 }
1415 1415
1416 1416
1417 Mutex* Debugger::debugger_access_ = OS::CreateMutex(); 1417 Mutex* Debugger::debugger_access_ = OS::CreateMutex();
1418 Handle<Object> Debugger::event_listener_ = Handle<Object>(); 1418 Handle<Object> Debugger::event_listener_ = Handle<Object>();
1419 Handle<Object> Debugger::event_listener_data_ = Handle<Object>(); 1419 Handle<Object> Debugger::event_listener_data_ = Handle<Object>();
1420 bool Debugger::compiling_natives_ = false; 1420 bool Debugger::compiling_natives_ = false;
1421 bool Debugger::is_loading_debugger_ = false; 1421 bool Debugger::is_loading_debugger_ = false;
1422 bool Debugger::never_unload_debugger_ = false; 1422 bool Debugger::never_unload_debugger_ = false;
1423 v8::Debug::MessageHandler Debugger::message_handler_ = NULL; 1423 v8::Debug::MessageHandler2 Debugger::message_handler_ = NULL;
1424 bool Debugger::message_handler_cleared_ = false; 1424 bool Debugger::message_handler_cleared_ = false;
1425 v8::Debug::HostDispatchHandler Debugger::host_dispatch_handler_ = NULL; 1425 v8::Debug::HostDispatchHandler Debugger::host_dispatch_handler_ = NULL;
1426 int Debugger::host_dispatch_micros_ = 100 * 1000; 1426 int Debugger::host_dispatch_micros_ = 100 * 1000;
1427 DebuggerAgent* Debugger::agent_ = NULL; 1427 DebuggerAgent* Debugger::agent_ = NULL;
1428 LockingCommandMessageQueue Debugger::command_queue_(kQueueInitialSize); 1428 LockingCommandMessageQueue Debugger::command_queue_(kQueueInitialSize);
1429 Semaphore* Debugger::command_received_ = OS::CreateSemaphore(0); 1429 Semaphore* Debugger::command_received_ = OS::CreateSemaphore(0);
1430 1430
1431 1431
1432 Handle<Object> Debugger::MakeJSObject(Vector<const char> constructor_name, 1432 Handle<Object> Debugger::MakeJSObject(Vector<const char> constructor_name,
1433 int argc, Object*** argv, 1433 int argc, Object*** argv,
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
1956 event_listener_data_ = Handle<Object>::cast(GlobalHandles::Create(*data)); 1956 event_listener_data_ = Handle<Object>::cast(GlobalHandles::Create(*data));
1957 } 1957 }
1958 1958
1959 // Unload the debugger if event listener cleared. 1959 // Unload the debugger if event listener cleared.
1960 if (callback->IsUndefined()) { 1960 if (callback->IsUndefined()) {
1961 UnloadDebugger(); 1961 UnloadDebugger();
1962 } 1962 }
1963 } 1963 }
1964 1964
1965 1965
1966 void Debugger::SetMessageHandler(v8::Debug::MessageHandler handler) { 1966 void Debugger::SetMessageHandler(v8::Debug::MessageHandler2 handler) {
1967 ScopedLock with(debugger_access_); 1967 ScopedLock with(debugger_access_);
1968 1968
1969 message_handler_ = handler; 1969 message_handler_ = handler;
1970 if (handler == NULL) { 1970 if (handler == NULL) {
1971 // Indicate that the message handler was recently cleared. 1971 // Indicate that the message handler was recently cleared.
1972 message_handler_cleared_ = true; 1972 message_handler_cleared_ = true;
1973 1973
1974 // Send an empty command to the debugger if in a break to make JavaScript 1974 // Send an empty command to the debugger if in a break to make JavaScript
1975 // run again if the debugger is closed. 1975 // run again if the debugger is closed.
1976 if (Debug::InDebugger()) { 1976 if (Debug::InDebugger()) {
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
2289 2289
2290 2290
2291 void LockingCommandMessageQueue::Clear() { 2291 void LockingCommandMessageQueue::Clear() {
2292 ScopedLock sl(lock_); 2292 ScopedLock sl(lock_);
2293 queue_.Clear(); 2293 queue_.Clear();
2294 } 2294 }
2295 2295
2296 #endif // ENABLE_DEBUGGER_SUPPORT 2296 #endif // ENABLE_DEBUGGER_SUPPORT
2297 2297
2298 } } // namespace v8::internal 2298 } } // namespace v8::internal
OLDNEW
« include/v8-debug.h ('K') | « src/debug.h ('k') | src/debug-agent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698