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

Unified Diff: Source/WebCore/inspector/InspectorInstrumentation.h

Issue 12077053: Merge 140127 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
Index: Source/WebCore/inspector/InspectorInstrumentation.h
===================================================================
--- Source/WebCore/inspector/InspectorInstrumentation.h (revision 141144)
+++ Source/WebCore/inspector/InspectorInstrumentation.h (working copy)
@@ -40,6 +40,7 @@
#include "ScriptExecutionContext.h"
#include "ScriptState.h"
#include "StorageArea.h"
+#include <wtf/RefPtr.h>
#include <wtf/UnusedParam.h>
namespace WebCore {
@@ -58,6 +59,7 @@
class GraphicsContext;
class HitTestResult;
class InspectorCSSAgent;
+class InspectorInstrumentation;
class InspectorTimelineAgent;
class InstrumentingAgents;
class KURL;
@@ -89,8 +91,24 @@
#define FAST_RETURN_IF_NO_FRONTENDS(value) if (!hasFrontends()) return value;
-typedef pair<InstrumentingAgents*, int> InspectorInstrumentationCookie;
+class InspectorInstrumentationCookie {
+public:
+ InspectorInstrumentationCookie();
+ InspectorInstrumentationCookie(InstrumentingAgents*, int);
+ InspectorInstrumentationCookie(const InspectorInstrumentationCookie&);
+ InspectorInstrumentationCookie& operator=(const InspectorInstrumentationCookie&);
+ ~InspectorInstrumentationCookie();
+private:
+ friend class InspectorInstrumentation;
+ InstrumentingAgents* instrumentingAgents() const { return m_instrumentingAgents.get(); }
+ bool isValid() const { return !!m_instrumentingAgents; }
+ bool hasMatchingTimelineAgentId(int id) const { return m_timelineAgentId == id; }
+
+ RefPtr<InstrumentingAgents> m_instrumentingAgents;
+ int m_timelineAgentId;
+};
+
class InspectorInstrumentation {
public:
static void didClearWindowObjectInWorld(Frame*, DOMWrapperWorld*);
@@ -804,7 +822,7 @@
{
#if ENABLE(INSPECTOR)
FAST_RETURN_IF_NO_FRONTENDS(void());
- if (cookie.first)
+ if (cookie.isValid())
didCallFunctionImpl(cookie);
#else
UNUSED_PARAM(cookie);
@@ -828,7 +846,7 @@
{
#if ENABLE(INSPECTOR)
FAST_RETURN_IF_NO_FRONTENDS(void());
- if (cookie.first)
+ if (cookie.isValid())
didDispatchXHRReadyStateChangeEventImpl(cookie);
#else
UNUSED_PARAM(cookie);
@@ -855,7 +873,7 @@
{
#if ENABLE(INSPECTOR)
FAST_RETURN_IF_NO_FRONTENDS(void());
- if (cookie.first)
+ if (cookie.isValid())
didDispatchEventImpl(cookie);
#else
UNUSED_PARAM(cookie);
@@ -879,7 +897,7 @@
{
#if ENABLE(INSPECTOR)
FAST_RETURN_IF_NO_FRONTENDS(void());
- if (cookie.first)
+ if (cookie.isValid())
didHandleEventImpl(cookie);
#else
UNUSED_PARAM(cookie);
@@ -904,7 +922,7 @@
{
#if ENABLE(INSPECTOR)
FAST_RETURN_IF_NO_FRONTENDS(void());
- if (cookie.first)
+ if (cookie.isValid())
didDispatchEventOnWindowImpl(cookie);
#else
UNUSED_PARAM(cookie);
@@ -929,7 +947,7 @@
{
#if ENABLE(INSPECTOR)
FAST_RETURN_IF_NO_FRONTENDS(void());
- if (cookie.first)
+ if (cookie.isValid())
didEvaluateScriptImpl(cookie);
#else
UNUSED_PARAM(cookie);
@@ -966,7 +984,7 @@
{
#if ENABLE(INSPECTOR)
FAST_RETURN_IF_NO_FRONTENDS(void());
- if (cookie.first)
+ if (cookie.isValid())
didFireTimerImpl(cookie);
#else
UNUSED_PARAM(cookie);
@@ -1022,7 +1040,7 @@
{
#if ENABLE(INSPECTOR)
FAST_RETURN_IF_NO_FRONTENDS(void());
- if (cookie.first)
+ if (cookie.isValid())
didLayoutImpl(cookie, root);
#else
UNUSED_PARAM(cookie);
@@ -1058,7 +1076,7 @@
{
#if ENABLE(INSPECTOR)
FAST_RETURN_IF_NO_FRONTENDS(void());
- if (cookie.first)
+ if (cookie.isValid())
didDispatchXHRLoadEventImpl(cookie);
#else
UNUSED_PARAM(cookie);
@@ -1081,7 +1099,7 @@
{
#if ENABLE(INSPECTOR)
FAST_RETURN_IF_NO_FRONTENDS(void());
- if (cookie.first)
+ if (cookie.isValid())
didPaintImpl(cookie, context, rect);
#else
UNUSED_PARAM(cookie);
@@ -1150,7 +1168,7 @@
{
#if ENABLE(INSPECTOR)
FAST_RETURN_IF_NO_FRONTENDS(void());
- if (cookie.first)
+ if (cookie.isValid())
didRecalculateStyleImpl(cookie);
#else
UNUSED_PARAM(cookie);
@@ -1186,7 +1204,7 @@
{
#if ENABLE(INSPECTOR)
FAST_RETURN_IF_NO_FRONTENDS(void());
- if (cookie.first)
+ if (cookie.isValid())
didMatchRuleImpl(cookie, matched);
#else
UNUSED_PARAM(cookie);
@@ -1214,7 +1232,7 @@
{
#if ENABLE(INSPECTOR)
FAST_RETURN_IF_NO_FRONTENDS(void());
- if (cookie.first)
+ if (cookie.isValid())
didProcessRuleImpl(cookie);
#else
UNUSED_PARAM(cookie);
@@ -1362,7 +1380,7 @@
{
#if ENABLE(INSPECTOR)
FAST_RETURN_IF_NO_FRONTENDS(void());
- if (cookie.first)
+ if (cookie.isValid())
didReceiveResourceDataImpl(cookie);
#else
UNUSED_PARAM(cookie);
@@ -1386,7 +1404,8 @@
{
#if ENABLE(INSPECTOR)
// Call this unconditionally so that we're able to log to console with no front-end attached.
- didReceiveResourceResponseImpl(cookie, identifier, loader, response, resourceLoader);
+ if (cookie.isValid())
+ didReceiveResourceResponseImpl(cookie, identifier, loader, response, resourceLoader);
#else
UNUSED_PARAM(cookie);
UNUSED_PARAM(identifier);
@@ -1682,7 +1701,7 @@
{
#if ENABLE(INSPECTOR)
FAST_RETURN_IF_NO_FRONTENDS(void());
- if (cookie.first)
+ if (cookie.isValid())
didWriteHTMLImpl(cookie, endLine);
#else
UNUSED_PARAM(cookie);
@@ -1901,7 +1920,7 @@
{
#if ENABLE(INSPECTOR)
FAST_RETURN_IF_NO_FRONTENDS(void());
- if (cookie.first)
+ if (cookie.isValid())
didFireAnimationFrameImpl(cookie);
#else
UNUSED_PARAM(cookie);
« no previous file with comments | « Source/WebCore/inspector/InspectorController.cpp ('k') | Source/WebCore/inspector/InspectorInstrumentation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698