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

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

Issue 17640007: Refactoring: Simplify DocumentWriter by reorganizing its lifetime. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Re-landing after fixing ASAN failure on set-parent-src-synchronously.xhtml. Created 7 years, 5 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/dom/RawDataDocumentParser.h ('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 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 598
599 RefPtr<Frame> frame = Frame::create(m_overlayPage.get(), 0, dummyFrameLoader Client); 599 RefPtr<Frame> frame = Frame::create(m_overlayPage.get(), 0, dummyFrameLoader Client);
600 frame->setView(FrameView::create(frame.get())); 600 frame->setView(FrameView::create(frame.get()));
601 frame->init(); 601 frame->init();
602 FrameLoader* loader = frame->loader(); 602 FrameLoader* loader = frame->loader();
603 frame->view()->setCanHaveScrollbars(false); 603 frame->view()->setCanHaveScrollbars(false);
604 frame->view()->setTransparent(true); 604 frame->view()->setTransparent(true);
605 ASSERT(loader->activeDocumentLoader()); 605 ASSERT(loader->activeDocumentLoader());
606 DocumentWriter* writer = loader->activeDocumentLoader()->beginWriting("text/ html", "UTF-8"); 606 DocumentWriter* writer = loader->activeDocumentLoader()->beginWriting("text/ html", "UTF-8");
607 writer->addData(reinterpret_cast<const char*>(InspectorOverlayPage_html), si zeof(InspectorOverlayPage_html)); 607 writer->addData(reinterpret_cast<const char*>(InspectorOverlayPage_html), si zeof(InspectorOverlayPage_html));
608 writer->end(); 608 loader->activeDocumentLoader()->endWriting(writer);
609 v8::HandleScope handleScope; 609 v8::HandleScope handleScope;
610 v8::Handle<v8::Context> frameContext = frame->script()->currentWorldContext( ); 610 v8::Handle<v8::Context> frameContext = frame->script()->currentWorldContext( );
611 v8::Context::Scope contextScope(frameContext); 611 v8::Context::Scope contextScope(frameContext);
612 v8::Handle<v8::Value> overlayHostObj = toV8(m_overlayHost.get(), v8::Handle< v8::Object>(), frameContext->GetIsolate()); 612 v8::Handle<v8::Value> overlayHostObj = toV8(m_overlayHost.get(), v8::Handle< v8::Object>(), frameContext->GetIsolate());
613 v8::Handle<v8::Object> global = frameContext->Global(); 613 v8::Handle<v8::Object> global = frameContext->Global();
614 global->Set(v8::String::New("InspectorOverlayHost"), overlayHostObj); 614 global->Set(v8::String::New("InspectorOverlayHost"), overlayHostObj);
615 615
616 #if OS(WINDOWS) 616 #if OS(WINDOWS)
617 evaluateInOverlay("setPlatform", "windows"); 617 evaluateInOverlay("setPlatform", "windows");
618 #elif OS(DARWIN) 618 #elif OS(DARWIN)
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 675
676 void InspectorOverlay::freePage() 676 void InspectorOverlay::freePage()
677 { 677 {
678 m_overlayPage.clear(); 678 m_overlayPage.clear();
679 m_overlayChromeClient.clear(); 679 m_overlayChromeClient.clear();
680 m_timer.stop(); 680 m_timer.stop();
681 } 681 }
682 682
683 } // namespace WebCore 683 } // namespace WebCore
684 684
OLDNEW
« no previous file with comments | « Source/core/dom/RawDataDocumentParser.h ('k') | Source/core/loader/DocumentLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698