Changeset 83613 in webkit
- Timestamp:
- Apr 12, 2011 11:19:09 AM (13 years ago)
- Location:
- trunk/Source/WebKit/chromium
- Files:
-
- 5 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/chromium/ChangeLog
r83578 r83613 1 2011-04-12 Bill Budge <bbudge@chromium.org> 2 3 Reviewed by Darin Fisher. 4 5 Move the WebURLLoaderOptions struct into its own file and rename the CrossOriginRequestPolicy enum to conform to the WebKit coding standard. 6 https://bugs.webkit.org/show_bug.cgi?id=58287 7 8 No new tests. No new functionality exposed. 9 10 * WebKit.gyp: 11 * public/WebURLLoader.h: 12 * public/WebURLLoaderOptions.h: Added. 13 (WebKit::WebURLLoaderOptions::WebURLLoaderOptions): 14 * src/AssociatedURLLoader.cpp: 15 (WebKit::AssociatedURLLoader::AssociatedURLLoader): 16 * src/AssociatedURLLoader.h: 17 1 18 2011-04-11 Pavel Podivilov <podivilov@chromium.org> 2 19 -
trunk/Source/WebKit/chromium/WebKit.gyp
r83578 r83613 282 282 'public/WebURLError.h', 283 283 'public/WebURLLoader.h', 284 'public/WebURLLoaderOptions.h', 284 285 'public/WebURLLoadTiming.h', 285 286 'public/WebURLLoaderClient.h', -
trunk/Source/WebKit/chromium/public/WebURLLoader.h
r81303 r83613 42 42 struct WebURLError; 43 43 44 enum WebCrossOriginRequestPolicy {45 DenyCrossOriginRequests,46 UseAccessControl,47 AllowCrossOriginRequests48 };49 50 struct WebURLLoaderOptions {51 WebURLLoaderOptions() : sniffContent(false), allowCredentials(false), forcePreflight(false), crossOriginRequestPolicy(DenyCrossOriginRequests) { }52 53 bool sniffContent; // Whether to sniff content.54 bool allowCredentials; // Whether to send HTTP credentials and cookies with the request.55 bool forcePreflight; // If AccessControl is used, whether to force a preflight.56 WebCrossOriginRequestPolicy crossOriginRequestPolicy;57 };58 59 44 class WebURLLoader { 60 45 public: -
trunk/Source/WebKit/chromium/public/WebURLLoaderOptions.h
r83612 r83613 1 1 /* 2 * Copyright (C) 20 10, 2011 Google Inc. All rights reserved.2 * Copyright (C) 2009, 2011 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 29 29 */ 30 30 31 #ifndef AssociatedURLLoader_h 32 #define AssociatedURLLoader_h 33 34 #include "WebURLLoader.h" 35 #include <wtf/Noncopyable.h> 36 #include <wtf/OwnPtr.h> 37 #include <wtf/RefPtr.h> 38 39 namespace WebCore { class DocumentThreadableLoader; } 31 #ifndef WebURLLoaderOptions_h 32 #define WebURLLoaderOptions_h 40 33 41 34 namespace WebKit { 42 35 43 class WebFrameImpl; 36 struct WebURLLoaderOptions { 44 37 45 // This class is used to implement WebFrame::createAssociatedURLLoader. 46 class AssociatedURLLoader : public WebURLLoader { 47 WTF_MAKE_NONCOPYABLE(AssociatedURLLoader); 48 public: 49 AssociatedURLLoader(PassRefPtr<WebFrameImpl>); 50 AssociatedURLLoader(PassRefPtr<WebFrameImpl>, const WebURLLoaderOptions&); 51 ~AssociatedURLLoader(); 38 enum CrossOriginRequestPolicy { 39 CrossOriginRequestPolicyDeny, 40 CrossOriginRequestPolicyUseAccessControl, 41 CrossOriginRequestPolicyAllow 42 }; 52 43 53 // WebURLLoader methods: 54 virtual void loadSynchronously(const WebURLRequest&, WebURLResponse&, WebURLError&, WebData&); 55 virtual void loadAsynchronously(const WebURLRequest&, WebURLLoaderClient*); 56 virtual void cancel(); 57 virtual void setDefersLoading(bool); 44 WebURLLoaderOptions() : sniffContent(false), allowCredentials(false), forcePreflight(false), crossOriginRequestPolicy(CrossOriginRequestPolicyAllow) { } 58 45 59 private: 60 61 class ClientAdapter; 62 63 RefPtr<WebFrameImpl> m_frameImpl; 64 WebURLLoaderOptions m_options; 65 WebURLLoaderClient* m_client; 66 OwnPtr<ClientAdapter> m_clientAdapter; 67 RefPtr<WebCore::DocumentThreadableLoader> m_loader; 46 bool sniffContent; // Whether to sniff content. 47 bool allowCredentials; // Whether to send HTTP credentials and cookies with the request. 48 bool forcePreflight; // If policy is to use access control, whether to force a preflight. 49 CrossOriginRequestPolicy crossOriginRequestPolicy; 68 50 }; 69 51 -
trunk/Source/WebKit/chromium/src/AssociatedURLLoader.cpp
r83167 r83613 169 169 m_options.allowCredentials = true; 170 170 m_options.forcePreflight = false; 171 m_options.crossOriginRequestPolicy = AllowCrossOriginRequests; // TODO(bbudge) Default should be DenyCrossOriginRequests, but this would break some tests.171 m_options.crossOriginRequestPolicy = WebURLLoaderOptions::CrossOriginRequestPolicyAllow; // FIXME We should deny by default, but this would break some tests. 172 172 } 173 173 … … 189 189 COMPILE_ASSERT(static_cast<int>(WebKit::webkit_name) == static_cast<int>(WebCore::webcore_name), mismatching_enums) 190 190 191 COMPILE_ASSERT_MATCHING_ENUM( DenyCrossOriginRequests, DenyCrossOriginRequests);192 COMPILE_ASSERT_MATCHING_ENUM( UseAccessControl, UseAccessControl);193 COMPILE_ASSERT_MATCHING_ENUM( AllowCrossOriginRequests, AllowCrossOriginRequests);191 COMPILE_ASSERT_MATCHING_ENUM(WebURLLoaderOptions::CrossOriginRequestPolicyDeny, DenyCrossOriginRequests); 192 COMPILE_ASSERT_MATCHING_ENUM(WebURLLoaderOptions::CrossOriginRequestPolicyUseAccessControl, UseAccessControl); 193 COMPILE_ASSERT_MATCHING_ENUM(WebURLLoaderOptions::CrossOriginRequestPolicyAllow, AllowCrossOriginRequests); 194 194 195 195 void AssociatedURLLoader::loadSynchronously(const WebURLRequest& request, WebURLResponse& response, WebURLError& error, WebData& data) -
trunk/Source/WebKit/chromium/src/AssociatedURLLoader.h
r81303 r83613 33 33 34 34 #include "WebURLLoader.h" 35 #include "WebURLLoaderOptions.h" 35 36 #include <wtf/Noncopyable.h> 36 37 #include <wtf/OwnPtr.h>
Note: See TracChangeset
for help on using the changeset viewer.