OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. |
3 * Copyright (C) 2013, Intel Corporation | 3 * Copyright (C) 2013, Intel Corporation |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 { | 56 { |
57 // The loader will be deleted as soon as this function exits. | 57 // The loader will be deleted as soon as this function exits. |
58 RefPtr<DocumentThreadableLoader> loader = adoptRef(new DocumentThreadableLoa
der(document, &client, LoadSynchronously, request, options)); | 58 RefPtr<DocumentThreadableLoader> loader = adoptRef(new DocumentThreadableLoa
der(document, &client, LoadSynchronously, request, options)); |
59 ASSERT(loader->hasOneRef()); | 59 ASSERT(loader->hasOneRef()); |
60 } | 60 } |
61 | 61 |
62 PassRefPtr<DocumentThreadableLoader> DocumentThreadableLoader::create(Document*
document, ThreadableLoaderClient* client, const ResourceRequest& request, const
ThreadableLoaderOptions& options) | 62 PassRefPtr<DocumentThreadableLoader> DocumentThreadableLoader::create(Document*
document, ThreadableLoaderClient* client, const ResourceRequest& request, const
ThreadableLoaderOptions& options) |
63 { | 63 { |
64 RefPtr<DocumentThreadableLoader> loader = adoptRef(new DocumentThreadableLoa
der(document, client, LoadAsynchronously, request, options)); | 64 RefPtr<DocumentThreadableLoader> loader = adoptRef(new DocumentThreadableLoa
der(document, client, LoadAsynchronously, request, options)); |
65 if (!loader->resource()) | 65 if (!loader->resource()) |
66 loader = 0; | 66 loader = nullptr; |
67 return loader.release(); | 67 return loader.release(); |
68 } | 68 } |
69 | 69 |
70 DocumentThreadableLoader::DocumentThreadableLoader(Document* document, Threadabl
eLoaderClient* client, BlockingBehavior blockingBehavior, const ResourceRequest&
request, const ThreadableLoaderOptions& options) | 70 DocumentThreadableLoader::DocumentThreadableLoader(Document* document, Threadabl
eLoaderClient* client, BlockingBehavior blockingBehavior, const ResourceRequest&
request, const ThreadableLoaderOptions& options) |
71 : m_client(client) | 71 : m_client(client) |
72 , m_document(document) | 72 , m_document(document) |
73 , m_options(options) | 73 , m_options(options) |
74 , m_sameOriginRequest(securityOrigin()->canRequest(request.url())) | 74 , m_sameOriginRequest(securityOrigin()->canRequest(request.url())) |
75 , m_simpleRequest(true) | 75 , m_simpleRequest(true) |
76 , m_async(blockingBehavior == LoadAsynchronously) | 76 , m_async(blockingBehavior == LoadAsynchronously) |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 return true; | 455 return true; |
456 return m_document->contentSecurityPolicy()->allowConnectToSource(url); | 456 return m_document->contentSecurityPolicy()->allowConnectToSource(url); |
457 } | 457 } |
458 | 458 |
459 SecurityOrigin* DocumentThreadableLoader::securityOrigin() const | 459 SecurityOrigin* DocumentThreadableLoader::securityOrigin() const |
460 { | 460 { |
461 return m_options.securityOrigin ? m_options.securityOrigin.get() : m_documen
t->securityOrigin(); | 461 return m_options.securityOrigin ? m_options.securityOrigin.get() : m_documen
t->securityOrigin(); |
462 } | 462 } |
463 | 463 |
464 } // namespace WebCore | 464 } // namespace WebCore |
OLD | NEW |