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

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: Fixed a build breakage Created 7 years, 6 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 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 556
557 RefPtr<Frame> frame = Frame::create(m_overlayPage.get(), 0, dummyFrameLoader Client); 557 RefPtr<Frame> frame = Frame::create(m_overlayPage.get(), 0, dummyFrameLoader Client);
558 frame->setView(FrameView::create(frame.get())); 558 frame->setView(FrameView::create(frame.get()));
559 frame->init(); 559 frame->init();
560 FrameLoader* loader = frame->loader(); 560 FrameLoader* loader = frame->loader();
561 frame->view()->setCanHaveScrollbars(false); 561 frame->view()->setCanHaveScrollbars(false);
562 frame->view()->setTransparent(true); 562 frame->view()->setTransparent(true);
563 ASSERT(loader->activeDocumentLoader()); 563 ASSERT(loader->activeDocumentLoader());
564 DocumentWriter* writer = loader->activeDocumentLoader()->beginWriting("text/ html", "UTF-8"); 564 DocumentWriter* writer = loader->activeDocumentLoader()->beginWriting("text/ html", "UTF-8");
565 writer->addData(reinterpret_cast<const char*>(InspectorOverlayPage_html), si zeof(InspectorOverlayPage_html)); 565 writer->addData(reinterpret_cast<const char*>(InspectorOverlayPage_html), si zeof(InspectorOverlayPage_html));
566 writer->end(); 566 loader->activeDocumentLoader()->endWriting(writer);
567 v8::HandleScope handleScope; 567 v8::HandleScope handleScope;
568 v8::Handle<v8::Context> frameContext = frame->script()->currentWorldContext( ); 568 v8::Handle<v8::Context> frameContext = frame->script()->currentWorldContext( );
569 v8::Context::Scope contextScope(frameContext); 569 v8::Context::Scope contextScope(frameContext);
570 v8::Handle<v8::Value> overlayHostObj = toV8(m_overlayHost.get(), v8::Handle< v8::Object>(), frameContext->GetIsolate()); 570 v8::Handle<v8::Value> overlayHostObj = toV8(m_overlayHost.get(), v8::Handle< v8::Object>(), frameContext->GetIsolate());
571 v8::Handle<v8::Object> global = frameContext->Global(); 571 v8::Handle<v8::Object> global = frameContext->Global();
572 global->Set(v8::String::New("InspectorOverlayHost"), overlayHostObj); 572 global->Set(v8::String::New("InspectorOverlayHost"), overlayHostObj);
573 573
574 #if OS(WINDOWS) 574 #if OS(WINDOWS)
575 evaluateInOverlay("setPlatform", "windows"); 575 evaluateInOverlay("setPlatform", "windows");
576 #elif OS(DARWIN) 576 #elif OS(DARWIN)
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 633
634 void InspectorOverlay::freePage() 634 void InspectorOverlay::freePage()
635 { 635 {
636 m_overlayPage.clear(); 636 m_overlayPage.clear();
637 m_overlayChromeClient.clear(); 637 m_overlayChromeClient.clear();
638 m_timer.stop(); 638 m_timer.stop();
639 } 639 }
640 640
641 } // namespace WebCore 641 } // namespace WebCore
642 642
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698