Changeset 82810 in webkit
- Timestamp:
- Apr 4, 2011 2:38:02 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 7 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r82809 r82810 1 2011-04-01 Sergey Vorobyev <sergeyvorobyev@google.com> 2 3 Reviewed by Yury Semikhatsky. 4 5 Web Inspector: Separate sendMessageToFrontend function 6 from InspectorClient to individual interface. 7 https://bugs.webkit.org/show_bug.cgi?id=57548 8 9 Refactoring - covered with existing inspector tests. 10 11 * GNUmakefile.am: 12 * WebCore.gypi: 13 * WebCore.vcproj/WebCore.vcproj: 14 * WebCore.xcodeproj/project.pbxproj: 15 * inspector/CodeGeneratorInspector.pm: 16 * inspector/InspectorClient.h: 17 * inspector/InspectorFrontendChannel.h: Added. 18 (WebCore::InspectorFrontendChannel::~InspectorFrontendChannel): 19 1 20 2011-04-04 Nico Weber <thakis@chromium.org> 2 21 -
trunk/Source/WebCore/GNUmakefile.am
r82669 r82810 2025 2025 Source/WebCore/inspector/InspectorDOMStorageResource.cpp \ 2026 2026 Source/WebCore/inspector/InspectorDOMStorageResource.h \ 2027 Source/WebCore/inspector/InspectorFrontendChannel.h \ 2027 2028 Source/WebCore/inspector/InspectorFrontendClient.h \ 2028 2029 Source/WebCore/inspector/InspectorFrontendClientLocal.cpp \ -
trunk/Source/WebCore/WebCore.gypi
r82702 r82810 3214 3214 'inspector/InspectorDebuggerAgent.cpp', 3215 3215 'inspector/InspectorDebuggerAgent.h', 3216 'inspector/InspectorFrontendChannel.h', 3216 3217 'inspector/InspectorFrontendClientLocal.cpp', 3217 3218 'inspector/InspectorFrontendHost.cpp', -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r82668 r82810 66471 66471 </File> 66472 66472 <File 66473 RelativePath="..\inspector\InspectorFrontendChannel.h" 66474 > 66475 </File> 66476 <File 66473 66477 RelativePath="..\inspector\InspectorFrontendClient.h" 66474 66478 > -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r82662 r82810 644 644 20D629261253690B00081543 /* InspectorInstrumentation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 20D629241253690B00081543 /* InspectorInstrumentation.cpp */; }; 645 645 20D629271253690B00081543 /* InspectorInstrumentation.h in Headers */ = {isa = PBXBuildFile; fileRef = 20D629251253690B00081543 /* InspectorInstrumentation.h */; }; 646 227777601345DEA9008EA455 /* InspectorFrontendChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 2277775F1345DEA9008EA455 /* InspectorFrontendChannel.h */; settings = {ATTRIBUTES = (Private, ); }; }; 646 647 22885E641301AE4C00526E68 /* JSDOMImplementationCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 22885E631301AE4C00526E68 /* JSDOMImplementationCustom.cpp */; }; 647 648 228C284510D82500009D0D0E /* ScriptWrappable.h in Headers */ = {isa = PBXBuildFile; fileRef = 228C284410D82500009D0D0E /* ScriptWrappable.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 7044 7045 20D629241253690B00081543 /* InspectorInstrumentation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorInstrumentation.cpp; sourceTree = "<group>"; }; 7045 7046 20D629251253690B00081543 /* InspectorInstrumentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorInstrumentation.h; sourceTree = "<group>"; }; 7047 2277775F1345DEA9008EA455 /* InspectorFrontendChannel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorFrontendChannel.h; sourceTree = "<group>"; }; 7046 7048 22885E631301AE4C00526E68 /* JSDOMImplementationCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMImplementationCustom.cpp; sourceTree = "<group>"; }; 7047 7049 228C284410D82500009D0D0E /* ScriptWrappable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptWrappable.h; sourceTree = "<group>"; }; … … 13178 13180 41F061730F5F00AC00A07EAC /* InspectorDOMStorageResource.cpp */, 13179 13181 41F061720F5F00AC00A07EAC /* InspectorDOMStorageResource.h */, 13182 2277775F1345DEA9008EA455 /* InspectorFrontendChannel.h */, 13180 13183 F344C7121125B82C00F26EEE /* InspectorFrontendClient.h */, 13181 13184 F344C75711294FF600F26EEE /* InspectorFrontendClientLocal.cpp */, … … 21197 21200 4F707A9A11EF679400ACDA69 /* InspectorBackendDispatcher.h in Headers */, 21198 21201 F3D4C47912E07663003DA150 /* InspectorBrowserDebuggerAgent.h in Headers */, 21202 227777601345DEA9008EA455 /* InspectorFrontendChannel.h in Headers */, 21199 21203 1C81B95C0E97330800266E07 /* InspectorClient.h in Headers */, 21200 21204 F3335BF912E07DC300D33011 /* InspectorConsoleAgent.h in Headers */, -
trunk/Source/WebCore/inspector/CodeGeneratorInspector.pm
r82807 r82810 91 91 "header" => "InspectorFrontend.h", 92 92 }; 93 $typeTransform{"InspectorClient"} = {94 "forward" => "InspectorClient",95 "header" => "InspectorClient.h",96 };97 93 $typeTransform{"PassRefPtr"} = { 98 94 "forwardHeader" => "wtf/PassRefPtr.h", 95 }; 96 $typeTransform{"InspectorFrontendChannel"} = { 97 "forward" => "InspectorFrontendChannel", 98 "header" => "InspectorFrontendChannel.h", 99 99 }; 100 100 $typeTransform{"Object"} = { … … 262 262 263 263 $frontendClassName = "InspectorFrontend"; 264 $frontendConstructor = " ${frontendClassName}(Inspector Client*);";264 $frontendConstructor = " ${frontendClassName}(InspectorFrontendChannel*);"; 265 265 push(@frontendFooter, "private:"); 266 push(@frontendFooter, " Inspector Client* m_inspectorClient;");266 push(@frontendFooter, " InspectorFrontendChannel* m_inspectorFrontendChannel;"); 267 267 $frontendTypes{"String"} = 1; 268 $frontendTypes{"Inspector Client"} = 1;268 $frontendTypes{"InspectorFrontendChannel"} = 1; 269 269 $frontendTypes{"PassRefPtr"} = 1; 270 270 … … 272 272 $backendJSStubName = "InspectorBackendStub"; 273 273 $backendTypes{"Inspector"} = 1; 274 $backendTypes{"Inspector Client"} = 1;274 $backendTypes{"InspectorFrontendChannel"} = 1; 275 275 $backendTypes{"PassRefPtr"} = 1; 276 276 $backendTypes{"Object"} = 1; … … 301 301 push(@frontendMethods, " class ${agentName} {"); 302 302 push(@frontendMethods, " public:"); 303 push(@frontendMethods, " ${agentName}(Inspector Client* inspectorClient) : m_inspectorClient(inspectorClient) { }");303 push(@frontendMethods, " ${agentName}(InspectorFrontendChannel* inspectorFrontendChannel) : m_inspectorFrontendChannel(inspectorFrontendChannel) { }"); 304 304 push(@frontendMethods, @{$agent->{methodDeclarations}}); 305 push(@frontendMethods, " void setInspectorFrontendChannel(InspectorFrontendChannel* inspectorFrontendChannel) { m_inspectorFrontendChannel = inspectorFrontendChannel; }"); 306 push(@frontendMethods, " InspectorFrontendChannel* getInspectorFrontendChannel() { return m_inspectorFrontendChannel; }"); 305 307 push(@frontendMethods, " private:"); 306 push(@frontendMethods, " Inspector Client* m_inspectorClient;");308 push(@frontendMethods, " InspectorFrontendChannel* m_inspectorFrontendChannel;"); 307 309 push(@frontendMethods, " };"); 308 310 push(@frontendMethods, ""); … … 320 322 { 321 323 my @frontendConstructorImpl; 322 push(@frontendConstructorImpl, "${frontendClassName}::${frontendClassName}(Inspector Client* inspectorClient)");323 push(@frontendConstructorImpl, " : m_inspector Client(inspectorClient)");324 push(@frontendConstructorImpl, "${frontendClassName}::${frontendClassName}(InspectorFrontendChannel* inspectorFrontendChannel)"); 325 push(@frontendConstructorImpl, " : m_inspectorFrontendChannel(inspectorFrontendChannel)"); 324 326 foreach my $agentField (@frontendAgentFields) { 325 push(@frontendConstructorImpl, " , ${agentField}(inspector Client)");327 push(@frontendConstructorImpl, " , ${agentField}(inspectorFrontendChannel)"); 326 328 } 327 329 push(@frontendConstructorImpl, "{"); … … 375 377 push(@function, @pushArguments); 376 378 push(@function, " ${functionName}Message->setObject(\"data\", dataObject);"); 377 push(@function, " m_inspector Client->sendMessageToFrontend(${functionName}Message->toJSONString());");379 push(@function, " m_inspectorFrontendChannel->sendMessageToFrontend(${functionName}Message->toJSONString());"); 378 380 push(@function, "}"); 379 381 push(@function, ""); … … 475 477 push(@function, " }"); 476 478 } 477 push(@function, " m_inspector Client->sendMessageToFrontend(responseMessage->toJSONString());");479 push(@function, " m_inspectorFrontendChannel->sendMessageToFrontend(responseMessage->toJSONString());"); 478 480 push(@function, " }"); 479 481 … … 495 497 errors->pushString(errorText); 496 498 message->setArray("protocolErrors", errors); 497 m_inspector Client->sendMessageToFrontend(message->toJSONString());499 m_inspectorFrontendChannel->sendMessageToFrontend(message->toJSONString()); 498 500 } 499 501 EOF … … 931 933 my @fieldInitializers; 932 934 933 push(@arguments, "Inspector Client* inspectorClient");934 push(@fieldInitializers, " : m_inspector Client(inspectorClient)");935 push(@backendFooter, " Inspector Client* m_inspectorClient;");935 push(@arguments, "InspectorFrontendChannel* inspectorFrontendChannel"); 936 push(@fieldInitializers, " : m_inspectorFrontendChannel(inspectorFrontendChannel)"); 937 push(@backendFooter, " InspectorFrontendChannel* m_inspectorFrontendChannel;"); 936 938 937 939 foreach my $domain (sort keys %backendDomains) { -
trunk/Source/WebCore/inspector/InspectorClient.h
r77617 r82810 1 1 /* 2 2 * Copyright (C) 2007 Apple Inc. All rights reserved. 3 * Copyright (C) 2011 Google Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 27 28 #define InspectorClient_h 28 29 30 #include "InspectorFrontendChannel.h" 29 31 #include <wtf/Forward.h> 30 32 … … 35 37 class Page; 36 38 37 class InspectorClient {39 class InspectorClient : public InspectorFrontendChannel { 38 40 public: 39 41 virtual ~InspectorClient() { } … … 45 47 virtual void highlight(Node*) = 0; 46 48 virtual void hideHighlight() = 0; 47 48 virtual bool sendMessageToFrontend(const String& message) = 0;49 49 50 50 // Navigation can cause some WebKit implementations to change the view / page / inspector controller instance. -
trunk/Source/WebCore/inspector/InspectorFrontendChannel.h
r82809 r82810 1 1 /* 2 * Copyright (C) 20 07 Apple Inc. All rights reserved.2 * Copyright (C) 2011 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #ifndef InspectorClient_h 27 #define InspectorClient_h 26 #ifndef InspectorFrontendChannel_h 27 #define InspectorFrontendChannel_h 28 29 #if ENABLE(INSPECTOR) 28 30 29 31 #include <wtf/Forward.h> … … 31 33 namespace WebCore { 32 34 33 class InspectorController; 34 class Node; 35 class Page; 36 37 class InspectorClient { 35 class InspectorFrontendChannel { 38 36 public: 39 virtual ~InspectorClient() { } 40 41 virtual void inspectorDestroyed() = 0; 42 43 virtual void openInspectorFrontend(InspectorController*) = 0; 44 45 virtual void highlight(Node*) = 0; 46 virtual void hideHighlight() = 0; 47 37 virtual ~InspectorFrontendChannel() { } 48 38 virtual bool sendMessageToFrontend(const String& message) = 0; 49 50 // Navigation can cause some WebKit implementations to change the view / page / inspector controller instance.51 // However, there are some inspector controller states that should survive navigation (such as tracking resources52 // or recording timeline). Following callbacks allow embedders to track these states.53 virtual void updateInspectorStateCookie(const String&) { };54 55 bool doDispatchMessageOnFrontendPage(Page* frontendPage, const String& message);56 39 }; 57 40 58 41 } // namespace WebCore 59 42 60 #endif // !defined(InspectorClient_h) 43 #endif // ENABLE(INSPECTOR) 44 45 #endif // !defined(InspectorFrontendChannel_h)
Note: See TracChangeset
for help on using the changeset viewer.