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

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

Issue 31063004: Have Frame::loader() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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 /* 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 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 overlaySettings.setMinimumFontSize(settings.minimumFontSize()); 636 overlaySettings.setMinimumFontSize(settings.minimumFontSize());
637 overlaySettings.setMinimumLogicalFontSize(settings.minimumLogicalFontSize()) ; 637 overlaySettings.setMinimumLogicalFontSize(settings.minimumLogicalFontSize()) ;
638 overlaySettings.setMediaEnabled(false); 638 overlaySettings.setMediaEnabled(false);
639 overlaySettings.setScriptEnabled(true); 639 overlaySettings.setScriptEnabled(true);
640 overlaySettings.setPluginsEnabled(false); 640 overlaySettings.setPluginsEnabled(false);
641 overlaySettings.setLoadsImagesAutomatically(true); 641 overlaySettings.setLoadsImagesAutomatically(true);
642 642
643 RefPtr<Frame> frame = Frame::create(m_overlayPage.get(), 0, dummyFrameLoader Client); 643 RefPtr<Frame> frame = Frame::create(m_overlayPage.get(), 0, dummyFrameLoader Client);
644 frame->setView(FrameView::create(frame.get())); 644 frame->setView(FrameView::create(frame.get()));
645 frame->init(); 645 frame->init();
646 FrameLoader* loader = frame->loader(); 646 FrameLoader& loader = frame->loader();
647 frame->view()->setCanHaveScrollbars(false); 647 frame->view()->setCanHaveScrollbars(false);
648 frame->view()->setTransparent(true); 648 frame->view()->setTransparent(true);
649 ASSERT(loader->activeDocumentLoader()); 649 ASSERT(loader.activeDocumentLoader());
650 DocumentWriter* writer = loader->activeDocumentLoader()->beginWriting("text/ html", "UTF-8"); 650 DocumentWriter* writer = loader.activeDocumentLoader()->beginWriting("text/h tml", "UTF-8");
651 writer->addData(reinterpret_cast<const char*>(InspectorOverlayPage_html), si zeof(InspectorOverlayPage_html)); 651 writer->addData(reinterpret_cast<const char*>(InspectorOverlayPage_html), si zeof(InspectorOverlayPage_html));
652 loader->activeDocumentLoader()->endWriting(writer); 652 loader.activeDocumentLoader()->endWriting(writer);
653 v8::Isolate* isolate = toIsolate(frame.get()); 653 v8::Isolate* isolate = toIsolate(frame.get());
654 v8::HandleScope handleScope(isolate); 654 v8::HandleScope handleScope(isolate);
655 v8::Handle<v8::Context> frameContext = frame->script().currentWorldContext() ; 655 v8::Handle<v8::Context> frameContext = frame->script().currentWorldContext() ;
656 v8::Context::Scope contextScope(frameContext); 656 v8::Context::Scope contextScope(frameContext);
657 v8::Handle<v8::Value> overlayHostObj = toV8(m_overlayHost.get(), v8::Handle< v8::Object>(), isolate); 657 v8::Handle<v8::Value> overlayHostObj = toV8(m_overlayHost.get(), v8::Handle< v8::Object>(), isolate);
658 v8::Handle<v8::Object> global = frameContext->Global(); 658 v8::Handle<v8::Object> global = frameContext->Global();
659 global->Set(v8::String::New("InspectorOverlayHost"), overlayHostObj); 659 global->Set(v8::String::New("InspectorOverlayHost"), overlayHostObj);
660 660
661 #if OS(WIN) 661 #if OS(WIN)
662 evaluateInOverlay("setPlatform", "windows"); 662 evaluateInOverlay("setPlatform", "windows");
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 } 710 }
711 711
712 void InspectorOverlay::freePage() 712 void InspectorOverlay::freePage()
713 { 713 {
714 m_overlayPage.clear(); 714 m_overlayPage.clear();
715 m_overlayChromeClient.clear(); 715 m_overlayChromeClient.clear();
716 m_timer.stop(); 716 m_timer.stop();
717 } 717 }
718 718
719 } // namespace WebCore 719 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorApplicationCacheAgent.cpp ('k') | Source/core/inspector/InspectorPageAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698