OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "webkit/appcache/web_application_cache_host_impl.h" | 5 #include "webkit/appcache/web_application_cache_host_impl.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/id_map.h" | 8 #include "base/id_map.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "third_party/WebKit/WebKit/chromium/public/WebDataSource.h" | 10 #include "third_party/WebKit/WebKit/chromium/public/WebDataSource.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 void WebApplicationCacheHostImpl::OnProgressEventRaised( | 86 void WebApplicationCacheHostImpl::OnProgressEventRaised( |
87 const GURL& url, int num_total, int num_complete) { | 87 const GURL& url, int num_total, int num_complete) { |
88 // TODO(michaeln): Widen the webkit api to accept the additional data. | 88 // TODO(michaeln): Widen the webkit api to accept the additional data. |
89 // Also send the 'final' event once webkit layout tests have been updated. | 89 // Also send the 'final' event once webkit layout tests have been updated. |
90 // See https://bugs.webkit.org/show_bug.cgi?id=37602 | 90 // See https://bugs.webkit.org/show_bug.cgi?id=37602 |
91 if (num_complete < num_total) | 91 if (num_complete < num_total) |
92 client_->notifyEventListener(WebApplicationCacheHost::ProgressEvent); | 92 client_->notifyEventListener(WebApplicationCacheHost::ProgressEvent); |
93 } | 93 } |
94 | 94 |
| 95 void WebApplicationCacheHostImpl::OnLogMessage( |
| 96 LogLevel log_level, const std::string& message) { |
| 97 // TODO(michaeln): Widen the webkit api with this addition. |
| 98 // client_->notifyLogMessage(log_level, message); |
| 99 } |
| 100 |
95 void WebApplicationCacheHostImpl::willStartMainResourceRequest( | 101 void WebApplicationCacheHostImpl::willStartMainResourceRequest( |
96 WebURLRequest& request) { | 102 WebURLRequest& request) { |
97 request.setAppCacheHostID(host_id_); | 103 request.setAppCacheHostID(host_id_); |
98 std::string method = request.httpMethod().utf8(); | 104 std::string method = request.httpMethod().utf8(); |
99 is_get_method_ = (method == kHttpGETMethod); | 105 is_get_method_ = (method == kHttpGETMethod); |
100 DCHECK(method == StringToUpperASCII(method)); | 106 DCHECK(method == StringToUpperASCII(method)); |
101 } | 107 } |
102 | 108 |
103 void WebApplicationCacheHostImpl::willStartSubResourceRequest( | 109 void WebApplicationCacheHostImpl::willStartSubResourceRequest( |
104 WebURLRequest& request) { | 110 WebURLRequest& request) { |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 | 231 |
226 bool WebApplicationCacheHostImpl::swapCache() { | 232 bool WebApplicationCacheHostImpl::swapCache() { |
227 // Cache status will change when cache is swapped. Clear out any saved idea | 233 // Cache status will change when cache is swapped. Clear out any saved idea |
228 // of status so that backend will be queried for actual status. | 234 // of status so that backend will be queried for actual status. |
229 has_status_ = false; | 235 has_status_ = false; |
230 has_cached_status_ = false; | 236 has_cached_status_ = false; |
231 return backend_->SwapCache(host_id_); | 237 return backend_->SwapCache(host_id_); |
232 } | 238 } |
233 | 239 |
234 } // appcache namespace | 240 } // appcache namespace |
OLD | NEW |