OLD | NEW |
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 #if USE(JAVASCRIPTCORE_BINDINGS) | 82 #if USE(JAVASCRIPTCORE_BINDINGS) |
83 #include "kjs_proxy.h" | 83 #include "kjs_proxy.h" |
84 #include <JavaScriptCore/APICast.h> | 84 #include <JavaScriptCore/APICast.h> |
85 #include <JavaScriptCore/JSLock.h> | 85 #include <JavaScriptCore/JSLock.h> |
86 #include <JavaScriptCore/JSRetainPtr.h> | 86 #include <JavaScriptCore/JSRetainPtr.h> |
87 #include <JavaScriptCore/JSStringRef.h> | 87 #include <JavaScriptCore/JSStringRef.h> |
88 #include <kjs/ustring.h> | 88 #include <kjs/ustring.h> |
89 #endif | 89 #endif |
90 #include <wtf/RefCounted.h> | 90 #include <wtf/RefCounted.h> |
91 | 91 |
| 92 // TODO(aa): Implement database inspection and remove this macro. |
| 93 #define ENABLE_DATABASE_INSPECTION 0 |
| 94 |
92 #if ENABLE(DATABASE) | 95 #if ENABLE(DATABASE) |
93 #include "Database.h" | 96 #include "Database.h" |
| 97 #if ENABLE_DATABASE_INSPECTION |
94 #include "JSDatabase.h" | 98 #include "JSDatabase.h" |
95 #endif | 99 #endif |
| 100 #endif |
96 | 101 |
97 #if USE(JAVASCRIPTCORE_BINDINGS) | 102 #if USE(JAVASCRIPTCORE_BINDINGS) |
98 using namespace KJS; | 103 using namespace KJS; |
99 using namespace std; | 104 using namespace std; |
100 #endif | 105 #endif |
101 | 106 |
102 namespace WebCore { | 107 namespace WebCore { |
103 | 108 |
104 // Maximum size of the console message cache. | 109 // Maximum size of the console message cache. |
105 static const int MAX_CONSOLE_MESSAGES = 250; | 110 static const int MAX_CONSOLE_MESSAGES = 250; |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 , endTime(-1.0) | 475 , endTime(-1.0) |
471 { | 476 { |
472 } | 477 } |
473 }; | 478 }; |
474 | 479 |
475 #pragma mark - | 480 #pragma mark - |
476 #pragma mark InspectorDatabaseResource Struct | 481 #pragma mark InspectorDatabaseResource Struct |
477 | 482 |
478 #if ENABLE(DATABASE) | 483 #if ENABLE(DATABASE) |
479 struct InspectorDatabaseResource : public RefCounted<InspectorDatabaseResource>
{ | 484 struct InspectorDatabaseResource : public RefCounted<InspectorDatabaseResource>
{ |
| 485 #if ENABLE_DATABASE_INSPECTION |
480 static PassRefPtr<InspectorDatabaseResource> create(Database* database, cons
t String& domain, const String& name, const String& version) | 486 static PassRefPtr<InspectorDatabaseResource> create(Database* database, cons
t String& domain, const String& name, const String& version) |
481 { | 487 { |
482 // Apple changed the default refcount to 1: http://trac.webkit.org/chang
eset/30406 | 488 // Apple changed the default refcount to 1: http://trac.webkit.org/chang
eset/30406 |
483 // We default it to 1 in the protected constructor below to match Apple, | 489 // We default it to 1 in the protected constructor below to match Apple, |
484 // so adoptRef is the right thing. | 490 // so adoptRef is the right thing. |
485 return adoptRef(new InspectorDatabaseResource(database, domain, name, ve
rsion)); | 491 return adoptRef(new InspectorDatabaseResource(database, domain, name, ve
rsion)); |
486 } | 492 } |
487 | 493 |
488 void setScriptObject(JSContextRef context, JSObjectRef newScriptObject) | 494 void setScriptObject(JSContextRef context, JSObjectRef newScriptObject) |
489 { | 495 { |
(...skipping 21 matching lines...) Expand all Loading... |
511 InspectorDatabaseResource(Database* database, const String& domain, const St
ring& name, const String& version) | 517 InspectorDatabaseResource(Database* database, const String& domain, const St
ring& name, const String& version) |
512 : RefCounted<InspectorDatabaseResource>(1) | 518 : RefCounted<InspectorDatabaseResource>(1) |
513 , database(database) | 519 , database(database) |
514 , domain(domain) | 520 , domain(domain) |
515 , name(name) | 521 , name(name) |
516 , version(version) | 522 , version(version) |
517 , scriptContext(0) | 523 , scriptContext(0) |
518 , scriptObject(0) | 524 , scriptObject(0) |
519 { | 525 { |
520 } | 526 } |
| 527 #endif |
521 }; | 528 }; |
522 #endif | 529 #endif |
523 | 530 |
524 #pragma mark - | 531 #pragma mark - |
525 #pragma mark JavaScript Callbacks | 532 #pragma mark JavaScript Callbacks |
526 | 533 |
527 #if USE(JAVASCRIPTCORE_BINDINGS) | 534 #if USE(JAVASCRIPTCORE_BINDINGS) |
528 static JSValueRef addSourceToFrame(JSContextRef ctx, JSObjectRef /*function*/, J
SObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSVal
ueRef* exception) | 535 static JSValueRef addSourceToFrame(JSContextRef ctx, JSObjectRef /*function*/, J
SObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSVal
ueRef* exception) |
529 { | 536 { |
530 JSValueRef undefined = JSValueMakeUndefined(ctx); | 537 JSValueRef undefined = JSValueMakeUndefined(ctx); |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
901 (v8::Function::Cast(*push))->Call(array, 1, args); | 908 (v8::Function::Cast(*push))->Call(array, 1, args); |
902 | 909 |
903 setStart(searchRange.get(), newStart); | 910 setStart(searchRange.get(), newStart); |
904 } while (true); | 911 } while (true); |
905 | 912 |
906 // TODO(jackson): Figure out how to return array | 913 // TODO(jackson): Figure out how to return array |
907 } | 914 } |
908 #endif | 915 #endif |
909 | 916 |
910 #if ENABLE(DATABASE) | 917 #if ENABLE(DATABASE) |
| 918 #if ENABLE_DATABASE_INSPECTION |
911 static JSValueRef databaseTableNames(JSContextRef ctx, JSObjectRef /*function*/,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSV
alueRef* exception) | 919 static JSValueRef databaseTableNames(JSContextRef ctx, JSObjectRef /*function*/,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSV
alueRef* exception) |
912 { | 920 { |
913 InspectorController* controller = reinterpret_cast<InspectorController*>(JSO
bjectGetPrivate(thisObject)); | 921 InspectorController* controller = reinterpret_cast<InspectorController*>(JSO
bjectGetPrivate(thisObject)); |
914 if (!controller) | 922 if (!controller) |
915 return JSValueMakeUndefined(ctx); | 923 return JSValueMakeUndefined(ctx); |
916 | 924 |
917 if (argumentCount < 1) | 925 if (argumentCount < 1) |
918 return JSValueMakeUndefined(ctx); | 926 return JSValueMakeUndefined(ctx); |
919 | 927 |
920 JSQuarantinedObjectWrapper* wrapper = JSQuarantinedObjectWrapper::asWrapper(
toJS(arguments[0])); | 928 JSQuarantinedObjectWrapper* wrapper = JSQuarantinedObjectWrapper::asWrapper(
toJS(arguments[0])); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
955 | 963 |
956 JSValueRef pushArguments[] = { tableNameValue }; | 964 JSValueRef pushArguments[] = { tableNameValue }; |
957 JSObjectCallAsFunction(ctx, pushFunction, result, 1, pushArguments, exce
ption); | 965 JSObjectCallAsFunction(ctx, pushFunction, result, 1, pushArguments, exce
ption); |
958 if (exception && *exception) | 966 if (exception && *exception) |
959 return JSValueMakeUndefined(ctx); | 967 return JSValueMakeUndefined(ctx); |
960 } | 968 } |
961 | 969 |
962 return result; | 970 return result; |
963 } | 971 } |
964 #endif | 972 #endif |
| 973 #endif |
965 | 974 |
966 #if USE(JAVASCRIPTCORE_BINDINGS) | 975 #if USE(JAVASCRIPTCORE_BINDINGS) |
967 static JSValueRef inspectedWindow(JSContextRef ctx, JSObjectRef /*function*/, JS
ObjectRef thisObject, size_t /*argumentCount*/, const JSValueRef[] /*arguments[]
*/, JSValueRef* /*exception*/) | 976 static JSValueRef inspectedWindow(JSContextRef ctx, JSObjectRef /*function*/, JS
ObjectRef thisObject, size_t /*argumentCount*/, const JSValueRef[] /*arguments[]
*/, JSValueRef* /*exception*/) |
968 { | 977 { |
969 InspectorController* controller = reinterpret_cast<InspectorController*>(JSO
bjectGetPrivate(thisObject)); | 978 InspectorController* controller = reinterpret_cast<InspectorController*>(JSO
bjectGetPrivate(thisObject)); |
970 if (!controller) | 979 if (!controller) |
971 return JSValueMakeUndefined(ctx); | 980 return JSValueMakeUndefined(ctx); |
972 | 981 |
973 JSDOMWindow* inspectedWindow = toJSDOMWindow(controller->inspectedPage()->ma
inFrame()); | 982 JSDOMWindow* inspectedWindow = toJSDOMWindow(controller->inspectedPage()->ma
inFrame()); |
974 JSLock lock; | 983 JSLock lock; |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1440 { "addSourceToFrame", addSourceToFrame, kJSPropertyAttributeNone }, | 1449 { "addSourceToFrame", addSourceToFrame, kJSPropertyAttributeNone }, |
1441 { "getResourceDocumentNode", getResourceDocumentNode, kJSPropertyAttribu
teNone }, | 1450 { "getResourceDocumentNode", getResourceDocumentNode, kJSPropertyAttribu
teNone }, |
1442 { "highlightDOMNode", highlightDOMNode, kJSPropertyAttributeNone }, | 1451 { "highlightDOMNode", highlightDOMNode, kJSPropertyAttributeNone }, |
1443 { "hideDOMNodeHighlight", hideDOMNodeHighlight, kJSPropertyAttributeNone
}, | 1452 { "hideDOMNodeHighlight", hideDOMNodeHighlight, kJSPropertyAttributeNone
}, |
1444 { "loaded", loaded, kJSPropertyAttributeNone }, | 1453 { "loaded", loaded, kJSPropertyAttributeNone }, |
1445 { "windowUnloading", unloading, kJSPropertyAttributeNone }, | 1454 { "windowUnloading", unloading, kJSPropertyAttributeNone }, |
1446 { "attach", attach, kJSPropertyAttributeNone }, | 1455 { "attach", attach, kJSPropertyAttributeNone }, |
1447 { "detach", detach, kJSPropertyAttributeNone }, | 1456 { "detach", detach, kJSPropertyAttributeNone }, |
1448 { "search", search, kJSPropertyAttributeNone }, | 1457 { "search", search, kJSPropertyAttributeNone }, |
1449 #if ENABLE(DATABASE) | 1458 #if ENABLE(DATABASE) |
| 1459 #if ENABLE_DATABASE_INSPECTION |
1450 { "databaseTableNames", databaseTableNames, kJSPropertyAttributeNone }, | 1460 { "databaseTableNames", databaseTableNames, kJSPropertyAttributeNone }, |
1451 #endif | 1461 #endif |
| 1462 #endif |
1452 { "inspectedWindow", inspectedWindow, kJSPropertyAttributeNone }, | 1463 { "inspectedWindow", inspectedWindow, kJSPropertyAttributeNone }, |
1453 { "localizedStringsURL", localizedStrings, kJSPropertyAttributeNone }, | 1464 { "localizedStringsURL", localizedStrings, kJSPropertyAttributeNone }, |
1454 { "platform", platform, kJSPropertyAttributeNone }, | 1465 { "platform", platform, kJSPropertyAttributeNone }, |
1455 { "moveByUnrestricted", moveByUnrestricted, kJSPropertyAttributeNone }, | 1466 { "moveByUnrestricted", moveByUnrestricted, kJSPropertyAttributeNone }, |
1456 { "wrapCallback", wrapCallback, kJSPropertyAttributeNone }, | 1467 { "wrapCallback", wrapCallback, kJSPropertyAttributeNone }, |
1457 { "startDebuggingAndReloadInspectedPage", WebCore::startDebuggingAndRelo
adInspectedPage, kJSPropertyAttributeNone }, | 1468 { "startDebuggingAndReloadInspectedPage", WebCore::startDebuggingAndRelo
adInspectedPage, kJSPropertyAttributeNone }, |
1458 { "stopDebugging", WebCore::stopDebugging, kJSPropertyAttributeNone }, | 1469 { "stopDebugging", WebCore::stopDebugging, kJSPropertyAttributeNone }, |
1459 { "debuggerAttached", WebCore::debuggerAttached, kJSPropertyAttributeNon
e }, | 1470 { "debuggerAttached", WebCore::debuggerAttached, kJSPropertyAttributeNon
e }, |
1460 { 0, 0, 0 } | 1471 { 0, 0, 0 } |
1461 }; | 1472 }; |
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2186 | 2197 |
2187 ResourcesMap::iterator resourcesEnd = m_resources.end(); | 2198 ResourcesMap::iterator resourcesEnd = m_resources.end(); |
2188 for (ResourcesMap::iterator it = m_resources.begin(); it != resourcesEnd; ++
it) | 2199 for (ResourcesMap::iterator it = m_resources.begin(); it != resourcesEnd; ++
it) |
2189 addAndUpdateScriptResource(it->second.get()); | 2200 addAndUpdateScriptResource(it->second.get()); |
2190 | 2201 |
2191 unsigned messageCount = m_consoleMessages.size(); | 2202 unsigned messageCount = m_consoleMessages.size(); |
2192 for (unsigned i = 0; i < messageCount; ++i) | 2203 for (unsigned i = 0; i < messageCount; ++i) |
2193 addScriptConsoleMessage(m_consoleMessages[i]); | 2204 addScriptConsoleMessage(m_consoleMessages[i]); |
2194 | 2205 |
2195 #if ENABLE(DATABASE) | 2206 #if ENABLE(DATABASE) |
| 2207 #if ENABLE_DATABASE_INSPECTION |
2196 DatabaseResourcesSet::iterator databasesEnd = m_databaseResources.end(); | 2208 DatabaseResourcesSet::iterator databasesEnd = m_databaseResources.end(); |
2197 for (DatabaseResourcesSet::iterator it = m_databaseResources.begin(); it !=
databasesEnd; ++it) | 2209 for (DatabaseResourcesSet::iterator it = m_databaseResources.begin(); it !=
databasesEnd; ++it) |
2198 addDatabaseScriptResource((*it).get()); | 2210 addDatabaseScriptResource((*it).get()); |
2199 #endif | 2211 #endif |
| 2212 #endif |
2200 } | 2213 } |
2201 #elif USE(V8_BINDING) | 2214 #elif USE(V8_BINDING) |
2202 void InspectorController::populateScriptObjects() | 2215 void InspectorController::populateScriptObjects() |
2203 { | 2216 { |
2204 ResourcesMap::iterator resourcesEnd = m_resources.end(); | 2217 ResourcesMap::iterator resourcesEnd = m_resources.end(); |
2205 for (ResourcesMap::iterator it = m_resources.begin(); it != resourcesEnd; ++
it) | 2218 for (ResourcesMap::iterator it = m_resources.begin(); it != resourcesEnd; ++
it) |
2206 addAndUpdateScriptResource(it->second.get()); | 2219 addAndUpdateScriptResource(it->second.get()); |
2207 | 2220 |
2208 unsigned messageCount = m_consoleMessages.size(); | 2221 unsigned messageCount = m_consoleMessages.size(); |
2209 for (unsigned i = 0; i < messageCount; ++i) | 2222 for (unsigned i = 0; i < messageCount; ++i) |
2210 addScriptConsoleMessage(m_consoleMessages[i]); | 2223 addScriptConsoleMessage(m_consoleMessages[i]); |
2211 } | 2224 } |
2212 #endif | 2225 #endif |
2213 | 2226 |
2214 #if ENABLE(DATABASE) | 2227 #if ENABLE(DATABASE) |
| 2228 #if ENABLE_DATABASE_INSPECTION |
2215 JSObjectRef InspectorController::addDatabaseScriptResource(InspectorDatabaseReso
urce* resource) | 2229 JSObjectRef InspectorController::addDatabaseScriptResource(InspectorDatabaseReso
urce* resource) |
2216 { | 2230 { |
2217 ASSERT_ARG(resource, resource); | 2231 ASSERT_ARG(resource, resource); |
2218 | 2232 |
2219 if (resource->scriptObject) | 2233 if (resource->scriptObject) |
2220 return resource->scriptObject; | 2234 return resource->scriptObject; |
2221 | 2235 |
2222 ASSERT(m_scriptContext); | 2236 ASSERT(m_scriptContext); |
2223 ASSERT(m_scriptObject); | 2237 ASSERT(m_scriptObject); |
2224 if (!m_scriptContext || !m_scriptObject) | 2238 if (!m_scriptContext || !m_scriptObject) |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2299 | 2313 |
2300 JSObjectRef removeDatabaseFunction = JSValueToObject(m_scriptContext, remove
DatabaseProperty, &exception); | 2314 JSObjectRef removeDatabaseFunction = JSValueToObject(m_scriptContext, remove
DatabaseProperty, &exception); |
2301 if (HANDLE_EXCEPTION(exception)) | 2315 if (HANDLE_EXCEPTION(exception)) |
2302 return; | 2316 return; |
2303 | 2317 |
2304 JSValueRef arguments[] = { scriptObject }; | 2318 JSValueRef arguments[] = { scriptObject }; |
2305 JSObjectCallAsFunction(m_scriptContext, removeDatabaseFunction, m_scriptObje
ct, 1, arguments, &exception); | 2319 JSObjectCallAsFunction(m_scriptContext, removeDatabaseFunction, m_scriptObje
ct, 1, arguments, &exception); |
2306 HANDLE_EXCEPTION(exception); | 2320 HANDLE_EXCEPTION(exception); |
2307 } | 2321 } |
2308 #endif | 2322 #endif |
| 2323 #endif |
2309 | 2324 |
2310 #if USE(JAVASCRIPTCORE_BINDINGS) | 2325 #if USE(JAVASCRIPTCORE_BINDINGS) |
2311 void InspectorController::addScriptConsoleMessage(const ConsoleMessage* message) | 2326 void InspectorController::addScriptConsoleMessage(const ConsoleMessage* message) |
2312 { | 2327 { |
2313 ASSERT_ARG(message, message); | 2328 ASSERT_ARG(message, message); |
2314 | 2329 |
2315 if (!m_scriptContext || !m_scriptObject) | 2330 if (!m_scriptContext || !m_scriptObject) |
2316 return; | 2331 return; |
2317 | 2332 |
2318 JSValueRef exception = 0; | 2333 JSValueRef exception = 0; |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2427 for (ResourcesMap::iterator it = m_resources.begin(); it != resourcesEnd; ++
it) { | 2442 for (ResourcesMap::iterator it = m_resources.begin(); it != resourcesEnd; ++
it) { |
2428 InspectorResource* resource = it->second.get(); | 2443 InspectorResource* resource = it->second.get(); |
2429 #if USE(JAVASCRIPTCORE_BINDINGS) | 2444 #if USE(JAVASCRIPTCORE_BINDINGS) |
2430 resource->setScriptObject(0, 0); | 2445 resource->setScriptObject(0, 0); |
2431 #elif USE(V8_BINDING) | 2446 #elif USE(V8_BINDING) |
2432 resource->setScriptObject(v8::Handle<v8::Object>()); | 2447 resource->setScriptObject(v8::Handle<v8::Object>()); |
2433 #endif | 2448 #endif |
2434 } | 2449 } |
2435 | 2450 |
2436 #if ENABLE(DATABASE) | 2451 #if ENABLE(DATABASE) |
| 2452 #if ENABLE_DATABASE_INSPECTION |
2437 DatabaseResourcesSet::iterator databasesEnd = m_databaseResources.end(); | 2453 DatabaseResourcesSet::iterator databasesEnd = m_databaseResources.end(); |
2438 for (DatabaseResourcesSet::iterator it = m_databaseResources.begin(); it !=
databasesEnd; ++it) { | 2454 for (DatabaseResourcesSet::iterator it = m_databaseResources.begin(); it !=
databasesEnd; ++it) { |
2439 InspectorDatabaseResource* resource = (*it).get(); | 2455 InspectorDatabaseResource* resource = (*it).get(); |
2440 resource->setScriptObject(0, 0); | 2456 resource->setScriptObject(0, 0); |
2441 } | 2457 } |
2442 #endif | 2458 #endif |
| 2459 #endif |
2443 | 2460 |
2444 #if USE(JAVASCRIPTCORE_BINDINGS) | 2461 #if USE(JAVASCRIPTCORE_BINDINGS) |
2445 callSimpleFunction(m_scriptContext, m_scriptObject, "reset"); | 2462 callSimpleFunction(m_scriptContext, m_scriptObject, "reset"); |
2446 #elif USE(V8_BINDING) | 2463 #elif USE(V8_BINDING) |
2447 v8::HandleScope handle_scope; | 2464 v8::HandleScope handle_scope; |
2448 v8::Handle<v8::Context> context = V8Proxy::GetContext(m_page->mainFrame()); | 2465 v8::Handle<v8::Context> context = V8Proxy::GetContext(m_page->mainFrame()); |
2449 v8::Context::Scope scope(context); | 2466 v8::Context::Scope scope(context); |
2450 | 2467 |
2451 v8::Handle<v8::Value> reset = m_scriptObject->Get(v8::String::New("reset")); | 2468 v8::Handle<v8::Value> reset = m_scriptObject->Get(v8::String::New("reset")); |
2452 ASSERT(reset->IsFunction()); | 2469 ASSERT(reset->IsFunction()); |
(...skipping 26 matching lines...) Expand all Loading... |
2479 { | 2496 { |
2480 if (!enabled()) | 2497 if (!enabled()) |
2481 return; | 2498 return; |
2482 | 2499 |
2483 if (loader->frame() == m_inspectedPage->mainFrame()) { | 2500 if (loader->frame() == m_inspectedPage->mainFrame()) { |
2484 m_client->inspectedURLChanged(loader->url().string()); | 2501 m_client->inspectedURLChanged(loader->url().string()); |
2485 deleteAllValues(m_consoleMessages); | 2502 deleteAllValues(m_consoleMessages); |
2486 m_consoleMessages.clear(); | 2503 m_consoleMessages.clear(); |
2487 | 2504 |
2488 #if ENABLE(DATABASE) | 2505 #if ENABLE(DATABASE) |
| 2506 #if ENABLE_DATABASE_INSPECTION |
2489 m_databaseResources.clear(); | 2507 m_databaseResources.clear(); |
2490 #endif | 2508 #endif |
| 2509 #endif |
2491 | 2510 |
2492 if (windowVisible()) { | 2511 if (windowVisible()) { |
2493 resetScriptObjects(); | 2512 resetScriptObjects(); |
2494 | 2513 |
2495 if (!loader->isLoadingFromCachedPage()) { | 2514 if (!loader->isLoadingFromCachedPage()) { |
2496 // We don't add the main resource until its load is committed. T
his is | 2515 // We don't add the main resource until its load is committed. T
his is |
2497 // needed to keep the load for a user-entered URL from showing u
p in the | 2516 // needed to keep the load for a user-entered URL from showing u
p in the |
2498 // list of resources for the page they are navigating away from. | 2517 // list of resources for the page they are navigating away from. |
2499 if (trackResources() && m_mainResource) | 2518 if (trackResources() && m_mainResource) |
2500 addAndUpdateScriptResource(m_mainResource.get()); | 2519 addAndUpdateScriptResource(m_mainResource.get()); |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2722 resource->setXMLHttpRequestProperties(sourceString); | 2741 resource->setXMLHttpRequestProperties(sourceString); |
2723 } | 2742 } |
2724 #elif USE(V8_BINDING) | 2743 #elif USE(V8_BINDING) |
2725 // TODO(ojan): Implement! | 2744 // TODO(ojan): Implement! |
2726 #endif | 2745 #endif |
2727 | 2746 |
2728 | 2747 |
2729 #if ENABLE(DATABASE) | 2748 #if ENABLE(DATABASE) |
2730 void InspectorController::didOpenDatabase(Database* database, const String& doma
in, const String& name, const String& version) | 2749 void InspectorController::didOpenDatabase(Database* database, const String& doma
in, const String& name, const String& version) |
2731 { | 2750 { |
| 2751 #if ENABLE_DATABASE_INSPECTION |
2732 if (!enabled()) | 2752 if (!enabled()) |
2733 return; | 2753 return; |
2734 | 2754 |
2735 RefPtr<InspectorDatabaseResource> resource = InspectorDatabaseResource::crea
te(database, domain, name, version); | 2755 RefPtr<InspectorDatabaseResource> resource = InspectorDatabaseResource::crea
te(database, domain, name, version); |
2736 | 2756 |
2737 m_databaseResources.add(resource); | 2757 m_databaseResources.add(resource); |
2738 | 2758 |
2739 if (windowVisible()) | 2759 if (windowVisible()) |
2740 addDatabaseScriptResource(resource.get()); | 2760 addDatabaseScriptResource(resource.get()); |
| 2761 #endif |
2741 } | 2762 } |
2742 #endif | 2763 #endif |
2743 | 2764 |
2744 void InspectorController::moveWindowBy(float x, float y) const | 2765 void InspectorController::moveWindowBy(float x, float y) const |
2745 { | 2766 { |
2746 if (!m_page || !enabled()) | 2767 if (!m_page || !enabled()) |
2747 return; | 2768 return; |
2748 | 2769 |
2749 FloatRect frameRect = m_page->chrome()->windowRect(); | 2770 FloatRect frameRect = m_page->chrome()->windowRect(); |
2750 frameRect.move(x, y); | 2771 frameRect.move(x, y); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2899 | 2920 |
2900 void InspectorController::exceptionWasRaised(ExecState*, int /*sourceID*/, int /
*lineNumber*/) | 2921 void InspectorController::exceptionWasRaised(ExecState*, int /*sourceID*/, int /
*lineNumber*/) |
2901 { | 2922 { |
2902 } | 2923 } |
2903 | 2924 |
2904 #elif USE(V8_BINDING) | 2925 #elif USE(V8_BINDING) |
2905 // TODO(ojan): Implement! | 2926 // TODO(ojan): Implement! |
2906 #endif | 2927 #endif |
2907 | 2928 |
2908 } // namespace WebCore | 2929 } // namespace WebCore |
OLD | NEW |