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

Side by Side Diff: Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp

Issue 24989007: Model each Dart library as its own ScriptState when devtools are enabled. (Closed) Base URL: svn://svn.chromium.org/multivm/trunk/webkit
Patch Set: Created 7 years, 2 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
« no previous file with comments | « Source/bindings/v8/ScriptState.h ('k') | Source/bindings/v8/custom/V8InjectedScriptManager.cpp » ('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) 2007-2011 Google Inc. All rights reserved. 2 * Copyright (C) 2007-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 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 20 matching lines...) Expand all
31 #include "config.h" 31 #include "config.h"
32 #include "V8InjectedScriptHost.h" 32 #include "V8InjectedScriptHost.h"
33 33
34 #include "V8Database.h" 34 #include "V8Database.h"
35 #include "V8HTMLAllCollection.h" 35 #include "V8HTMLAllCollection.h"
36 #include "V8HTMLCollection.h" 36 #include "V8HTMLCollection.h"
37 #include "V8Node.h" 37 #include "V8Node.h"
38 #include "V8NodeList.h" 38 #include "V8NodeList.h"
39 #include "V8Storage.h" 39 #include "V8Storage.h"
40 #include "bindings/dart/DartHandleProxy.h" 40 #include "bindings/dart/DartHandleProxy.h"
41 #include "bindings/dart/DartInjectedScriptHost.h"
41 #include "bindings/v8/BindingSecurity.h" 42 #include "bindings/v8/BindingSecurity.h"
42 #include "bindings/v8/ScriptDebugServer.h" 43 #include "bindings/v8/ScriptDebugServer.h"
43 #include "bindings/v8/ScriptValue.h" 44 #include "bindings/v8/ScriptValue.h"
44 #include "bindings/v8/V8AbstractEventListener.h" 45 #include "bindings/v8/V8AbstractEventListener.h"
45 #include "bindings/v8/V8Binding.h" 46 #include "bindings/v8/V8Binding.h"
46 #include "bindings/v8/V8HiddenPropertyName.h" 47 #include "bindings/v8/V8HiddenPropertyName.h"
47 #include "bindings/v8/V8ScriptRunner.h" 48 #include "bindings/v8/V8ScriptRunner.h"
48 #include "bindings/v8/custom/V8Float32ArrayCustom.h" 49 #include "bindings/v8/custom/V8Float32ArrayCustom.h"
49 #include "bindings/v8/custom/V8Float64ArrayCustom.h" 50 #include "bindings/v8/custom/V8Float64ArrayCustom.h"
50 #include "bindings/v8/custom/V8Int16ArrayCustom.h" 51 #include "bindings/v8/custom/V8Int16ArrayCustom.h"
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 v8::ThrowException(v8::Exception::Error(v8::String::New("One argument ex pected."))); 348 v8::ThrowException(v8::Exception::Error(v8::String::New("One argument ex pected.")));
348 return; 349 return;
349 } 350 }
350 351
351 v8::Handle<v8::String> expression = args[0]->ToString(); 352 v8::Handle<v8::String> expression = args[0]->ToString();
352 if (expression.IsEmpty()) { 353 if (expression.IsEmpty()) {
353 v8::ThrowException(v8::Exception::Error(v8::String::New("The argument mu st be a string."))); 354 v8::ThrowException(v8::Exception::Error(v8::String::New("The argument mu st be a string.")));
354 return; 355 return;
355 } 356 }
356 357
358 // FIXME(dartbug.com/13804): refactor DartInjectedScriptHost to instead
359 // subclass InjectedScriptHost.
360 v8::Handle<v8::Value> dartResult = DartInjectedScriptHost::evaluateIfDartCon text(args.Holder(), expression);
361 if (!dartResult.IsEmpty()) {
362 v8SetReturnValue(args, dartResult);
363 return;
364 }
365
357 ASSERT(!v8::Context::GetCurrent().IsEmpty()); 366 ASSERT(!v8::Context::GetCurrent().IsEmpty());
358 v8::TryCatch tryCatch; 367 v8::TryCatch tryCatch;
359 v8::Handle<v8::Value> result = V8ScriptRunner::compileAndRunInternalScript(e xpression, args.GetIsolate()); 368 v8::Handle<v8::Value> result = V8ScriptRunner::compileAndRunInternalScript(e xpression, args.GetIsolate());
360 if (tryCatch.HasCaught()) { 369 if (tryCatch.HasCaught()) {
361 v8SetReturnValue(args, tryCatch.ReThrow()); 370 v8SetReturnValue(args, tryCatch.ReThrow());
362 return; 371 return;
363 } 372 }
364 v8SetReturnValue(args, result); 373 v8SetReturnValue(args, result);
365 } 374 }
366 375
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 int lineNumber; 452 int lineNumber;
444 int columnNumber; 453 int columnNumber;
445 if (!getFunctionLocation(args, &scriptId, &lineNumber, &columnNumber)) 454 if (!getFunctionLocation(args, &scriptId, &lineNumber, &columnNumber))
446 return; 455 return;
447 456
448 InjectedScriptHost* host = V8InjectedScriptHost::toNative(args.Holder()); 457 InjectedScriptHost* host = V8InjectedScriptHost::toNative(args.Holder());
449 host->unmonitorFunction(scriptId, lineNumber, columnNumber); 458 host->unmonitorFunction(scriptId, lineNumber, columnNumber);
450 } 459 }
451 460
452 } // namespace WebCore 461 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/ScriptState.h ('k') | Source/bindings/v8/custom/V8InjectedScriptManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698