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

Side by Side Diff: content/browser/appcache/appcache_navigation_handle.cc

Issue 2501343003: PlzNavigate: AppCache support. (Closed)
Patch Set: Address review comments Created 4 years 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/browser/appcache/appcache_navigation_handle.h"
6
7 #include "base/bind.h"
8 #include "content/browser/appcache/appcache_navigation_handle_core.h"
9 #include "content/browser/appcache/chrome_appcache_service.h"
10 #include "content/public/browser/browser_thread.h"
11 #include "content/public/common/appcache_info.h"
12
13 namespace {
14 // PlzNavigate: Used to generate the host id for a navigation initiated by the
15 // browser. Starts at -2 and keeps going down.
16 static int g_next_appcache_host_id = -1;
17 }
18
19 namespace content {
20
21 AppCacheNavigationHandle::AppCacheNavigationHandle(
22 ChromeAppCacheService* appcache_service)
23 : appcache_host_id_(kAppCacheNoHostId),
24 core_(nullptr),
25 weak_factory_(this) {
26 DCHECK_CURRENTLY_ON(BrowserThread::UI);
27 appcache_host_id_ = g_next_appcache_host_id--;
28 core_.reset(new AppCacheNavigationHandleCore(
29 weak_factory_.GetWeakPtr(), appcache_service, appcache_host_id_));
30 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
31 base::Bind(&AppCacheNavigationHandleCore::Initialize,
32 base::Unretained(core_.get())));
33 }
34
35 AppCacheNavigationHandle::~AppCacheNavigationHandle() {
36 DCHECK_CURRENTLY_ON(BrowserThread::UI);
37 // Delete the AppCacheNavigationHandleCore on the IO thread.
38 BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, core_.release());
39 }
40
41 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/appcache/appcache_navigation_handle.h ('k') | content/browser/appcache/appcache_navigation_handle_core.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698