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

Side by Side Diff: Source/core/inspector/InspectorOverlay.cpp

Issue 120513004: Don't expose DocumentWriter to embedding layer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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
« no previous file with comments | « Source/core/fetch/ResourceFetcher.cpp ('k') | Source/core/loader/DocumentLoader.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 20 matching lines...) Expand all
31 31
32 #include "InspectorOverlayPage.h" 32 #include "InspectorOverlayPage.h"
33 #include "V8InspectorOverlayHost.h" 33 #include "V8InspectorOverlayHost.h"
34 #include "bindings/v8/ScriptController.h" 34 #include "bindings/v8/ScriptController.h"
35 #include "bindings/v8/ScriptSourceCode.h" 35 #include "bindings/v8/ScriptSourceCode.h"
36 #include "core/dom/Element.h" 36 #include "core/dom/Element.h"
37 #include "core/dom/Node.h" 37 #include "core/dom/Node.h"
38 #include "core/dom/PseudoElement.h" 38 #include "core/dom/PseudoElement.h"
39 #include "core/inspector/InspectorClient.h" 39 #include "core/inspector/InspectorClient.h"
40 #include "core/inspector/InspectorOverlayHost.h" 40 #include "core/inspector/InspectorOverlayHost.h"
41 #include "core/loader/DocumentLoader.h"
42 #include "core/loader/EmptyClients.h" 41 #include "core/loader/EmptyClients.h"
42 #include "core/loader/FrameLoadRequest.h"
43 #include "core/page/Chrome.h" 43 #include "core/page/Chrome.h"
44 #include "core/page/EventHandler.h" 44 #include "core/page/EventHandler.h"
45 #include "core/frame/Frame.h" 45 #include "core/frame/Frame.h"
46 #include "core/frame/FrameView.h" 46 #include "core/frame/FrameView.h"
47 #include "core/page/Page.h" 47 #include "core/page/Page.h"
48 #include "core/frame/Settings.h" 48 #include "core/frame/Settings.h"
49 #include "core/rendering/RenderBoxModelObject.h" 49 #include "core/rendering/RenderBoxModelObject.h"
50 #include "core/rendering/RenderInline.h" 50 #include "core/rendering/RenderInline.h"
51 #include "core/rendering/RenderObject.h" 51 #include "core/rendering/RenderObject.h"
52 #include "core/rendering/style/RenderStyleConstants.h" 52 #include "core/rendering/style/RenderStyleConstants.h"
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 overlaySettings.setScriptEnabled(true); 609 overlaySettings.setScriptEnabled(true);
610 overlaySettings.setPluginsEnabled(false); 610 overlaySettings.setPluginsEnabled(false);
611 overlaySettings.setLoadsImagesAutomatically(true); 611 overlaySettings.setLoadsImagesAutomatically(true);
612 612
613 RefPtr<Frame> frame = Frame::create(FrameInit::create(0, &m_overlayPage->fra meHost(), dummyFrameLoaderClient)); 613 RefPtr<Frame> frame = Frame::create(FrameInit::create(0, &m_overlayPage->fra meHost(), dummyFrameLoaderClient));
614 frame->setView(FrameView::create(frame.get())); 614 frame->setView(FrameView::create(frame.get()));
615 frame->init(); 615 frame->init();
616 FrameLoader& loader = frame->loader(); 616 FrameLoader& loader = frame->loader();
617 frame->view()->setCanHaveScrollbars(false); 617 frame->view()->setCanHaveScrollbars(false);
618 frame->view()->setTransparent(true); 618 frame->view()->setTransparent(true);
619 ASSERT(loader.documentLoader()); 619
620 DocumentWriter* writer = loader.documentLoader()->beginWriting("text/html", "UTF-8"); 620 RefPtr<SharedBuffer> data = SharedBuffer::create(reinterpret_cast<const char *>(InspectorOverlayPage_html), sizeof(InspectorOverlayPage_html));
621 writer->addData(reinterpret_cast<const char*>(InspectorOverlayPage_html), si zeof(InspectorOverlayPage_html)); 621 loader.load(FrameLoadRequest(0, blankURL(), SubstituteData(data, "text/html" , "UTF-8", KURL(), ForceSynchronousLoad)));
622 loader.documentLoader()->endWriting(writer);
623 v8::Isolate* isolate = toIsolate(frame.get()); 622 v8::Isolate* isolate = toIsolate(frame.get());
624 v8::HandleScope handleScope(isolate); 623 v8::HandleScope handleScope(isolate);
625 v8::Handle<v8::Context> frameContext = frame->script().currentWorldContext() ; 624 v8::Handle<v8::Context> frameContext = frame->script().currentWorldContext() ;
626 v8::Context::Scope contextScope(frameContext); 625 v8::Context::Scope contextScope(frameContext);
627 v8::Handle<v8::Value> overlayHostObj = toV8(m_overlayHost.get(), v8::Handle< v8::Object>(), isolate); 626 v8::Handle<v8::Value> overlayHostObj = toV8(m_overlayHost.get(), v8::Handle< v8::Object>(), isolate);
628 v8::Handle<v8::Object> global = frameContext->Global(); 627 v8::Handle<v8::Object> global = frameContext->Global();
629 global->Set(v8::String::NewFromUtf8(isolate, "InspectorOverlayHost"), overla yHostObj); 628 global->Set(v8::String::NewFromUtf8(isolate, "InspectorOverlayHost"), overla yHostObj);
630 629
631 #if OS(WIN) 630 #if OS(WIN)
632 evaluateInOverlay("setPlatform", "windows"); 631 evaluateInOverlay("setPlatform", "windows");
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 m_timer.stop(); 690 m_timer.stop();
692 } 691 }
693 692
694 void InspectorOverlay::startedRecordingProfile() 693 void InspectorOverlay::startedRecordingProfile()
695 { 694 {
696 if (!m_activeProfilerCount++) 695 if (!m_activeProfilerCount++)
697 freePage(); 696 freePage();
698 } 697 }
699 698
700 } // namespace WebCore 699 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/fetch/ResourceFetcher.cpp ('k') | Source/core/loader/DocumentLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698