| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google 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 14 matching lines...) Expand all Loading... |
| 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 */ | 27 */ |
| 28 | 28 |
| 29 #include "config.h" | 29 #include "config.h" |
| 30 #include "core/inspector/InspectorOverlay.h" | 30 #include "core/inspector/InspectorOverlay.h" |
| 31 | 31 |
| 32 #include "bindings/core/v8/ScriptController.h" | 32 #include "bindings/core/v8/ScriptController.h" |
| 33 #include "bindings/core/v8/ScriptSourceCode.h" | 33 #include "bindings/core/v8/ScriptSourceCode.h" |
| 34 #include "bindings/core/v8/V8InspectorOverlayHost.h" | 34 #include "bindings/core/v8/V8InspectorOverlayHost.h" |
| 35 #include "core/InspectorOverlayPage.h" | |
| 36 #include "core/dom/Element.h" | 35 #include "core/dom/Element.h" |
| 37 #include "core/dom/Node.h" | 36 #include "core/dom/Node.h" |
| 38 #include "core/dom/PseudoElement.h" | 37 #include "core/dom/PseudoElement.h" |
| 39 #include "core/frame/FrameView.h" | 38 #include "core/frame/FrameView.h" |
| 40 #include "core/frame/LocalFrame.h" | 39 #include "core/frame/LocalFrame.h" |
| 41 #include "core/frame/Settings.h" | 40 #include "core/frame/Settings.h" |
| 42 #include "core/inspector/InspectorClient.h" | 41 #include "core/inspector/InspectorClient.h" |
| 43 #include "core/inspector/InspectorOverlayHost.h" | 42 #include "core/inspector/InspectorOverlayHost.h" |
| 44 #include "core/loader/EmptyClients.h" | 43 #include "core/loader/EmptyClients.h" |
| 45 #include "core/loader/FrameLoadRequest.h" | 44 #include "core/loader/FrameLoadRequest.h" |
| 46 #include "core/page/Chrome.h" | 45 #include "core/page/Chrome.h" |
| 47 #include "core/page/EventHandler.h" | 46 #include "core/page/EventHandler.h" |
| 48 #include "core/page/Page.h" | 47 #include "core/page/Page.h" |
| 49 #include "core/rendering/RenderBox.h" | 48 #include "core/rendering/RenderBox.h" |
| 50 #include "core/rendering/RenderBoxModelObject.h" | 49 #include "core/rendering/RenderBoxModelObject.h" |
| 51 #include "core/rendering/RenderInline.h" | 50 #include "core/rendering/RenderInline.h" |
| 52 #include "core/rendering/RenderObject.h" | 51 #include "core/rendering/RenderObject.h" |
| 53 #include "core/rendering/shapes/ShapeOutsideInfo.h" | 52 #include "core/rendering/shapes/ShapeOutsideInfo.h" |
| 54 #include "core/rendering/style/RenderStyleConstants.h" | 53 #include "core/rendering/style/RenderStyleConstants.h" |
| 55 #include "platform/JSONValues.h" | 54 #include "platform/JSONValues.h" |
| 56 #include "platform/PlatformMouseEvent.h" | 55 #include "platform/PlatformMouseEvent.h" |
| 57 #include "platform/ScriptForbiddenScope.h" | 56 #include "platform/ScriptForbiddenScope.h" |
| 58 #include "platform/graphics/GraphicsContextStateSaver.h" | 57 #include "platform/graphics/GraphicsContextStateSaver.h" |
| 58 #include "public/platform/Platform.h" |
| 59 #include "public/platform/WebData.h" |
| 59 #include "wtf/text/StringBuilder.h" | 60 #include "wtf/text/StringBuilder.h" |
| 60 #include <v8.h> | 61 #include <v8.h> |
| 61 | 62 |
| 62 namespace blink { | 63 namespace blink { |
| 63 | 64 |
| 64 namespace { | 65 namespace { |
| 65 | 66 |
| 66 struct PathApplyInfo { | 67 struct PathApplyInfo { |
| 67 FrameView* rootView; | 68 FrameView* rootView; |
| 68 FrameView* view; | 69 FrameView* view; |
| (...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 710 // through some non-composited paint function. | 711 // through some non-composited paint function. |
| 711 overlaySettings.setAcceleratedCompositingEnabled(false); | 712 overlaySettings.setAcceleratedCompositingEnabled(false); |
| 712 | 713 |
| 713 RefPtr<LocalFrame> frame = LocalFrame::create(dummyFrameLoaderClient, &m_ove
rlayPage->frameHost(), 0); | 714 RefPtr<LocalFrame> frame = LocalFrame::create(dummyFrameLoaderClient, &m_ove
rlayPage->frameHost(), 0); |
| 714 frame->setView(FrameView::create(frame.get())); | 715 frame->setView(FrameView::create(frame.get())); |
| 715 frame->init(); | 716 frame->init(); |
| 716 FrameLoader& loader = frame->loader(); | 717 FrameLoader& loader = frame->loader(); |
| 717 frame->view()->setCanHaveScrollbars(false); | 718 frame->view()->setCanHaveScrollbars(false); |
| 718 frame->view()->setTransparent(true); | 719 frame->view()->setTransparent(true); |
| 719 | 720 |
| 720 RefPtr<SharedBuffer> data = SharedBuffer::create(reinterpret_cast<const char
*>(InspectorOverlayPage_html), sizeof(InspectorOverlayPage_html)); | 721 const blink::WebData& overlayPageHTMLResource = blink::Platform::current()->
loadResource("InspectorOverlayPage.html"); |
| 722 RefPtr<SharedBuffer> data = SharedBuffer::create(overlayPageHTMLResource.dat
a(), overlayPageHTMLResource.size()); |
| 721 loader.load(FrameLoadRequest(0, blankURL(), SubstituteData(data, "text/html"
, "UTF-8", KURL(), ForceSynchronousLoad))); | 723 loader.load(FrameLoadRequest(0, blankURL(), SubstituteData(data, "text/html"
, "UTF-8", KURL(), ForceSynchronousLoad))); |
| 722 v8::Isolate* isolate = toIsolate(frame.get()); | 724 v8::Isolate* isolate = toIsolate(frame.get()); |
| 723 ScriptState* scriptState = ScriptState::forMainWorld(frame.get()); | 725 ScriptState* scriptState = ScriptState::forMainWorld(frame.get()); |
| 724 ASSERT(!scriptState->contextIsEmpty()); | 726 ASSERT(!scriptState->contextIsEmpty()); |
| 725 ScriptState::Scope scope(scriptState); | 727 ScriptState::Scope scope(scriptState); |
| 726 v8::Handle<v8::Object> global = scriptState->context()->Global(); | 728 v8::Handle<v8::Object> global = scriptState->context()->Global(); |
| 727 v8::Handle<v8::Value> overlayHostObj = toV8(m_overlayHost.get(), global, iso
late); | 729 v8::Handle<v8::Value> overlayHostObj = toV8(m_overlayHost.get(), global, iso
late); |
| 728 global->Set(v8::String::NewFromUtf8(isolate, "InspectorOverlayHost"), overla
yHostObj); | 730 global->Set(v8::String::NewFromUtf8(isolate, "InspectorOverlayHost"), overla
yHostObj); |
| 729 | 731 |
| 730 #if OS(WIN) | 732 #if OS(WIN) |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 792 hideHighlight(); | 794 hideHighlight(); |
| 793 } | 795 } |
| 794 | 796 |
| 795 void InspectorOverlay::startedRecordingProfile() | 797 void InspectorOverlay::startedRecordingProfile() |
| 796 { | 798 { |
| 797 if (!m_activeProfilerCount++) | 799 if (!m_activeProfilerCount++) |
| 798 freePage(); | 800 freePage(); |
| 799 } | 801 } |
| 800 | 802 |
| 801 } // namespace blink | 803 } // namespace blink |
| OLD | NEW |