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

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

Issue 2629823002: Add CHECKs to make sure ThreadableLoader has not been created multiple times (Closed)
Patch Set: fix Created 3 years, 11 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 | « no previous file | third_party/WebKit/Source/core/loader/WorkerThreadableLoader.cpp » ('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) 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 options.preflightPolicy = ConsiderPreflight; 107 options.preflightPolicy = ConsiderPreflight;
108 options.crossOriginRequestPolicy = DenyCrossOriginRequests; 108 options.crossOriginRequestPolicy = DenyCrossOriginRequests;
109 // FIXME: Is there a directive to which this load should be subject? 109 // FIXME: Is there a directive to which this load should be subject?
110 options.contentSecurityPolicyEnforcement = DoNotEnforceContentSecurityPolicy; 110 options.contentSecurityPolicyEnforcement = DoNotEnforceContentSecurityPolicy;
111 // Use special initiator to hide the request from the inspector. 111 // Use special initiator to hide the request from the inspector.
112 options.initiator = FetchInitiatorTypeNames::internal; 112 options.initiator = FetchInitiatorTypeNames::internal;
113 113
114 ResourceLoaderOptions resourceLoaderOptions; 114 ResourceLoaderOptions resourceLoaderOptions;
115 resourceLoaderOptions.allowCredentials = AllowStoredCredentials; 115 resourceLoaderOptions.allowCredentials = AllowStoredCredentials;
116 116
117 // TODO(yhirano): Remove this CHECK once https://crbug.com/667254 is fixed.
118 CHECK(!m_loader);
117 if (m_client) { 119 if (m_client) {
118 DCHECK(!m_loader); 120 DCHECK(!m_loader);
119 m_loader = ThreadableLoader::create(*executionContext, this, options, 121 m_loader = ThreadableLoader::create(*executionContext, this, options,
120 resourceLoaderOptions); 122 resourceLoaderOptions);
121 m_loader->start(request); 123 m_loader->start(request);
122 } else { 124 } else {
123 ThreadableLoader::loadResourceSynchronously( 125 ThreadableLoader::loadResourceSynchronously(
124 *executionContext, request, *this, options, resourceLoaderOptions); 126 *executionContext, request, *this, options, resourceLoaderOptions);
125 } 127 }
126 } 128 }
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 384
383 m_stringResult = builder.toString(); 385 m_stringResult = builder.toString();
384 } 386 }
385 387
386 void FileReaderLoader::setEncoding(const String& encoding) { 388 void FileReaderLoader::setEncoding(const String& encoding) {
387 if (!encoding.isEmpty()) 389 if (!encoding.isEmpty())
388 m_encoding = WTF::TextEncoding(encoding); 390 m_encoding = WTF::TextEncoding(encoding);
389 } 391 }
390 392
391 } // namespace blink 393 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/WorkerThreadableLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698