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

Side by Side Diff: third_party/WebKit/Source/web/InspectorOverlay.cpp

Issue 2787573002: InspectorOverlay: Don't copy from SharedBuffer to SharedBuffer. (Closed)
Patch Set: . Created 3 years, 8 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
« no previous file with comments | « no previous file | no next file » | 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 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 LocalFrame* frame = 547 LocalFrame* frame =
548 LocalFrame::create(&dummyLocalFrameClient, *m_overlayPage, 0); 548 LocalFrame::create(&dummyLocalFrameClient, *m_overlayPage, 0);
549 frame->setView(FrameView::create(*frame)); 549 frame->setView(FrameView::create(*frame));
550 frame->init(); 550 frame->init();
551 FrameLoader& loader = frame->loader(); 551 FrameLoader& loader = frame->loader();
552 frame->view()->setCanHaveScrollbars(false); 552 frame->view()->setCanHaveScrollbars(false);
553 frame->view()->setTransparent(true); 553 frame->view()->setTransparent(true);
554 554
555 const WebData& overlayPageHTMLResource = 555 const WebData& overlayPageHTMLResource =
556 Platform::current()->loadResource("InspectorOverlayPage.html"); 556 Platform::current()->loadResource("InspectorOverlayPage.html");
557 RefPtr<SharedBuffer> data = SharedBuffer::create( 557 loader.load(
558 overlayPageHTMLResource.data(), overlayPageHTMLResource.size()); 558 FrameLoadRequest(0, blankURL(),
559 loader.load(FrameLoadRequest( 559 SubstituteData(overlayPageHTMLResource, "text/html",
560 0, blankURL(), SubstituteData(data, "text/html", "UTF-8", KURL(), 560 "UTF-8", KURL(), ForceSynchronousLoad)));
561 ForceSynchronousLoad)));
562 v8::Isolate* isolate = toIsolate(frame); 561 v8::Isolate* isolate = toIsolate(frame);
563 ScriptState* scriptState = ScriptState::forMainWorld(frame); 562 ScriptState* scriptState = ScriptState::forMainWorld(frame);
564 DCHECK(scriptState); 563 DCHECK(scriptState);
565 ScriptState::Scope scope(scriptState); 564 ScriptState::Scope scope(scriptState);
566 v8::Local<v8::Object> global = scriptState->context()->Global(); 565 v8::Local<v8::Object> global = scriptState->context()->Global();
567 v8::Local<v8::Value> overlayHostObj = 566 v8::Local<v8::Value> overlayHostObj =
568 ToV8(m_overlayHost.get(), global, isolate); 567 ToV8(m_overlayHost.get(), global, isolate);
569 DCHECK(!overlayHostObj.IsEmpty()); 568 DCHECK(!overlayHostObj.IsEmpty());
570 global 569 global
571 ->Set(scriptState->context(), 570 ->Set(scriptState->context(),
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 bool InspectorOverlay::shouldSearchForNode() { 801 bool InspectorOverlay::shouldSearchForNode() {
803 return m_inspectMode != InspectorDOMAgent::NotSearching; 802 return m_inspectMode != InspectorDOMAgent::NotSearching;
804 } 803 }
805 804
806 void InspectorOverlay::inspect(Node* node) { 805 void InspectorOverlay::inspect(Node* node) {
807 if (m_domAgent) 806 if (m_domAgent)
808 m_domAgent->inspect(node); 807 m_domAgent->inspect(node);
809 } 808 }
810 809
811 } // namespace blink 810 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698