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

Side by Side Diff: third_party/WebKit/WebCore/inspector/InspectorController.cpp

Issue 16411: Fixed console messages for messages which was not added through the console.x... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 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 | « DEPS ('k') | 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) 2007 Google Inc. All rights reserved. 2 * Copyright (C) 2007 Google Inc. All rights reserved.
3 * Authors: Collin Jackson, Adam Barth 3 * Authors: Collin Jackson, Adam Barth
4 * 4 *
5 * This is the V8 version of the KJS InspectorController, which is located in 5 * This is the V8 version of the KJS InspectorController, which is located in
6 * webkit/pending. 6 * webkit/pending.
7 * Copyright (C) 2007 Apple Inc. All rights reserved. 7 * Copyright (C) 2007 Apple Inc. All rights reserved.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
(...skipping 1340 matching lines...) Expand 10 before | Expand all | Expand 10 after
1351 v8::Handle<v8::Value> addMessageToConsole = 1351 v8::Handle<v8::Value> addMessageToConsole =
1352 m_scriptObject->Get(v8::String::New("addMessageToConsole")); 1352 m_scriptObject->Get(v8::String::New("addMessageToConsole"));
1353 ASSERT(!addMessageToConsole.IsEmpty() && addMessageToConsole->IsFunction()); 1353 ASSERT(!addMessageToConsole.IsEmpty() && addMessageToConsole->IsFunction());
1354 1354
1355 if (addMessageToConsole.IsEmpty() || !addMessageToConsole->IsFunction()) 1355 if (addMessageToConsole.IsEmpty() || !addMessageToConsole->IsFunction())
1356 return; 1356 return;
1357 1357
1358 // Create an instance of WebInspector.ConsoleMessage passing the variable 1358 // Create an instance of WebInspector.ConsoleMessage passing the variable
1359 // number of arguments available. 1359 // number of arguments available.
1360 static unsigned kArgcFixed = 6; 1360 static unsigned kArgcFixed = 6;
1361 unsigned argc = kArgcFixed + message->arguments.size(); 1361 unsigned argc = kArgcFixed;
1362 if (!message->arguments.isEmpty()) {
1363 argc += message->arguments.size();
1364 } else {
1365 argc += 1;
1366 }
1362 v8::Handle<v8::Value> *args = new v8::Handle<v8::Value>[argc]; 1367 v8::Handle<v8::Value> *args = new v8::Handle<v8::Value>[argc];
1363 if (args == 0) 1368 if (args == 0)
1364 return; 1369 return;
1365 unsigned i = 0; 1370 unsigned i = 0;
1366 args[i++] = v8::Number::New(message->source); 1371 args[i++] = v8::Number::New(message->source);
1367 args[i++] = v8::Number::New(message->level); 1372 args[i++] = v8::Number::New(message->level);
1368 args[i++] = v8::Number::New(message->line); 1373 args[i++] = v8::Number::New(message->line);
1369 args[i++] = v8StringOrNull(message->url); 1374 args[i++] = v8StringOrNull(message->url);
1370 args[i++] = v8::Number::New(message->groupLevel); 1375 args[i++] = v8::Number::New(message->groupLevel);
1371 args[i++] = v8::Number::New(message->repeatCount); 1376 args[i++] = v8::Number::New(message->repeatCount);
1372 ASSERT(kArgcFixed == i); 1377 ASSERT(kArgcFixed == i);
1373 for (unsigned i = 0; i < message->arguments.size(); ++i) { 1378 if (!message->arguments.isEmpty()) {
1374 args[kArgcFixed + i] = message->arguments[i].v8Value(); 1379 for (unsigned i = 0; i < message->arguments.size(); ++i) {
1380 args[kArgcFixed + i] = message->arguments[i].v8Value();
1381 }
1382 } else {
1383 args[i++] = v8StringOrNull(message->message);
1375 } 1384 }
1376 1385
1377 v8::Handle<v8::Object> consoleMessage = 1386 v8::Handle<v8::Object> consoleMessage =
1378 SafeAllocation::NewInstance(consoleMessageConstructor, argc, args); 1387 SafeAllocation::NewInstance(consoleMessageConstructor, argc, args);
1379 delete[] args; 1388 delete[] args;
1380 if (consoleMessage.IsEmpty()) 1389 if (consoleMessage.IsEmpty())
1381 return; 1390 return;
1382 1391
1383 v8::Handle<v8::Value> args2[] = { consoleMessage }; 1392 v8::Handle<v8::Value> args2[] = { consoleMessage };
1384 (v8::Function::Cast(*addMessageToConsole))->Call(m_scriptObject, 1, args2); 1393 (v8::Function::Cast(*addMessageToConsole))->Call(m_scriptObject, 1, args2);
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
1827 } 1836 }
1828 1837
1829 bool InspectorController::stopTiming(const String& title, double& elapsed) 1838 bool InspectorController::stopTiming(const String& title, double& elapsed)
1830 { 1839 {
1831 elapsed = 0; 1840 elapsed = 0;
1832 notImplemented(); 1841 notImplemented();
1833 return false; 1842 return false;
1834 } 1843 }
1835 1844
1836 } // namespace WebCore 1845 } // namespace WebCore
OLDNEW
« no previous file with comments | « DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698