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

Unified Diff: content/browser/appcache/appcache_update_job.cc

Issue 344493002: Move all remaining appcache-related code to content namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/appcache/appcache_update_job.cc
diff --git a/webkit/browser/appcache/appcache_update_job.cc b/content/browser/appcache/appcache_update_job.cc
similarity index 98%
rename from webkit/browser/appcache/appcache_update_job.cc
rename to content/browser/appcache/appcache_update_job.cc
index 0c5593c1deb1ce2e7e78c39a83772217a07fd856..347d4b5c84853cff8129a25a1a33df473cd45f1a 100644
--- a/webkit/browser/appcache/appcache_update_job.cc
+++ b/content/browser/appcache/appcache_update_job.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "webkit/browser/appcache/appcache_update_job.h"
+#include "content/browser/appcache/appcache_update_job.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
@@ -10,6 +10,8 @@
#include "base/message_loop/message_loop.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
+#include "content/browser/appcache/appcache_group.h"
+#include "content/browser/appcache/appcache_histograms.h"
#include "net/base/io_buffer.h"
#include "net/base/load_flags.h"
#include "net/base/net_errors.h"
@@ -17,10 +19,8 @@
#include "net/http/http_request_headers.h"
#include "net/http/http_response_headers.h"
#include "net/url_request/url_request_context.h"
-#include "webkit/browser/appcache/appcache_group.h"
-#include "webkit/browser/appcache/appcache_histograms.h"
-namespace appcache {
+namespace content {
static const int kBufferSize = 32768;
static const size_t kMaxConcurrentUrlFetches = 2;
@@ -526,7 +526,7 @@ void AppCacheUpdateJob::HandleManifestFetchCompleted(
std::string message = FormatUrlErrorMessage(
kFormatString, manifest_url_, fetcher->result(), response_code);
HandleCacheFailure(AppCacheErrorDetails(message,
- appcache::APPCACHE_MANIFEST_ERROR,
+ APPCACHE_MANIFEST_ERROR,
manifest_url_,
response_code,
false /*is_cross_origin*/),
@@ -542,7 +542,7 @@ void AppCacheUpdateJob::OnGroupMadeObsolete(AppCacheGroup* group,
CancelAllMasterEntryFetches(AppCacheErrorDetails(
"The cache has been made obsolete, "
"the manifest file returned 404 or 410",
- appcache::APPCACHE_MANIFEST_ERROR,
+ APPCACHE_MANIFEST_ERROR,
GURL(),
response_code,
false /*is_cross_origin*/));
@@ -591,7 +591,7 @@ void AppCacheUpdateJob::ContinueHandleManifestFetchCompleted(bool changed) {
AppCacheErrorDetails(
message, APPCACHE_SIGNATURE_ERROR, GURL(), 0,
false /*is_cross_origin*/),
- APPCACHE_MANIFEST_ERROR,
+ MANIFEST_ERROR,
GURL());
VLOG(1) << message;
return;
@@ -790,7 +790,7 @@ void AppCacheUpdateJob::HandleMasterEntryFetchCompleted(
kFormatString, request->url(), fetcher->result(), response_code);
host_notifier.SendErrorNotifications(
AppCacheErrorDetails(message,
- appcache::APPCACHE_MANIFEST_ERROR,
+ APPCACHE_MANIFEST_ERROR,
request->url(),
response_code,
false /*is_cross_origin*/));
@@ -805,7 +805,7 @@ void AppCacheUpdateJob::HandleMasterEntryFetchCompleted(
// Section 6.9.4, step 22.3.
if (update_type_ == CACHE_ATTEMPT && pending_master_entries_.empty()) {
HandleCacheFailure(AppCacheErrorDetails(message,
- appcache::APPCACHE_MANIFEST_ERROR,
+ APPCACHE_MANIFEST_ERROR,
request->url(),
response_code,
false /*is_cross_origin*/),
@@ -857,14 +857,14 @@ void AppCacheUpdateJob::HandleManifestRefetchCompleted(
GURL(),
0,
false /*is_cross_origin*/),
- APPCACHE_MANIFEST_ERROR,
+ MANIFEST_ERROR,
GURL());
} else {
const char* kFormatString = "Manifest re-fetch failed (%d) %s";
std::string message = FormatUrlErrorMessage(
kFormatString, manifest_url_, fetcher->result(), response_code);
HandleCacheFailure(AppCacheErrorDetails(message,
- appcache::APPCACHE_MANIFEST_ERROR,
+ APPCACHE_MANIFEST_ERROR,
GURL(),
response_code,
false /*is_cross_origin*/),
@@ -951,8 +951,8 @@ void AppCacheUpdateJob::OnGroupAndNewestCacheStored(AppCacheGroup* group,
std::string message("Failed to commit new cache to storage");
if (would_exceed_quota) {
message.append(", would exceed quota");
- result = APPCACHE_QUOTA_ERROR;
- reason = appcache::APPCACHE_QUOTA_ERROR;
+ result = QUOTA_ERROR;
+ reason = APPCACHE_QUOTA_ERROR;
}
HandleCacheFailure(
AppCacheErrorDetails(message, reason, GURL(), 0,
@@ -1099,9 +1099,9 @@ void AppCacheUpdateJob::BuildUrlFileList(const Manifest& manifest) {
AddUrlToFileList(GURL(*it), AppCacheEntry::EXPLICIT);
}
- const std::vector<Namespace>& intercepts =
+ const std::vector<AppCacheNamespace>& intercepts =
manifest.intercept_namespaces;
- for (std::vector<Namespace>::const_iterator it = intercepts.begin();
+ for (std::vector<AppCacheNamespace>::const_iterator it = intercepts.begin();
it != intercepts.end(); ++it) {
int flags = AppCacheEntry::INTERCEPT;
if (it->is_executable)
@@ -1109,9 +1109,9 @@ void AppCacheUpdateJob::BuildUrlFileList(const Manifest& manifest) {
AddUrlToFileList(it->target_url, flags);
}
- const std::vector<Namespace>& fallbacks =
+ const std::vector<AppCacheNamespace>& fallbacks =
manifest.fallback_namespaces;
- for (std::vector<Namespace>::const_iterator it = fallbacks.begin();
+ for (std::vector<AppCacheNamespace>::const_iterator it = fallbacks.begin();
it != fallbacks.end(); ++it) {
AddUrlToFileList(it->target_url, AppCacheEntry::FALLBACK);
}
@@ -1608,4 +1608,4 @@ void AppCacheUpdateJob::DeleteSoon() {
base::MessageLoop::current()->DeleteSoon(FROM_HERE, this);
}
-} // namespace appcache
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698