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

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

Issue 24009002: Move synchronously fetching to ResourceFetcher, as well as most of the logic (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 14 matching lines...) Expand all
25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */ 28 */
29 29
30 #include "config.h" 30 #include "config.h"
31 #include "core/inspector/InspectorFrontendHost.h" 31 #include "core/inspector/InspectorFrontendHost.h"
32 32
33 #include "bindings/v8/ScriptFunctionCall.h" 33 #include "bindings/v8/ScriptFunctionCall.h"
34 #include "core/dom/UserGestureIndicator.h" 34 #include "core/dom/UserGestureIndicator.h"
35 #include "core/fetch/ResourceFetcher.h"
35 #include "core/fetch/TextResourceDecoder.h" 36 #include "core/fetch/TextResourceDecoder.h"
36 #include "core/inspector/InspectorController.h" 37 #include "core/inspector/InspectorController.h"
37 #include "core/inspector/InspectorFrontendClient.h" 38 #include "core/inspector/InspectorFrontendClient.h"
38 #include "core/loader/FrameLoader.h" 39 #include "core/loader/FrameLoader.h"
39 #include "core/page/ContextMenuController.h" 40 #include "core/page/ContextMenuController.h"
40 #include "core/page/ContextMenuProvider.h" 41 #include "core/page/ContextMenuProvider.h"
41 #include "core/page/Frame.h" 42 #include "core/page/Frame.h"
42 #include "core/page/Page.h" 43 #include "core/page/Page.h"
43 #include "core/platform/ContextMenu.h" 44 #include "core/platform/ContextMenu.h"
44 #include "core/platform/ContextMenuItem.h" 45 #include "core/platform/ContextMenuItem.h"
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 } 262 }
262 263
263 String InspectorFrontendHost::loadResourceSynchronously(const String& url) 264 String InspectorFrontendHost::loadResourceSynchronously(const String& url)
264 { 265 {
265 ResourceRequest request(url); 266 ResourceRequest request(url);
266 request.setHTTPMethod("GET"); 267 request.setHTTPMethod("GET");
267 268
268 Vector<char> data; 269 Vector<char> data;
269 ResourceError error; 270 ResourceError error;
270 ResourceResponse response; 271 ResourceResponse response;
271 m_frontendPage->mainFrame()->loader()->loadResourceSynchronously(request, Do NotAllowStoredCredentials, error, response, data); 272 m_frontendPage->mainFrame()->document()->fetcher()->fetchSynchronously(reque st, DoNotAllowStoredCredentials, error, response, data);
272 WTF::TextEncoding textEncoding(response.textEncodingName()); 273 WTF::TextEncoding textEncoding(response.textEncodingName());
273 bool useDetector = false; 274 bool useDetector = false;
274 if (!textEncoding.isValid()) { 275 if (!textEncoding.isValid()) {
275 textEncoding = UTF8Encoding(); 276 textEncoding = UTF8Encoding();
276 useDetector = true; 277 useDetector = true;
277 } 278 }
278 RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("text/plai n", textEncoding, useDetector); 279 RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("text/plai n", textEncoding, useDetector);
279 return decoder->decode(data.data(), data.size()) + decoder->flush(); 280 return decoder->decode(data.data(), data.size()) + decoder->flush();
280 } 281 }
281 282
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 { 353 {
353 return false; 354 return false;
354 } 355 }
355 356
356 String InspectorFrontendHost::hiddenPanels() 357 String InspectorFrontendHost::hiddenPanels()
357 { 358 {
358 return ""; 359 return "";
359 } 360 }
360 361
361 } // namespace WebCore 362 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698