Changeset 83613 in webkit


Ignore:
Timestamp:
Apr 12, 2011 11:19:09 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-04-12 Bill Budge <bbudge@chromium.org>

Reviewed by Darin Fisher.

Move the WebURLLoaderOptions struct into its own file and rename the CrossOriginRequestPolicy enum to conform to the WebKit coding standard.
https://bugs.webkit.org/show_bug.cgi?id=58287

No new tests. No new functionality exposed.

  • WebKit.gyp:
  • public/WebURLLoader.h:
  • public/WebURLLoaderOptions.h: Added. (WebKit::WebURLLoaderOptions::WebURLLoaderOptions):
  • src/AssociatedURLLoader.cpp: (WebKit::AssociatedURLLoader::AssociatedURLLoader):
  • src/AssociatedURLLoader.h:
Location:
trunk/Source/WebKit/chromium
Files:
5 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/chromium/ChangeLog

    r83578 r83613  
     12011-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
    1182011-04-11  Pavel Podivilov  <podivilov@chromium.org>
    219
  • trunk/Source/WebKit/chromium/WebKit.gyp

    r83578 r83613  
    282282                'public/WebURLError.h',
    283283                'public/WebURLLoader.h',
     284                'public/WebURLLoaderOptions.h',
    284285                'public/WebURLLoadTiming.h',
    285286                'public/WebURLLoaderClient.h',
  • trunk/Source/WebKit/chromium/public/WebURLLoader.h

    r81303 r83613  
    4242struct WebURLError;
    4343
    44 enum WebCrossOriginRequestPolicy {
    45     DenyCrossOriginRequests,
    46     UseAccessControl,
    47     AllowCrossOriginRequests
    48 };
    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 
    5944class WebURLLoader {
    6045public:
  • trunk/Source/WebKit/chromium/public/WebURLLoaderOptions.h

    r83612 r83613  
    11/*
    2  * Copyright (C) 2010, 2011 Google Inc. All rights reserved.
     2 * Copyright (C) 2009, 2011 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2929 */
    3030
    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
    4033
    4134namespace WebKit {
    4235
    43 class WebFrameImpl;
     36struct WebURLLoaderOptions {
    4437
    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    };
    5243
    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) { }
    5845
    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;
    6850};
    6951
  • trunk/Source/WebKit/chromium/src/AssociatedURLLoader.cpp

    r83167 r83613  
    169169    m_options.allowCredentials = true;
    170170    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.
    172172}
    173173
     
    189189    COMPILE_ASSERT(static_cast<int>(WebKit::webkit_name) == static_cast<int>(WebCore::webcore_name), mismatching_enums)
    190190
    191 COMPILE_ASSERT_MATCHING_ENUM(DenyCrossOriginRequests, DenyCrossOriginRequests);
    192 COMPILE_ASSERT_MATCHING_ENUM(UseAccessControl, UseAccessControl);
    193 COMPILE_ASSERT_MATCHING_ENUM(AllowCrossOriginRequests, AllowCrossOriginRequests);
     191COMPILE_ASSERT_MATCHING_ENUM(WebURLLoaderOptions::CrossOriginRequestPolicyDeny, DenyCrossOriginRequests);
     192COMPILE_ASSERT_MATCHING_ENUM(WebURLLoaderOptions::CrossOriginRequestPolicyUseAccessControl, UseAccessControl);
     193COMPILE_ASSERT_MATCHING_ENUM(WebURLLoaderOptions::CrossOriginRequestPolicyAllow, AllowCrossOriginRequests);
    194194
    195195void AssociatedURLLoader::loadSynchronously(const WebURLRequest& request, WebURLResponse& response, WebURLError& error, WebData& data)
  • trunk/Source/WebKit/chromium/src/AssociatedURLLoader.h

    r81303 r83613  
    3333
    3434#include "WebURLLoader.h"
     35#include "WebURLLoaderOptions.h"
    3536#include <wtf/Noncopyable.h>
    3637#include <wtf/OwnPtr.h>
Note: See TracChangeset for help on using the changeset viewer.