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

Side by Side Diff: Source/core/inspector/InspectorPageAgent.cpp

Issue 17030009: Inspector: wrapped inspector agent instances into factory-like wrappers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed comments Created 7 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 bool InspectorPageAgent::dataContent(const char* data, unsigned size, const Stri ng& textEncodingName, bool withBase64Encode, String* result) 234 bool InspectorPageAgent::dataContent(const char* data, unsigned size, const Stri ng& textEncodingName, bool withBase64Encode, String* result)
235 { 235 {
236 if (withBase64Encode) { 236 if (withBase64Encode) {
237 *result = base64Encode(data, size); 237 *result = base64Encode(data, size);
238 return true; 238 return true;
239 } 239 }
240 240
241 return decodeBuffer(data, size, textEncodingName, result); 241 return decodeBuffer(data, size, textEncodingName, result);
242 } 242 }
243 243
244 PassOwnPtr<InspectorPageAgent> InspectorPageAgent::create(InstrumentingAgents* i nstrumentingAgents, Page* page, InspectorCompositeState* state, InjectedScriptMa nager* injectedScriptManager, InspectorClient* client, InspectorOverlay* overlay ) 244 PassRefPtr<InspectorPageAgent> InspectorPageAgent::create(InstrumentingAgents* i nstrumentingAgents, InspectorState* state, Page* page, InjectedScriptManager* in jectedScriptManager, InspectorOverlay* overlay, InspectorClient* client)
245 { 245 {
246 return adoptPtr(new InspectorPageAgent(instrumentingAgents, page, state, inj ectedScriptManager, client, overlay)); 246 return adoptRef(new InspectorPageAgent(instrumentingAgents, state, page, inj ectedScriptManager, overlay, client));
247 } 247 }
248 248
249 // static 249 // static
250 void InspectorPageAgent::resourceContent(ErrorString* errorString, Frame* frame, const KURL& url, String* result, bool* base64Encoded) 250 void InspectorPageAgent::resourceContent(ErrorString* errorString, Frame* frame, const KURL& url, String* result, bool* base64Encoded)
251 { 251 {
252 DocumentLoader* loader = assertDocumentLoader(errorString, frame); 252 DocumentLoader* loader = assertDocumentLoader(errorString, frame);
253 if (!loader) 253 if (!loader)
254 return; 254 return;
255 if (!cachedResourceContent(cachedResource(frame, url), result, base64Encoded )) 255 if (!cachedResourceContent(cachedResource(frame, url), result, base64Encoded ))
256 *errorString = "No resource with given URL found"; 256 *errorString = "No resource with given URL found";
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 break; 308 break;
309 } 309 }
310 return InspectorPageAgent::OtherResource; 310 return InspectorPageAgent::OtherResource;
311 } 311 }
312 312
313 TypeBuilder::Page::ResourceType::Enum InspectorPageAgent::cachedResourceTypeJson (const CachedResource& cachedResource) 313 TypeBuilder::Page::ResourceType::Enum InspectorPageAgent::cachedResourceTypeJson (const CachedResource& cachedResource)
314 { 314 {
315 return resourceTypeJson(cachedResourceType(cachedResource)); 315 return resourceTypeJson(cachedResourceType(cachedResource));
316 } 316 }
317 317
318 InspectorPageAgent::InspectorPageAgent(InstrumentingAgents* instrumentingAgents, Page* page, InspectorCompositeState* inspectorState, InjectedScriptManager* inj ectedScriptManager, InspectorClient* client, InspectorOverlay* overlay) 318 InspectorPageAgent::InspectorPageAgent(InstrumentingAgents* instrumentingAgents, InspectorState* inspectorState, Page* page, InjectedScriptManager* injectedScri ptManager, InspectorOverlay* overlay, InspectorClient* client)
319 : InspectorBaseAgent<InspectorPageAgent>("Page", instrumentingAgents, inspec torState) 319 : InspectorBaseAgent(instrumentingAgents, inspectorState)
320 , m_page(page) 320 , m_page(page)
321 , m_injectedScriptManager(injectedScriptManager) 321 , m_injectedScriptManager(injectedScriptManager)
322 , m_client(client) 322 , m_client(client)
323 , m_frontend(0) 323 , m_frontend(0)
324 , m_overlay(overlay) 324 , m_overlay(overlay)
325 , m_lastScriptIdentifier(0) 325 , m_lastScriptIdentifier(0)
326 , m_enabled(false) 326 , m_enabled(false)
327 , m_isFirstLayoutAfterOnLoad(false) 327 , m_isFirstLayoutAfterOnLoad(false)
328 , m_geolocationOverridden(false) 328 , m_geolocationOverridden(false)
329 , m_ignoreScriptsEnabledNotification(false) 329 , m_ignoreScriptsEnabledNotification(false)
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after
1260 } 1260 }
1261 1261
1262 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, co nst bool* showGrid) 1262 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, co nst bool* showGrid)
1263 { 1263 {
1264 m_state->setBoolean(PageAgentState::showSizeOnResize, show); 1264 m_state->setBoolean(PageAgentState::showSizeOnResize, show);
1265 m_state->setBoolean(PageAgentState::showGridOnResize, showGrid && *showGrid) ; 1265 m_state->setBoolean(PageAgentState::showGridOnResize, showGrid && *showGrid) ;
1266 } 1266 }
1267 1267
1268 } // namespace WebCore 1268 } // namespace WebCore
1269 1269
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorPageAgent.h ('k') | Source/core/inspector/InspectorProfilerAgent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698