| 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 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 706 RefPtr<LocalFrame> frame = LocalFrame::create(dummyFrameLoaderClient, &m_ove
rlayPage->frameHost(), 0); | 706 RefPtr<LocalFrame> frame = LocalFrame::create(dummyFrameLoaderClient, &m_ove
rlayPage->frameHost(), 0); |
| 707 frame->setView(FrameView::create(frame.get())); | 707 frame->setView(FrameView::create(frame.get())); |
| 708 frame->init(); | 708 frame->init(); |
| 709 FrameLoader& loader = frame->loader(); | 709 FrameLoader& loader = frame->loader(); |
| 710 frame->view()->setCanHaveScrollbars(false); | 710 frame->view()->setCanHaveScrollbars(false); |
| 711 frame->view()->setTransparent(true); | 711 frame->view()->setTransparent(true); |
| 712 | 712 |
| 713 RefPtr<SharedBuffer> data = SharedBuffer::create(reinterpret_cast<const char
*>(InspectorOverlayPage_html), sizeof(InspectorOverlayPage_html)); | 713 RefPtr<SharedBuffer> data = SharedBuffer::create(reinterpret_cast<const char
*>(InspectorOverlayPage_html), sizeof(InspectorOverlayPage_html)); |
| 714 loader.load(FrameLoadRequest(0, blankURL(), SubstituteData(data, "text/html"
, "UTF-8", KURL(), ForceSynchronousLoad))); | 714 loader.load(FrameLoadRequest(0, blankURL(), SubstituteData(data, "text/html"
, "UTF-8", KURL(), ForceSynchronousLoad))); |
| 715 v8::Isolate* isolate = toIsolate(frame.get()); | 715 v8::Isolate* isolate = toIsolate(frame.get()); |
| 716 v8::HandleScope handleScope(isolate); | 716 ScriptState* scriptState = ScriptState::forMainWorld(frame.get()); |
| 717 v8::Handle<v8::Context> frameContext = toV8Context(frame.get(), DOMWrapperWo
rld::mainWorld()); | 717 ASSERT(!scriptState->contextIsEmpty()); |
| 718 ASSERT(!frameContext.IsEmpty()); | 718 ScriptState::Scope scope(scriptState); |
| 719 v8::Context::Scope contextScope(frameContext); | 719 v8::Handle<v8::Object> global = scriptState->context()->Global(); |
| 720 v8::Handle<v8::Object> global = frameContext->Global(); | |
| 721 v8::Handle<v8::Value> overlayHostObj = toV8(m_overlayHost.get(), global, iso
late); | 720 v8::Handle<v8::Value> overlayHostObj = toV8(m_overlayHost.get(), global, iso
late); |
| 722 global->Set(v8::String::NewFromUtf8(isolate, "InspectorOverlayHost"), overla
yHostObj); | 721 global->Set(v8::String::NewFromUtf8(isolate, "InspectorOverlayHost"), overla
yHostObj); |
| 723 | 722 |
| 724 #if OS(WIN) | 723 #if OS(WIN) |
| 725 evaluateInOverlay("setPlatform", "windows"); | 724 evaluateInOverlay("setPlatform", "windows"); |
| 726 #elif OS(MACOSX) | 725 #elif OS(MACOSX) |
| 727 evaluateInOverlay("setPlatform", "mac"); | 726 evaluateInOverlay("setPlatform", "mac"); |
| 728 #elif OS(POSIX) | 727 #elif OS(POSIX) |
| 729 evaluateInOverlay("setPlatform", "linux"); | 728 evaluateInOverlay("setPlatform", "linux"); |
| 730 #endif | 729 #endif |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 hideHighlight(); | 786 hideHighlight(); |
| 788 } | 787 } |
| 789 | 788 |
| 790 void InspectorOverlay::startedRecordingProfile() | 789 void InspectorOverlay::startedRecordingProfile() |
| 791 { | 790 { |
| 792 if (!m_activeProfilerCount++) | 791 if (!m_activeProfilerCount++) |
| 793 freePage(); | 792 freePage(); |
| 794 } | 793 } |
| 795 | 794 |
| 796 } // namespace WebCore | 795 } // namespace WebCore |
| OLD | NEW |