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

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

Issue 1042853004: [DevTools] Event Listeners Sidebar shows window listeners (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Extracted eventListenersTreeOutline.css 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
« no previous file with comments | « Source/core/inspector/InjectedScript.h ('k') | Source/core/inspector/InjectedScriptHost.h » ('j') | 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 ScriptFunctionCall function(injectedScriptObject(), "nodeForObjectId"); 250 ScriptFunctionCall function(injectedScriptObject(), "nodeForObjectId");
251 function.appendArgument(objectId); 251 function.appendArgument(objectId);
252 252
253 bool hadException = false; 253 bool hadException = false;
254 ScriptValue resultValue = callFunctionWithEvalEnabled(function, hadException ); 254 ScriptValue resultValue = callFunctionWithEvalEnabled(function, hadException );
255 ASSERT(!hadException); 255 ASSERT(!hadException);
256 256
257 return InjectedScriptHost::scriptValueAsNode(scriptState(), resultValue); 257 return InjectedScriptHost::scriptValueAsNode(scriptState(), resultValue);
258 } 258 }
259 259
260 EventTarget* InjectedScript::eventTargetForObjectId(const String& objectId)
261 {
262 if (isEmpty() || !canAccessInspectedWindow())
263 return nullptr;
264 return InjectedScriptHost::scriptValueAsEventTarget(scriptState(), findObjec tById(objectId));
265 }
266
260 void InjectedScript::releaseObject(const String& objectId) 267 void InjectedScript::releaseObject(const String& objectId)
261 { 268 {
262 RefPtr<JSONValue> parsedObjectId = parseJSON(objectId); 269 RefPtr<JSONValue> parsedObjectId = parseJSON(objectId);
263 if (!parsedObjectId) 270 if (!parsedObjectId)
264 return; 271 return;
265 RefPtr<JSONObject> object; 272 RefPtr<JSONObject> object;
266 if (!parsedObjectId->asObject(&object)) 273 if (!parsedObjectId->asObject(&object))
267 return; 274 return;
268 int boundId = 0; 275 int boundId = 0;
269 if (!object->getNumber("id", &boundId)) 276 if (!object->getNumber("id", &boundId))
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 { 365 {
359 ASSERT(!isEmpty()); 366 ASSERT(!isEmpty());
360 ScriptFunctionCall function(injectedScriptObject(), "setCustomObjectFormatte rEnabled"); 367 ScriptFunctionCall function(injectedScriptObject(), "setCustomObjectFormatte rEnabled");
361 function.appendArgument(enabled); 368 function.appendArgument(enabled);
362 RefPtr<JSONValue> result; 369 RefPtr<JSONValue> result;
363 makeCall(function, &result); 370 makeCall(function, &result);
364 } 371 }
365 372
366 } // namespace blink 373 } // namespace blink
367 374
OLDNEW
« no previous file with comments | « Source/core/inspector/InjectedScript.h ('k') | Source/core/inspector/InjectedScriptHost.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698