| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "Document.h" | 9 #include "Document.h" |
| 10 #include "EventListener.h" | 10 #include "EventListener.h" |
| 11 #include "InspectorBackend.h" | 11 #include "InspectorBackend.h" |
| 12 #include "InspectorController.h" | 12 #include "InspectorController.h" |
| 13 #include "InspectorFrontend.h" | 13 #include "InspectorFrontend.h" |
| 14 #include "InspectorResource.h" | 14 #include "InspectorResource.h" |
| 15 #include "Node.h" | 15 #include "Node.h" |
| 16 #include "Page.h" | 16 #include "Page.h" |
| 17 #include "PlatformString.h" | 17 #include "PlatformString.h" |
| 18 #include "ResourceError.h" |
| 19 #include "ResourceRequest.h" |
| 20 #include "ResourceResponse.h" |
| 18 #include "ScriptObject.h" | 21 #include "ScriptObject.h" |
| 19 #include "ScriptState.h" | 22 #include "ScriptState.h" |
| 20 #include "ScriptValue.h" | 23 #include "ScriptValue.h" |
| 21 #include "V8Binding.h" | 24 #include "V8Binding.h" |
| 22 #include "V8Proxy.h" | 25 #include "V8Proxy.h" |
| 23 #include "V8Utilities.h" | 26 #include "V8Utilities.h" |
| 24 #include <wtf/OwnPtr.h> | 27 #include <wtf/OwnPtr.h> |
| 25 #undef LOG | 28 #undef LOG |
| 26 | 29 |
| 27 #include "third_party/WebKit/WebKit/chromium/public/WebDataSource.h" | 30 #include "third_party/WebKit/WebKit/chromium/public/WebDataSource.h" |
| 28 #include "third_party/WebKit/WebKit/chromium/public/WebDevToolsAgentClient.h" | 31 #include "third_party/WebKit/WebKit/chromium/public/WebDevToolsAgentClient.h" |
| 29 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" | 32 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" |
| 30 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" | 33 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" |
| 31 #include "third_party/WebKit/WebKit/chromium/public/WebURL.h" | 34 #include "third_party/WebKit/WebKit/chromium/public/WebURL.h" |
| 35 #include "third_party/WebKit/WebKit/chromium/public/WebURLError.h" |
| 32 #include "third_party/WebKit/WebKit/chromium/public/WebURLRequest.h" | 36 #include "third_party/WebKit/WebKit/chromium/public/WebURLRequest.h" |
| 37 #include "third_party/WebKit/WebKit/chromium/public/WebURLResponse.h" |
| 33 #include "third_party/WebKit/WebKit/chromium/src/WebFrameImpl.h" | 38 #include "third_party/WebKit/WebKit/chromium/src/WebFrameImpl.h" |
| 34 #include "third_party/WebKit/WebKit/chromium/src/WebViewImpl.h" | 39 #include "third_party/WebKit/WebKit/chromium/src/WebViewImpl.h" |
| 35 #include "webkit/glue/devtools/bound_object.h" | 40 #include "webkit/glue/devtools/bound_object.h" |
| 36 #include "webkit/glue/devtools/debugger_agent_impl.h" | 41 #include "webkit/glue/devtools/debugger_agent_impl.h" |
| 37 #include "webkit/glue/devtools/debugger_agent_manager.h" | 42 #include "webkit/glue/devtools/debugger_agent_manager.h" |
| 38 #include "webkit/glue/glue_util.h" | 43 #include "webkit/glue/glue_util.h" |
| 39 #include "webkit/glue/webdevtoolsagent_impl.h" | 44 #include "webkit/glue/webdevtoolsagent_impl.h" |
| 40 | 45 |
| 41 using WebCore::Document; | 46 using WebCore::Document; |
| 47 using WebCore::DocumentLoader; |
| 48 using WebCore::FrameLoader; |
| 42 using WebCore::InspectorBackend; | 49 using WebCore::InspectorBackend; |
| 43 using WebCore::InspectorController; | 50 using WebCore::InspectorController; |
| 44 using WebCore::InspectorFrontend; | 51 using WebCore::InspectorFrontend; |
| 45 using WebCore::InspectorResource; | 52 using WebCore::InspectorResource; |
| 46 using WebCore::Node; | 53 using WebCore::Node; |
| 47 using WebCore::Page; | 54 using WebCore::Page; |
| 55 using WebCore::ResourceError; |
| 56 using WebCore::ResourceRequest; |
| 57 using WebCore::ResourceResponse; |
| 48 using WebCore::SafeAllocation; | 58 using WebCore::SafeAllocation; |
| 49 using WebCore::ScriptObject; | 59 using WebCore::ScriptObject; |
| 50 using WebCore::ScriptState; | 60 using WebCore::ScriptState; |
| 51 using WebCore::ScriptValue; | 61 using WebCore::ScriptValue; |
| 52 using WebCore::String; | 62 using WebCore::String; |
| 53 using WebCore::V8ClassIndex; | 63 using WebCore::V8ClassIndex; |
| 54 using WebCore::V8DOMWrapper; | 64 using WebCore::V8DOMWrapper; |
| 55 using WebCore::V8Proxy; | 65 using WebCore::V8Proxy; |
| 56 using WebKit::WebDataSource; | 66 using WebKit::WebDataSource; |
| 57 using WebKit::WebDevToolsAgentClient; | 67 using WebKit::WebDevToolsAgentClient; |
| 58 using WebKit::WebFrame; | 68 using WebKit::WebFrame; |
| 59 using WebKit::WebFrameImpl; | 69 using WebKit::WebFrameImpl; |
| 60 using WebKit::WebPoint; | 70 using WebKit::WebPoint; |
| 61 using WebKit::WebString; | 71 using WebKit::WebString; |
| 62 using WebKit::WebURL; | 72 using WebKit::WebURL; |
| 73 using WebKit::WebURLError; |
| 63 using WebKit::WebURLRequest; | 74 using WebKit::WebURLRequest; |
| 75 using WebKit::WebURLResponse; |
| 64 using WebKit::WebViewImpl; | 76 using WebKit::WebViewImpl; |
| 65 | 77 |
| 66 namespace { | 78 namespace { |
| 67 | 79 |
| 68 void InspectorBackendWeakReferenceCallback(v8::Persistent<v8::Value> object, | 80 void InspectorBackendWeakReferenceCallback(v8::Persistent<v8::Value> object, |
| 69 void* parameter) { | 81 void* parameter) { |
| 70 InspectorBackend* backend = static_cast<InspectorBackend*>(parameter); | 82 InspectorBackend* backend = static_cast<InspectorBackend*>(parameter); |
| 71 backend->deref(); | 83 backend->deref(); |
| 72 object.Dispose(); | 84 object.Dispose(); |
| 73 } | 85 } |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 return v8::Undefined(); | 464 return v8::Undefined(); |
| 453 } | 465 } |
| 454 WebDevToolsAgentImpl* agent = static_cast<WebDevToolsAgentImpl*>( | 466 WebDevToolsAgentImpl* agent = static_cast<WebDevToolsAgentImpl*>( |
| 455 v8::External::Cast(*args.Data())->Value()); | 467 v8::External::Cast(*args.Data())->Value()); |
| 456 agent->client_->runtimeFeatureStateChanged( | 468 agent->client_->runtimeFeatureStateChanged( |
| 457 webkit_glue::StringToWebString(feature), | 469 webkit_glue::StringToWebString(feature), |
| 458 enabled); | 470 enabled); |
| 459 return v8::Undefined(); | 471 return v8::Undefined(); |
| 460 } | 472 } |
| 461 | 473 |
| 474 |
| 475 WebCore::InspectorController* WebDevToolsAgentImpl::GetInspectorController() { |
| 476 if (Page* page = web_view_impl_->page()) |
| 477 return page->inspectorController(); |
| 478 return NULL; |
| 479 } |
| 480 |
| 481 |
| 482 //------- plugin resource load notifications --------------- |
| 483 void WebDevToolsAgentImpl::identifierForInitialRequest( |
| 484 unsigned long resourceId, |
| 485 WebKit::WebFrame* frame, |
| 486 const WebURLRequest& request) { |
| 487 } |
| 488 |
| 489 void WebDevToolsAgentImpl::willSendRequest( |
| 490 unsigned long resourceId, |
| 491 const WebURLRequest& request) { |
| 492 } |
| 493 |
| 494 void WebDevToolsAgentImpl::didReceiveData(unsigned long resourceId, |
| 495 int length) { |
| 496 } |
| 497 |
| 498 void WebDevToolsAgentImpl::didReceiveResponse( |
| 499 unsigned long resourceId, |
| 500 const WebURLResponse& response) { |
| 501 } |
| 502 |
| 503 void WebDevToolsAgentImpl::didFinishLoading( |
| 504 unsigned long resourceId) { |
| 505 } |
| 506 |
| 507 void WebDevToolsAgentImpl::didFailLoading(unsigned long resourceId, |
| 508 const WebURLError& error) { |
| 509 } |
| 510 |
| 511 |
| 462 namespace WebKit { | 512 namespace WebKit { |
| 463 | 513 |
| 464 // static | 514 // static |
| 465 WebDevToolsAgent* WebDevToolsAgent::create(WebView* webview, | 515 WebDevToolsAgent* WebDevToolsAgent::create(WebView* webview, |
| 466 WebDevToolsAgentClient* client) { | 516 WebDevToolsAgentClient* client) { |
| 467 return new WebDevToolsAgentImpl(static_cast<WebViewImpl*>(webview), client); | 517 return new WebDevToolsAgentImpl(static_cast<WebViewImpl*>(webview), client); |
| 468 } | 518 } |
| 469 | 519 |
| 470 // static | 520 // static |
| 471 void WebDevToolsAgent::executeDebuggerCommand( | 521 void WebDevToolsAgent::executeDebuggerCommand( |
| 472 const WebString& command, | 522 const WebString& command, |
| 473 int caller_id) { | 523 int caller_id) { |
| 474 DebuggerAgentManager::ExecuteDebuggerCommand( | 524 DebuggerAgentManager::ExecuteDebuggerCommand( |
| 475 webkit_glue::WebStringToString(command), caller_id); | 525 webkit_glue::WebStringToString(command), caller_id); |
| 476 } | 526 } |
| 477 | 527 |
| 478 // static | 528 // static |
| 479 void WebDevToolsAgent::setMessageLoopDispatchHandler( | 529 void WebDevToolsAgent::setMessageLoopDispatchHandler( |
| 480 MessageLoopDispatchHandler handler) { | 530 MessageLoopDispatchHandler handler) { |
| 481 DebuggerAgentManager::SetMessageLoopDispatchHandler(handler); | 531 DebuggerAgentManager::SetMessageLoopDispatchHandler(handler); |
| 482 } | 532 } |
| 483 | 533 |
| 484 } // namespace WebKit | 534 } // namespace WebKit |
| OLD | NEW |