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

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

Issue 2200303003: Remove v8CallOrCrash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: temp Created 4 years, 4 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
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 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 const WebData& overlayPageHTMLResource = Platform::current()->loadResource(" InspectorOverlayPage.html"); 506 const WebData& overlayPageHTMLResource = Platform::current()->loadResource(" InspectorOverlayPage.html");
507 RefPtr<SharedBuffer> data = SharedBuffer::create(overlayPageHTMLResource.dat a(), overlayPageHTMLResource.size()); 507 RefPtr<SharedBuffer> data = SharedBuffer::create(overlayPageHTMLResource.dat a(), overlayPageHTMLResource.size());
508 loader.load(FrameLoadRequest(0, blankURL(), SubstituteData(data, "text/html" , "UTF-8", KURL(), ForceSynchronousLoad))); 508 loader.load(FrameLoadRequest(0, blankURL(), SubstituteData(data, "text/html" , "UTF-8", KURL(), ForceSynchronousLoad)));
509 v8::Isolate* isolate = toIsolate(frame); 509 v8::Isolate* isolate = toIsolate(frame);
510 ScriptState* scriptState = ScriptState::forMainWorld(frame); 510 ScriptState* scriptState = ScriptState::forMainWorld(frame);
511 DCHECK(scriptState); 511 DCHECK(scriptState);
512 ScriptState::Scope scope(scriptState); 512 ScriptState::Scope scope(scriptState);
513 v8::Local<v8::Object> global = scriptState->context()->Global(); 513 v8::Local<v8::Object> global = scriptState->context()->Global();
514 v8::Local<v8::Value> overlayHostObj = toV8(m_overlayHost.get(), global, isol ate); 514 v8::Local<v8::Value> overlayHostObj = toV8(m_overlayHost.get(), global, isol ate);
515 DCHECK(!overlayHostObj.IsEmpty()); 515 DCHECK(!overlayHostObj.IsEmpty());
516 v8CallOrCrash(global->Set(scriptState->context(), v8AtomicString(isolate, "I nspectorOverlayHost"), overlayHostObj)); 516 global->Set(scriptState->context(), v8AtomicString(isolate, "InspectorOverla yHost"), overlayHostObj).ToChecked();
517 517
518 #if OS(WIN) 518 #if OS(WIN)
519 evaluateInOverlay("setPlatform", "windows"); 519 evaluateInOverlay("setPlatform", "windows");
520 #elif OS(MACOSX) 520 #elif OS(MACOSX)
521 evaluateInOverlay("setPlatform", "mac"); 521 evaluateInOverlay("setPlatform", "mac");
522 #elif OS(POSIX) 522 #elif OS(POSIX)
523 evaluateInOverlay("setPlatform", "linux"); 523 evaluateInOverlay("setPlatform", "linux");
524 #endif 524 #endif
525 525
526 return m_overlayPage.get(); 526 return m_overlayPage.get();
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 790
791 void InspectorOverlay::initializeLayoutEditorIfNeeded(Node* node) 791 void InspectorOverlay::initializeLayoutEditorIfNeeded(Node* node)
792 { 792 {
793 if (m_inspectMode != InspectorDOMAgent::ShowLayoutEditor || !node || !node-> isElementNode() || !node->ownerDocument()->isActive() || !m_cssAgent || !m_domAg ent) 793 if (m_inspectMode != InspectorDOMAgent::ShowLayoutEditor || !node || !node-> isElementNode() || !node->ownerDocument()->isActive() || !m_cssAgent || !m_domAg ent)
794 return; 794 return;
795 m_layoutEditor = LayoutEditor::create(toElement(node), m_cssAgent, m_domAgen t, &overlayMainFrame()->script()); 795 m_layoutEditor = LayoutEditor::create(toElement(node), m_cssAgent, m_domAgen t, &overlayMainFrame()->script());
796 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursorOverridde n(true); 796 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursorOverridde n(true);
797 } 797 }
798 798
799 } // namespace blink 799 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698