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

Side by Side Diff: Source/WebCore/loader/ThreadableLoader.h

Issue 7019016: Merge 86290 - 2011-05-11 Antoine Labour <piman@chromium.org> (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/742/
Patch Set: Created 9 years, 7 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
« no previous file with comments | « Source/WebCore/loader/SubresourceLoader.cpp ('k') | Source/WebKit/chromium/ChangeLog » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 DoNotAllowStoredCredentials 48 DoNotAllowStoredCredentials
49 }; 49 };
50 50
51 enum CrossOriginRequestPolicy { 51 enum CrossOriginRequestPolicy {
52 DenyCrossOriginRequests, 52 DenyCrossOriginRequests,
53 UseAccessControl, 53 UseAccessControl,
54 AllowCrossOriginRequests 54 AllowCrossOriginRequests
55 }; 55 };
56 56
57 struct ThreadableLoaderOptions { 57 struct ThreadableLoaderOptions {
58 ThreadableLoaderOptions() : sendLoadCallbacks(false), sniffContent(false ), allowCredentials(false), forcePreflight(false), crossOriginRequestPolicy(Deny CrossOriginRequests) { } 58 ThreadableLoaderOptions() : sendLoadCallbacks(false), sniffContent(false ), allowCredentials(false), forcePreflight(false), crossOriginRequestPolicy(Deny CrossOriginRequests), shouldBufferData(true) { }
59 bool sendLoadCallbacks; 59 bool sendLoadCallbacks;
60 bool sniffContent; 60 bool sniffContent;
61 bool allowCredentials; // Whether HTTP credentials and cookies are sent with the request. 61 bool allowCredentials; // Whether HTTP credentials and cookies are sent with the request.
62 bool forcePreflight; // If AccessControl is used, whether to force a pr eflight. 62 bool forcePreflight; // If AccessControl is used, whether to force a pr eflight.
63 CrossOriginRequestPolicy crossOriginRequestPolicy; 63 CrossOriginRequestPolicy crossOriginRequestPolicy;
64 bool shouldBufferData;
64 }; 65 };
65 66
66 // Useful for doing loader operations from any thread (not threadsafe, 67 // Useful for doing loader operations from any thread (not threadsafe,
67 // just able to run on threads other than the main thread). 68 // just able to run on threads other than the main thread).
68 class ThreadableLoader { 69 class ThreadableLoader {
69 WTF_MAKE_NONCOPYABLE(ThreadableLoader); 70 WTF_MAKE_NONCOPYABLE(ThreadableLoader);
70 public: 71 public:
71 static void loadResourceSynchronously(ScriptExecutionContext*, const Res ourceRequest&, ThreadableLoaderClient&, const ThreadableLoaderOptions&); 72 static void loadResourceSynchronously(ScriptExecutionContext*, const Res ourceRequest&, ThreadableLoaderClient&, const ThreadableLoaderOptions&);
72 static PassRefPtr<ThreadableLoader> create(ScriptExecutionContext*, Thre adableLoaderClient*, const ResourceRequest&, const ThreadableLoaderOptions&); 73 static PassRefPtr<ThreadableLoader> create(ScriptExecutionContext*, Thre adableLoaderClient*, const ResourceRequest&, const ThreadableLoaderOptions&);
73 74
74 virtual void cancel() = 0; 75 virtual void cancel() = 0;
75 void ref() { refThreadableLoader(); } 76 void ref() { refThreadableLoader(); }
76 void deref() { derefThreadableLoader(); } 77 void deref() { derefThreadableLoader(); }
77 78
78 protected: 79 protected:
79 ThreadableLoader() { } 80 ThreadableLoader() { }
80 virtual ~ThreadableLoader() { } 81 virtual ~ThreadableLoader() { }
81 virtual void refThreadableLoader() = 0; 82 virtual void refThreadableLoader() = 0;
82 virtual void derefThreadableLoader() = 0; 83 virtual void derefThreadableLoader() = 0;
83 }; 84 };
84 85
85 } // namespace WebCore 86 } // namespace WebCore
86 87
87 #endif // ThreadableLoader_h 88 #endif // ThreadableLoader_h
OLDNEW
« no previous file with comments | « Source/WebCore/loader/SubresourceLoader.cpp ('k') | Source/WebKit/chromium/ChangeLog » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698