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

Side by Side Diff: third_party/WebKit/Source/core/fileapi/FileReaderLoader.cpp

Issue 1264453002: Split the constructor of ThreadableLoader into two methods (ctor and start()) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed pipes around non-variables in a comment Created 4 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 options.preflightPolicy = ConsiderPreflight; 110 options.preflightPolicy = ConsiderPreflight;
111 options.crossOriginRequestPolicy = DenyCrossOriginRequests; 111 options.crossOriginRequestPolicy = DenyCrossOriginRequests;
112 // FIXME: Is there a directive to which this load should be subject? 112 // FIXME: Is there a directive to which this load should be subject?
113 options.contentSecurityPolicyEnforcement = DoNotEnforceContentSecurityPolicy ; 113 options.contentSecurityPolicyEnforcement = DoNotEnforceContentSecurityPolicy ;
114 // Use special initiator to hide the request from the inspector. 114 // Use special initiator to hide the request from the inspector.
115 options.initiator = FetchInitiatorTypeNames::internal; 115 options.initiator = FetchInitiatorTypeNames::internal;
116 116
117 ResourceLoaderOptions resourceLoaderOptions; 117 ResourceLoaderOptions resourceLoaderOptions;
118 resourceLoaderOptions.allowCredentials = AllowStoredCredentials; 118 resourceLoaderOptions.allowCredentials = AllowStoredCredentials;
119 119
120 if (m_client) 120 if (m_client) {
121 m_loader = ThreadableLoader::create(executionContext, this, request, opt ions, resourceLoaderOptions); 121 m_loader = ThreadableLoader::create(executionContext, this, options, res ourceLoaderOptions);
122 else 122 m_loader->start(request);
123 } else {
123 ThreadableLoader::loadResourceSynchronously(executionContext, request, * this, options, resourceLoaderOptions); 124 ThreadableLoader::loadResourceSynchronously(executionContext, request, * this, options, resourceLoaderOptions);
125 }
124 } 126 }
125 127
126 void FileReaderLoader::start(ExecutionContext* executionContext, PassRefPtr<Blob DataHandle> blobData) 128 void FileReaderLoader::start(ExecutionContext* executionContext, PassRefPtr<Blob DataHandle> blobData)
127 { 129 {
128 ASSERT(executionContext); 130 ASSERT(executionContext);
129 m_urlForReadingIsStream = false; 131 m_urlForReadingIsStream = false;
130 startInternal(*executionContext, 0, blobData); 132 startInternal(*executionContext, 0, blobData);
131 } 133 }
132 134
133 void FileReaderLoader::start(ExecutionContext* executionContext, const Stream& s tream, unsigned readSize) 135 void FileReaderLoader::start(ExecutionContext* executionContext, const Stream& s tream, unsigned readSize)
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 m_stringResult = builder.toString(); 401 m_stringResult = builder.toString();
400 } 402 }
401 403
402 void FileReaderLoader::setEncoding(const String& encoding) 404 void FileReaderLoader::setEncoding(const String& encoding)
403 { 405 {
404 if (!encoding.isEmpty()) 406 if (!encoding.isEmpty())
405 m_encoding = WTF::TextEncoding(encoding); 407 m_encoding = WTF::TextEncoding(encoding);
406 } 408 }
407 409
408 } // namespace blink 410 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698