Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2010, 2011, 2012 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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 298 AssociatedURLLoader* m_parent; | 298 AssociatedURLLoader* m_parent; |
| 299 }; | 299 }; |
| 300 | 300 |
| 301 AssociatedURLLoader::AssociatedURLLoader(WebLocalFrameImpl* frameImpl, const Web URLLoaderOptions& options) | 301 AssociatedURLLoader::AssociatedURLLoader(WebLocalFrameImpl* frameImpl, const Web URLLoaderOptions& options) |
| 302 : m_client(nullptr) | 302 : m_client(nullptr) |
| 303 , m_options(options) | 303 , m_options(options) |
| 304 , m_observer(new Observer(this, frameImpl->frame()->document())) | 304 , m_observer(new Observer(this, frameImpl->frame()->document())) |
| 305 { | 305 { |
| 306 } | 306 } |
| 307 | 307 |
| 308 AssociatedURLLoader::~AssociatedURLLoader() | 308 AssociatedURLLoader::~AssociatedURLLoader() |
|
haraken
2016/07/29 14:52:51
Is it guaranteed that AssociatedURLLoader's destru
yhirano
2016/08/01 06:20:06
As talked offline, this is not a problem because |
| |
| 309 { | 309 { |
| 310 cancel(); | 310 cancel(); |
| 311 } | 311 } |
| 312 | 312 |
| 313 #define STATIC_ASSERT_ENUM(a, b) \ | 313 #define STATIC_ASSERT_ENUM(a, b) \ |
| 314 static_assert(static_cast<int>(a) == static_cast<int>(b), \ | 314 static_assert(static_cast<int>(a) == static_cast<int>(b), \ |
| 315 "mismatching enum: " #a) | 315 "mismatching enum: " #a) |
| 316 | 316 |
| 317 STATIC_ASSERT_ENUM(WebURLLoaderOptions::CrossOriginRequestPolicyDeny, DenyCrossO riginRequests); | 317 STATIC_ASSERT_ENUM(WebURLLoaderOptions::CrossOriginRequestPolicyDeny, DenyCrossO riginRequests); |
| 318 STATIC_ASSERT_ENUM(WebURLLoaderOptions::CrossOriginRequestPolicyUseAccessControl , UseAccessControl); | 318 STATIC_ASSERT_ENUM(WebURLLoaderOptions::CrossOriginRequestPolicyUseAccessControl , UseAccessControl); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 397 void AssociatedURLLoader::cancelLoader() | 397 void AssociatedURLLoader::cancelLoader() |
| 398 { | 398 { |
| 399 if (!m_clientAdapter) | 399 if (!m_clientAdapter) |
| 400 return; | 400 return; |
| 401 | 401 |
| 402 // Prevent invocation of the WebURLLoaderClient methods. | 402 // Prevent invocation of the WebURLLoaderClient methods. |
| 403 m_clientAdapter->releaseClient(); | 403 m_clientAdapter->releaseClient(); |
| 404 | 404 |
| 405 if (m_loader) { | 405 if (m_loader) { |
| 406 m_loader->cancel(); | 406 m_loader->cancel(); |
| 407 m_loader.reset(); | 407 m_loader = nullptr; |
| 408 } | 408 } |
| 409 m_clientAdapter.reset(); | 409 m_clientAdapter.reset(); |
| 410 } | 410 } |
| 411 | 411 |
| 412 void AssociatedURLLoader::setDefersLoading(bool defersLoading) | 412 void AssociatedURLLoader::setDefersLoading(bool defersLoading) |
| 413 { | 413 { |
| 414 if (m_loader) | 414 if (m_loader) |
| 415 m_loader->setDefersLoading(defersLoading); | 415 m_loader->setDefersLoading(defersLoading); |
| 416 } | 416 } |
| 417 | 417 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 452 // there could be a WebURLLoader instance behind the | 452 // there could be a WebURLLoader instance behind the |
| 453 // DocumentThreadableLoader instance. So, for safety, we chose to just | 453 // DocumentThreadableLoader instance. So, for safety, we chose to just |
| 454 // crash here. | 454 // crash here. |
| 455 RELEASE_ASSERT(ThreadState::current()); | 455 RELEASE_ASSERT(ThreadState::current()); |
| 456 | 456 |
| 457 m_observer->dispose(); | 457 m_observer->dispose(); |
| 458 m_observer = nullptr; | 458 m_observer = nullptr; |
| 459 } | 459 } |
| 460 | 460 |
| 461 } // namespace blink | 461 } // namespace blink |
| OLD | NEW |