Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
2010-03-05 Pavel Feldman <pfeldman@chromium.org>
        Not reviewed. Roll back r55522 since it regreses performance
        according to chromium's page cycler.

        https://bugs.webkit.org/show_bug.cgi?id=35568


Canonical link: https://commits.webkit.org/46881@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@55584 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
pavelfeldman committed Mar 5, 2010
1 parent d40d0c4 commit 6a4cdee
Show file tree
Hide file tree
Showing 29 changed files with 45 additions and 509 deletions.
7 changes: 7 additions & 0 deletions WebCore/ChangeLog
@@ -1,3 +1,10 @@
2010-03-05 Pavel Feldman <pfeldman@chromium.org>

Not reviewed. Roll back r55522 since it regreses performance
according to chromium's page cycler.

https://bugs.webkit.org/show_bug.cgi?id=35568

2010-03-05 Dean Jackson <dino@apple.com>

Reviewed by Simon Fraser and Chris Marrin.
Expand Down
Binary file modified WebCore/English.lproj/localizedStrings.js
Binary file not shown.
3 changes: 0 additions & 3 deletions WebCore/WebCore.gypi
Expand Up @@ -1614,7 +1614,6 @@
'inspector/InspectorResource.h',
'inspector/InspectorTimelineAgent.cpp',
'inspector/InspectorTimelineAgent.h',
'inspector/InspectorWorkerResource.h',
'inspector/JavaScriptCallFrame.cpp',
'inspector/JavaScriptCallFrame.h',
'inspector/ScriptBreakpoint.h',
Expand Down Expand Up @@ -3734,7 +3733,6 @@
'inspector/front-end/Callback.js',
'inspector/front-end/CallStackSidebarPane.js',
'inspector/front-end/ChangesView.js',
'inspector/front-end/Checkbox.js',
'inspector/front-end/Color.js',
'inspector/front-end/ConsolePanel.js',
'inspector/front-end/ConsoleView.js',
Expand Down Expand Up @@ -3811,7 +3809,6 @@
'inspector/front-end/View.js',
'inspector/front-end/WatchExpressionsSidebarPane.js',
'inspector/front-end/WelcomeView.js',
'inspector/front-end/WorkersSidebarPane.js',
'inspector/front-end/audits.css',
'inspector/front-end/inspector.css',
'inspector/front-end/inspectorSyntaxHighlight.css',
Expand Down
12 changes: 0 additions & 12 deletions WebCore/WebCore.vcproj/WebCore.vcproj
Expand Up @@ -42728,10 +42728,6 @@
RelativePath="..\inspector\InspectorTimelineAgent.h"
>
</File>
<File
RelativePath="..\inspector\InspectorWorkerResource.h"
>
</File>
<File
RelativePath="..\inspector\JavaScriptCallFrame.cpp"
>
Expand Down Expand Up @@ -42811,10 +42807,6 @@
RelativePath="..\inspector\front-end\ChangesView.js"
>
</File>
<File
RelativePath="..\inspector\front-end\Checkbox.js"
>
</File>
<File
RelativePath="..\inspector\front-end\Color.js"
>
Expand Down Expand Up @@ -43123,10 +43115,6 @@
RelativePath="..\inspector\front-end\WelcomeView.js"
>
</File>
<File
RelativePath="..\inspector\front-end\WorkersSidebarPane.js"
>
</File>
</Filter>
</Filter>
<Filter
Expand Down
17 changes: 9 additions & 8 deletions WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
@@ -1,7 +1,7 @@
/*
* Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
* Copyright (C) 2010 Google Inc. All rights reserved.
* Copyright (C) 2009 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
Expand Down Expand Up @@ -75,7 +75,7 @@ using namespace JSC;

namespace WebCore {

ScriptObject InjectedScriptHost::createInjectedScript(const String& source, ScriptState* scriptState, long id)
static ScriptObject createInjectedScript(const String& source, InjectedScriptHost* injectedScriptHost, ScriptState* scriptState, long id)
{
SourceCode sourceCode = makeSource(source);
JSLock lock(SilenceAssertionsOnly);
Expand All @@ -91,7 +91,7 @@ ScriptObject InjectedScriptHost::createInjectedScript(const String& source, Scri
return ScriptObject();

MarkedArgumentBuffer args;
args.append(toJS(scriptState, globalObject, this));
args.append(toJS(scriptState, globalObject, injectedScriptHost));
args.append(globalThisValue);
args.append(jsNumber(scriptState, id));
JSValue result = JSC::call(scriptState, functionValue, callType, callData, globalThisValue, args);
Expand Down Expand Up @@ -221,11 +221,12 @@ InjectedScript InjectedScriptHost::injectedScriptFor(ScriptState* scriptState)
if (injectedScript)
return InjectedScript(ScriptObject(scriptState, injectedScript));

ASSERT(!m_injectedScriptSource.isEmpty());
pair<long, ScriptObject> injectedScriptObject = injectScript(m_injectedScriptSource, scriptState);
globalObject->setInjectedScript(injectedScriptObject.second.jsObject());
InjectedScript result(injectedScriptObject.second);
m_idToInjectedScript.set(injectedScriptObject.first, result);
ASSERT(!m_injectedScriptSource.isEmpty());
ScriptObject injectedScriptObject = createInjectedScript(m_injectedScriptSource, this, scriptState, m_nextInjectedScriptId);
globalObject->setInjectedScript(injectedScriptObject.jsObject());
InjectedScript result(injectedScriptObject);
m_idToInjectedScript.set(m_nextInjectedScriptId, result);
m_nextInjectedScriptId++;
return result;
}

Expand Down
13 changes: 7 additions & 6 deletions WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
Expand Up @@ -79,7 +79,7 @@ static v8::Local<v8::Object> createInjectedScriptHostV8Wrapper(InjectedScriptHos
return instance;
}

ScriptObject InjectedScriptHost::createInjectedScript(const String& scriptSource, ScriptState* inspectedScriptState, long id)
static ScriptObject createInjectedScript(const String& scriptSource, InjectedScriptHost* injectedScriptHost, ScriptState* inspectedScriptState, long id)
{
v8::HandleScope scope;

Expand All @@ -90,7 +90,7 @@ ScriptObject InjectedScriptHost::createInjectedScript(const String& scriptSource
// instead of calling toV8() that would create the
// wrapper in the current context.
// FIXME: make it possible to use generic bindings factory for InjectedScriptHost.
v8::Local<v8::Object> scriptHostWrapper = createInjectedScriptHostV8Wrapper(this);
v8::Local<v8::Object> scriptHostWrapper = createInjectedScriptHostV8Wrapper(injectedScriptHost);
if (scriptHostWrapper.IsEmpty())
return ScriptObject();

Expand Down Expand Up @@ -240,10 +240,11 @@ InjectedScript InjectedScriptHost::injectedScriptFor(ScriptState* inspectedScrip
return InjectedScript(ScriptObject(inspectedScriptState, v8::Local<v8::Object>::Cast(val)));

ASSERT(!m_injectedScriptSource.isEmpty());
pair<long, ScriptObject> injectedScript = injectScript(m_injectedScriptSource, inspectedScriptState);
InjectedScript result(injectedScript.second);
m_idToInjectedScript.set(injectedScript.first, result);
global->SetHiddenValue(key, injectedScript.second.v8Object());
ScriptObject injectedScriptObject = createInjectedScript(m_injectedScriptSource, this, inspectedScriptState, m_nextInjectedScriptId);
InjectedScript result(injectedScriptObject);
m_idToInjectedScript.set(m_nextInjectedScriptId, result);
++m_nextInjectedScriptId;
global->SetHiddenValue(key, injectedScriptObject.v8Object());
return result;
}

Expand Down
5 changes: 0 additions & 5 deletions WebCore/dom/Document.cpp
Expand Up @@ -4798,11 +4798,6 @@ InspectorTimelineAgent* Document::inspectorTimelineAgent() const
{
return page() ? page()->inspectorTimelineAgent() : 0;
}

InspectorController* Document::inspectorController() const
{
return page() ? page()->inspectorController() : 0;
}
#endif

} // namespace WebCore
1 change: 0 additions & 1 deletion WebCore/dom/Document.h
Expand Up @@ -450,7 +450,6 @@ class Document : public ContainerNode, public ScriptExecutionContext {
Settings* settings() const; // can be NULL
#if ENABLE(INSPECTOR)
InspectorTimelineAgent* inspectorTimelineAgent() const; // can be NULL
virtual InspectorController* inspectorController() const; // can be NULL
#endif

PassRefPtr<Range> createRange();
Expand Down
6 changes: 0 additions & 6 deletions WebCore/dom/ScriptExecutionContext.h
Expand Up @@ -49,9 +49,6 @@ namespace WebCore {
class SecurityOrigin;
class ScriptString;
class String;
#if ENABLE(INSPECTOR)
class InspectorController;
#endif

enum MessageDestination {
#if ENABLE(INSPECTOR)
Expand Down Expand Up @@ -87,9 +84,6 @@ namespace WebCore {
virtual String userAgent(const KURL&) const = 0;

SecurityOrigin* securityOrigin() const { return m_securityOrigin.get(); }
#if ENABLE(INSPECTOR)
virtual InspectorController* inspectorController() const { return 0; }
#endif

virtual void reportException(const String& errorMessage, int lineNumber, const String& sourceURL) = 0;
virtual void addMessage(MessageDestination, MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceURL) = 0;
Expand Down
28 changes: 1 addition & 27 deletions WebCore/inspector/InjectedScriptHost.cpp
@@ -1,7 +1,7 @@
/*
* Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
* Copyright (C) 2010 Google Inc. All rights reserved.
* Copyright (C) 2009 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -70,7 +70,6 @@ namespace WebCore {
InjectedScriptHost::InjectedScriptHost(InspectorController* inspectorController)
: m_inspectorController(inspectorController)
, m_nextInjectedScriptId(1)
, m_lastWorkerId(1 << 31) // Distinguish ids of fake workers from real ones, to minimize the chances they overlap.
{
}

Expand Down Expand Up @@ -195,31 +194,6 @@ InspectorFrontend* InjectedScriptHost::inspectorFrontend()
return m_inspectorController->m_frontend.get();
}

pair<long, ScriptObject> InjectedScriptHost::injectScript(const String& source, ScriptState* scriptState)
{
long id = m_nextInjectedScriptId++;
return std::make_pair(id, createInjectedScript(source, scriptState, id));
}

#if ENABLE(WORKERS)
long InjectedScriptHost::nextWorkerId()
{
return ++m_lastWorkerId;
}

void InjectedScriptHost::didCreateWorker(long id, const String& url, bool isSharedWorker)
{
if (m_inspectorController)
m_inspectorController->didCreateWorker(id, url, isSharedWorker);
}

void InjectedScriptHost::willDestroyWorker(long id)
{
if (m_inspectorController)
m_inspectorController->willDestroyWorker(id);
}
#endif // ENABLE(WORKERS)

} // namespace WebCore

#endif // ENABLE(INSPECTOR)
8 changes: 0 additions & 8 deletions WebCore/inspector/InjectedScriptHost.h
Expand Up @@ -79,15 +79,9 @@ class InjectedScriptHost : public RefCounted<InjectedScriptHost>
#endif
#if ENABLE(DOM_STORAGE)
void selectDOMStorage(Storage* storage);
#endif
#if ENABLE(WORKERS)
long nextWorkerId();
void didCreateWorker(long id, const String& url, bool isSharedWorker);
void willDestroyWorker(long id);
#endif
void reportDidDispatchOnInjectedScript(long callId, SerializedScriptValue* result, bool isException);

pair<long, ScriptObject> injectScript(const String& source, ScriptState*);
InjectedScript injectedScriptFor(ScriptState*);
InjectedScript injectedScriptForId(long);
void discardInjectedScripts();
Expand All @@ -97,12 +91,10 @@ class InjectedScriptHost : public RefCounted<InjectedScriptHost>
InjectedScriptHost(InspectorController* inspectorController);
InspectorDOMAgent* inspectorDOMAgent();
InspectorFrontend* inspectorFrontend();
ScriptObject createInjectedScript(const String& source, ScriptState* scriptState, long id);

InspectorController* m_inspectorController;
String m_injectedScriptSource;
long m_nextInjectedScriptId;
long m_lastWorkerId;
typedef HashMap<long, InjectedScript> IdToInjectedScriptMap;
IdToInjectedScriptMap m_idToInjectedScript;
};
Expand Down
7 changes: 1 addition & 6 deletions WebCore/inspector/InjectedScriptHost.idl
@@ -1,7 +1,7 @@
/*
* Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
* Copyright (C) 2010 Google Inc. All rights reserved.
* Copyright (C) 2009 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
Expand Down Expand Up @@ -55,11 +55,6 @@ module core {
[Custom] void selectDOMStorage(in DOMObject storage);
#endif

#if defined(ENABLE_WORKERS) && ENABLE_WORKERS
void didCreateWorker(in long id, in DOMString url, in boolean isFakeWorker);
void willDestroyWorker(in long id);
long nextWorkerId();
#endif
[Custom] void reportDidDispatchOnInjectedScript(in long callId, in DOMObject result, in boolean isException);
};
}
40 changes: 3 additions & 37 deletions WebCore/inspector/InspectorController.cpp
Expand Up @@ -63,7 +63,6 @@
#include "InspectorFrontend.h"
#include "InspectorFrontendHost.h"
#include "InspectorResource.h"
#include "InspectorWorkerResource.h"
#include "InspectorTimelineAgent.h"
#include "Page.h"
#include "ProgressTracker.h"
Expand Down Expand Up @@ -711,11 +710,6 @@ void InspectorController::populateScriptObjects()
for (DOMStorageResourcesMap::iterator it = m_domStorageResources.begin(); it != domStorageEnd; ++it)
it->second->bind(m_frontend.get());
#endif
#if ENABLE(WORKERS)
WorkersMap::iterator workersEnd = m_workers.end();
for (WorkersMap::iterator it = m_workers.begin(); it != workersEnd; ++it)
m_frontend->didCreateWorker(*it->second);
#endif

m_frontend->populateInterface();

Expand Down Expand Up @@ -744,9 +738,7 @@ void InspectorController::resetScriptObjects()
for (DOMStorageResourcesMap::iterator it = m_domStorageResources.begin(); it != domStorageEnd; ++it)
it->second->unbind();
#endif
#if ENABLE(WORKERS)
m_workers.clear();
#endif

if (m_timelineAgent)
m_timelineAgent->reset();

Expand Down Expand Up @@ -833,10 +825,10 @@ void InspectorController::didCommitLoad(DocumentLoader* loader)
if (ResourcesMap* resourceMap = m_frameResources.get(frame))
pruneResources(resourceMap, loader);

ScriptState* scriptState = mainWorldScriptState(loader->frame());
for (Vector<String>::iterator it = m_scriptsToEvaluateOnLoad.begin();
it != m_scriptsToEvaluateOnLoad.end(); ++it) {
m_injectedScriptHost->injectScript(*it, scriptState);
ScriptSourceCode scriptSourceCode(*it);
loader->frame()->script()->evaluate(scriptSourceCode);
}
}

Expand Down Expand Up @@ -1179,32 +1171,6 @@ void InspectorController::stopTimelineProfiler()
m_frontend->timelineProfilerWasStopped();
}

#if ENABLE(WORKERS)
void InspectorController::didCreateWorker(long id, const String& url, bool isSharedWorker)
{
if (!enabled())
return;

RefPtr<InspectorWorkerResource> workerResource(InspectorWorkerResource::create(id, url, isSharedWorker));
m_workers.set(id, workerResource);
if (m_frontend)
m_frontend->didCreateWorker(*workerResource);
}

void InspectorController::willDestroyWorker(long id)
{
if (!enabled())
return;

WorkersMap::iterator workerResource = m_workers.find(id);
if (workerResource == m_workers.end())
return;
if (m_frontend)
m_frontend->willDestroyWorker(*workerResource->second);
m_workers.remove(workerResource);
}
#endif // ENABLE(WORKERS)

#if ENABLE(DATABASE)
void InspectorController::selectDatabase(Database* database)
{
Expand Down
13 changes: 2 additions & 11 deletions WebCore/inspector/InspectorController.h
Expand Up @@ -85,7 +85,6 @@ class ConsoleMessage;
class InspectorDatabaseResource;
class InspectorDOMStorageResource;
class InspectorResource;
class InspectorWorkerResource;

class InspectorController
#if ENABLE(JAVASCRIPT_DEBUGGER)
Expand Down Expand Up @@ -186,14 +185,11 @@ class InspectorController

void mainResourceFiredLoadEvent(DocumentLoader*, const KURL&);
void mainResourceFiredDOMContentEvent(DocumentLoader*, const KURL&);

void didInsertDOMNode(Node*);
void didRemoveDOMNode(Node*);
void didModifyDOMAttr(Element*);
#if ENABLE(WORKERS)
void didCreateWorker(long id, const String& url, bool isSharedWorker);
void willDestroyWorker(long id);
#endif

void getCookies(long callId);

#if ENABLE(DATABASE)
Expand Down Expand Up @@ -372,11 +368,6 @@ class InspectorController
Timer<InspectorController> m_startProfiling;
ProfilesMap m_profiles;
#endif
#if ENABLE(WORKERS)
typedef HashMap<long, RefPtr<InspectorWorkerResource> > WorkersMap;

WorkersMap m_workers;
#endif
};

inline void InspectorController::didInsertDOMNode(Node* node)
Expand Down

0 comments on commit 6a4cdee

Please sign in to comment.