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

Side by Side Diff: Source/web/InspectorOverlayImpl.cpp

Issue 1100223003: bindings: Add empty checks for toV8() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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
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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 374
375 const WebData& overlayPageHTMLResource = Platform::current()->loadResource(" InspectorOverlayPage.html"); 375 const WebData& overlayPageHTMLResource = Platform::current()->loadResource(" InspectorOverlayPage.html");
376 RefPtr<SharedBuffer> data = SharedBuffer::create(overlayPageHTMLResource.dat a(), overlayPageHTMLResource.size()); 376 RefPtr<SharedBuffer> data = SharedBuffer::create(overlayPageHTMLResource.dat a(), overlayPageHTMLResource.size());
377 loader.load(FrameLoadRequest(0, blankURL(), SubstituteData(data, "text/html" , "UTF-8", KURL(), ForceSynchronousLoad))); 377 loader.load(FrameLoadRequest(0, blankURL(), SubstituteData(data, "text/html" , "UTF-8", KURL(), ForceSynchronousLoad)));
378 v8::Isolate* isolate = toIsolate(frame.get()); 378 v8::Isolate* isolate = toIsolate(frame.get());
379 ScriptState* scriptState = ScriptState::forMainWorld(frame.get()); 379 ScriptState* scriptState = ScriptState::forMainWorld(frame.get());
380 ASSERT(scriptState->contextIsValid()); 380 ASSERT(scriptState->contextIsValid());
381 ScriptState::Scope scope(scriptState); 381 ScriptState::Scope scope(scriptState);
382 v8::Local<v8::Object> global = scriptState->context()->Global(); 382 v8::Local<v8::Object> global = scriptState->context()->Global();
383 v8::Local<v8::Value> overlayHostObj = toV8(m_overlayHost.get(), global, isol ate); 383 v8::Local<v8::Value> overlayHostObj = toV8(m_overlayHost.get(), global, isol ate);
384 ASSERT(!overlayHostObj.IsEmpty());
384 global->Set(v8AtomicString(isolate, "InspectorOverlayHost"), overlayHostObj) ; 385 global->Set(v8AtomicString(isolate, "InspectorOverlayHost"), overlayHostObj) ;
385 386
386 #if OS(WIN) 387 #if OS(WIN)
387 evaluateInOverlay("setPlatform", "windows"); 388 evaluateInOverlay("setPlatform", "windows");
388 #elif OS(MACOSX) 389 #elif OS(MACOSX)
389 evaluateInOverlay("setPlatform", "mac"); 390 evaluateInOverlay("setPlatform", "mac");
390 #elif OS(POSIX) 391 #elif OS(POSIX)
391 evaluateInOverlay("setPlatform", "linux"); 392 evaluateInOverlay("setPlatform", "linux");
392 #endif 393 #endif
393 394
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 if (!m_suspendCount++) 466 if (!m_suspendCount++)
466 clear(); 467 clear();
467 } 468 }
468 469
469 void InspectorOverlayImpl::resumeUpdates() 470 void InspectorOverlayImpl::resumeUpdates()
470 { 471 {
471 --m_suspendCount; 472 --m_suspendCount;
472 } 473 }
473 474
474 } // namespace blink 475 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698