| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 #include "content/public/common/resource_type.h" | 55 #include "content/public/common/resource_type.h" |
| 56 #include "content/public/common/security_style.h" | 56 #include "content/public/common/security_style.h" |
| 57 #include "content/public/common/ssl_status.h" | 57 #include "content/public/common/ssl_status.h" |
| 58 #include "content/public/common/web_preferences.h" | 58 #include "content/public/common/web_preferences.h" |
| 59 #include "content/public/test/browser_test_utils.h" | 59 #include "content/public/test/browser_test_utils.h" |
| 60 #include "content/public/test/content_browser_test.h" | 60 #include "content/public/test/content_browser_test.h" |
| 61 #include "content/public/test/content_browser_test_utils.h" | 61 #include "content/public/test/content_browser_test_utils.h" |
| 62 #include "content/shell/browser/shell.h" | 62 #include "content/shell/browser/shell.h" |
| 63 #include "content/shell/browser/shell_content_browser_client.h" | 63 #include "content/shell/browser/shell_content_browser_client.h" |
| 64 #include "content/test/test_content_browser_client.h" | 64 #include "content/test/test_content_browser_client.h" |
| 65 #include "net/log/net_log.h" |
| 65 #include "net/test/embedded_test_server/embedded_test_server.h" | 66 #include "net/test/embedded_test_server/embedded_test_server.h" |
| 66 #include "net/test/embedded_test_server/http_request.h" | 67 #include "net/test/embedded_test_server/http_request.h" |
| 67 #include "net/test/embedded_test_server/http_response.h" | 68 #include "net/test/embedded_test_server/http_response.h" |
| 68 #include "net/url_request/url_request_filter.h" | 69 #include "net/url_request/url_request_filter.h" |
| 69 #include "net/url_request/url_request_interceptor.h" | 70 #include "net/url_request/url_request_interceptor.h" |
| 70 #include "net/url_request/url_request_test_job.h" | 71 #include "net/url_request/url_request_test_job.h" |
| 71 #include "storage/browser/blob/blob_data_handle.h" | 72 #include "storage/browser/blob/blob_data_handle.h" |
| 72 #include "storage/browser/blob/blob_data_snapshot.h" | 73 #include "storage/browser/blob/blob_data_snapshot.h" |
| 73 #include "storage/browser/blob/blob_reader.h" | 74 #include "storage/browser/blob/blob_reader.h" |
| 74 #include "storage/browser/blob/blob_storage_context.h" | 75 #include "storage/browser/blob/blob_storage_context.h" |
| (...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 bool* prepare_result, | 714 bool* prepare_result, |
| 714 FetchResult* result) { | 715 FetchResult* result) { |
| 715 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 716 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 716 std::unique_ptr<ServiceWorkerFetchRequest> request( | 717 std::unique_ptr<ServiceWorkerFetchRequest> request( |
| 717 new ServiceWorkerFetchRequest( | 718 new ServiceWorkerFetchRequest( |
| 718 embedded_test_server()->GetURL("/service_worker/empty.html"), "GET", | 719 embedded_test_server()->GetURL("/service_worker/empty.html"), "GET", |
| 719 ServiceWorkerHeaderMap(), Referrer(), false)); | 720 ServiceWorkerHeaderMap(), Referrer(), false)); |
| 720 version_->SetStatus(ServiceWorkerVersion::ACTIVATED); | 721 version_->SetStatus(ServiceWorkerVersion::ACTIVATED); |
| 721 fetch_dispatcher_.reset(new ServiceWorkerFetchDispatcher( | 722 fetch_dispatcher_.reset(new ServiceWorkerFetchDispatcher( |
| 722 std::move(request), version_.get(), RESOURCE_TYPE_MAIN_FRAME, | 723 std::move(request), version_.get(), RESOURCE_TYPE_MAIN_FRAME, |
| 723 CreatePrepareReceiver(prepare_result), | 724 net::BoundNetLog(), CreatePrepareReceiver(prepare_result), |
| 724 CreateResponseReceiver(done, blob_context_.get(), result))); | 725 CreateResponseReceiver(done, blob_context_.get(), result))); |
| 725 fetch_dispatcher_->Run(); | 726 fetch_dispatcher_->Run(); |
| 726 } | 727 } |
| 727 | 728 |
| 728 // Contrary to the style guide, the output parameter of this function comes | 729 // Contrary to the style guide, the output parameter of this function comes |
| 729 // before input parameters so Bind can be used on it to create a FetchCallback | 730 // before input parameters so Bind can be used on it to create a FetchCallback |
| 730 // to pass to DispatchFetchEvent. | 731 // to pass to DispatchFetchEvent. |
| 731 void ReceiveFetchResultOnIOThread( | 732 void ReceiveFetchResultOnIOThread( |
| 732 const base::Closure& quit, | 733 const base::Closure& quit, |
| 733 ChromeBlobStorageContext* blob_context, | 734 ChromeBlobStorageContext* blob_context, |
| (...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1872 NavigateToTestPage(); | 1873 NavigateToTestPage(); |
| 1873 // The V8 code cache must be stored to the CacheStorage which must be bigger | 1874 // The V8 code cache must be stored to the CacheStorage which must be bigger |
| 1874 // than 12 byte. | 1875 // than 12 byte. |
| 1875 EXPECT_GT(GetSideDataSize(), kV8CacheTimeStampDataSize); | 1876 EXPECT_GT(GetSideDataSize(), kV8CacheTimeStampDataSize); |
| 1876 | 1877 |
| 1877 NavigateToTestPage(); | 1878 NavigateToTestPage(); |
| 1878 EXPECT_GT(GetSideDataSize(), kV8CacheTimeStampDataSize); | 1879 EXPECT_GT(GetSideDataSize(), kV8CacheTimeStampDataSize); |
| 1879 } | 1880 } |
| 1880 | 1881 |
| 1881 } // namespace content | 1882 } // namespace content |
| OLD | NEW |