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

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

Issue 306853002: Replace Context::Scope with ScriptState::Scope (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 704 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 RefPtr<LocalFrame> frame = LocalFrame::create(dummyFrameLoaderClient, &m_ove rlayPage->frameHost(), 0); 715 RefPtr<LocalFrame> frame = LocalFrame::create(dummyFrameLoaderClient, &m_ove rlayPage->frameHost(), 0);
716 frame->setView(FrameView::create(frame.get())); 716 frame->setView(FrameView::create(frame.get()));
717 frame->init(); 717 frame->init();
718 FrameLoader& loader = frame->loader(); 718 FrameLoader& loader = frame->loader();
719 frame->view()->setCanHaveScrollbars(false); 719 frame->view()->setCanHaveScrollbars(false);
720 frame->view()->setTransparent(true); 720 frame->view()->setTransparent(true);
721 721
722 RefPtr<SharedBuffer> data = SharedBuffer::create(reinterpret_cast<const char *>(InspectorOverlayPage_html), sizeof(InspectorOverlayPage_html)); 722 RefPtr<SharedBuffer> data = SharedBuffer::create(reinterpret_cast<const char *>(InspectorOverlayPage_html), sizeof(InspectorOverlayPage_html));
723 loader.load(FrameLoadRequest(0, blankURL(), SubstituteData(data, "text/html" , "UTF-8", KURL(), ForceSynchronousLoad))); 723 loader.load(FrameLoadRequest(0, blankURL(), SubstituteData(data, "text/html" , "UTF-8", KURL(), ForceSynchronousLoad)));
724 v8::Isolate* isolate = toIsolate(frame.get()); 724 v8::Isolate* isolate = toIsolate(frame.get());
725 v8::HandleScope handleScope(isolate); 725 ScriptState* scriptState = ScriptState::forMainWorld(frame.get());
726 v8::Handle<v8::Context> frameContext = toV8Context(isolate, frame.get(), DOM WrapperWorld::mainWorld()); 726 ASSERT(!scriptState->contextIsEmpty());
727 ASSERT(!frameContext.IsEmpty()); 727 ScriptState::Scope scope(scriptState);
728 v8::Context::Scope contextScope(frameContext); 728 v8::Handle<v8::Object> global = scriptState->context()->Global();
729 v8::Handle<v8::Value> overlayHostObj = toV8(m_overlayHost.get(), v8::Handle< v8::Object>(), isolate); 729 v8::Handle<v8::Value> overlayHostObj = toV8(m_overlayHost.get(), global, iso late);
730 v8::Handle<v8::Object> global = frameContext->Global();
731 global->Set(v8::String::NewFromUtf8(isolate, "InspectorOverlayHost"), overla yHostObj); 730 global->Set(v8::String::NewFromUtf8(isolate, "InspectorOverlayHost"), overla yHostObj);
732 731
733 #if OS(WIN) 732 #if OS(WIN)
734 evaluateInOverlay("setPlatform", "windows"); 733 evaluateInOverlay("setPlatform", "windows");
735 #elif OS(MACOSX) 734 #elif OS(MACOSX)
736 evaluateInOverlay("setPlatform", "mac"); 735 evaluateInOverlay("setPlatform", "mac");
737 #elif OS(POSIX) 736 #elif OS(POSIX)
738 evaluateInOverlay("setPlatform", "linux"); 737 evaluateInOverlay("setPlatform", "linux");
739 #endif 738 #endif
740 739
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 hideHighlight(); 796 hideHighlight();
798 } 797 }
799 798
800 void InspectorOverlay::startedRecordingProfile() 799 void InspectorOverlay::startedRecordingProfile()
801 { 800 {
802 if (!m_activeProfilerCount++) 801 if (!m_activeProfilerCount++)
803 freePage(); 802 freePage();
804 } 803 }
805 804
806 } // namespace WebCore 805 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698