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

Side by Side Diff: webkit/glue/webframe_impl.cc

Issue 149172: Modify ResourceFetcher to use WebURLLoader instead of ResourceHandle.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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) 2006 Samuel Weinig (sam.weinig@gmail.com) 2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
3 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. 3 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
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 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 using WebCore::HTMLFormElement; 188 using WebCore::HTMLFormElement;
189 using WebCore::IntRect; 189 using WebCore::IntRect;
190 using WebCore::KURL; 190 using WebCore::KURL;
191 using WebCore::Node; 191 using WebCore::Node;
192 using WebCore::Range; 192 using WebCore::Range;
193 using WebCore::ReloadIgnoringCacheData; 193 using WebCore::ReloadIgnoringCacheData;
194 using WebCore::RenderObject; 194 using WebCore::RenderObject;
195 using WebCore::ResourceError; 195 using WebCore::ResourceError;
196 using WebCore::ResourceHandle; 196 using WebCore::ResourceHandle;
197 using WebCore::ResourceRequest; 197 using WebCore::ResourceRequest;
198 using WebCore::ResourceResponse;
198 using WebCore::VisibleSelection; 199 using WebCore::VisibleSelection;
199 using WebCore::ScriptValue; 200 using WebCore::ScriptValue;
200 using WebCore::SecurityOrigin; 201 using WebCore::SecurityOrigin;
201 using WebCore::SharedBuffer; 202 using WebCore::SharedBuffer;
202 using WebCore::String; 203 using WebCore::String;
203 using WebCore::SubstituteData; 204 using WebCore::SubstituteData;
204 using WebCore::TextIterator; 205 using WebCore::TextIterator;
205 using WebCore::VisiblePosition; 206 using WebCore::VisiblePosition;
206 using WebCore::XPathResult; 207 using WebCore::XPathResult;
207 208
208 using WebKit::WebCanvas; 209 using WebKit::WebCanvas;
209 using WebKit::WebConsoleMessage; 210 using WebKit::WebConsoleMessage;
210 using WebKit::WebData; 211 using WebKit::WebData;
211 using WebKit::WebDataSource; 212 using WebKit::WebDataSource;
212 using WebKit::WebFindOptions; 213 using WebKit::WebFindOptions;
213 using WebKit::WebHistoryItem; 214 using WebKit::WebHistoryItem;
214 using WebKit::WebForm; 215 using WebKit::WebForm;
215 using WebKit::WebRect; 216 using WebKit::WebRect;
216 using WebKit::WebScriptSource; 217 using WebKit::WebScriptSource;
217 using WebKit::WebSize; 218 using WebKit::WebSize;
218 using WebKit::WebString; 219 using WebKit::WebString;
219 using WebKit::WebURL; 220 using WebKit::WebURL;
220 using WebKit::WebURLError; 221 using WebKit::WebURLError;
221 using WebKit::WebURLRequest; 222 using WebKit::WebURLRequest;
222 using WebKit::WebURLResponse; 223 using WebKit::WebURLResponse;
223 224
225 using webkit_glue::AltErrorPageResourceFetcher;
226
224 // Key for a StatsCounter tracking how many WebFrames are active. 227 // Key for a StatsCounter tracking how many WebFrames are active.
225 static const char* const kWebFrameActiveCount = "WebFrameActiveCount"; 228 static const char* const kWebFrameActiveCount = "WebFrameActiveCount";
226 229
227 static const char* const kOSDType = "application/opensearchdescription+xml"; 230 static const char* const kOSDType = "application/opensearchdescription+xml";
228 static const char* const kOSDRel = "search"; 231 static const char* const kOSDRel = "search";
229 232
230 // The separator between frames when the frames are converted to plain text. 233 // The separator between frames when the frames are converted to plain text.
231 static const wchar_t kFrameSeparator[] = L"\n\n"; 234 static const wchar_t kFrameSeparator[] = L"\n\n";
232 static const int kFrameSeparatorLen = arraysize(kFrameSeparator) - 1; 235 static const int kFrameSeparatorLen = arraysize(kFrameSeparator) - 1;
233 236
(...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after
1559 // Load alternate HTML in place of the previous request. We use a fake_url 1562 // Load alternate HTML in place of the previous request. We use a fake_url
1560 // for the Base URL. That prevents other web content from the same origin 1563 // for the Base URL. That prevents other web content from the same origin
1561 // as the failed URL to script the error page. 1564 // as the failed URL to script the error page.
1562 1565
1563 LoadHTMLString("", // Empty document 1566 LoadHTMLString("", // Empty document
1564 fake_url, 1567 fake_url,
1565 error.unreachableURL, 1568 error.unreachableURL,
1566 replace); 1569 replace);
1567 1570
1568 alt_error_page_fetcher_.reset(new AltErrorPageResourceFetcher( 1571 alt_error_page_fetcher_.reset(new AltErrorPageResourceFetcher(
1569 GetWebViewImpl(), error, this, error_page_url)); 1572 GetWebViewImpl(), this, error, error_page_url));
1573 }
1574
1575 void WebFrameImpl::DispatchWillSendRequest(WebURLRequest* request) {
1576 ResourceResponse response;
1577 frame_->loader()->client()->dispatchWillSendRequest(NULL, 0,
1578 *webkit_glue::WebURLRequestToMutableResourceRequest(request),
1579 response);
1570 } 1580 }
1571 1581
1572 void WebFrameImpl::ExecuteScript(const WebScriptSource& source) { 1582 void WebFrameImpl::ExecuteScript(const WebScriptSource& source) {
1573 frame_->loader()->executeScript( 1583 frame_->loader()->executeScript(
1574 WebCore::ScriptSourceCode( 1584 WebCore::ScriptSourceCode(
1575 webkit_glue::WebStringToString(source.code), 1585 webkit_glue::WebStringToString(source.code),
1576 webkit_glue::WebURLToKURL(source.url), 1586 webkit_glue::WebURLToKURL(source.url),
1577 source.startLine)); 1587 source.startLine));
1578 } 1588 }
1579 1589
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
1820 1830
1821 SecurityOrigin* security_origin = frame_->document()->securityOrigin(); 1831 SecurityOrigin* security_origin = frame_->document()->securityOrigin();
1822 1832
1823 if (!frame_->loader()->isScheduledLocationChangePending()) { 1833 if (!frame_->loader()->isScheduledLocationChangePending()) {
1824 frame_->loader()->stopAllLoaders(); 1834 frame_->loader()->stopAllLoaders();
1825 frame_->loader()->begin(frame_->loader()->url(), true, security_origin); 1835 frame_->loader()->begin(frame_->loader()->url(), true, security_origin);
1826 frame_->loader()->write(script_result); 1836 frame_->loader()->write(script_result);
1827 frame_->loader()->end(); 1837 frame_->loader()->end();
1828 } 1838 }
1829 } 1839 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698